[Nagiosplug-devel] check_procs (pst3), Solaris 10 and Zones

Masopust, Christian christian.masopust at siemens.com
Wed Mar 31 14:34:23 CEST 2010


Hi all,
 
as I had the problem that my check_procs in my Solaris 10 global-zone always also
counts all processes from other zones, I modified pst3.c the following way
(diff is against pst3.c from nagios-plugins 1.4.14): 
 
diff -w pst3.c-orig pst3.c
53a54,56
> #ifdef SOLARIS10
> #include <zone.h>
> #endif
81a85,87
> #ifdef SOLARIS10
>   zoneid_t my_zoneid;
> #endif
101a108,115
> #ifdef SOLARIS10
>   /* get my zone-id */
>   if ((my_zoneid = getzoneid()) == -1) {
>     fprintf(stderr, "%s: cannot read my zone-id\n");
>     exit(1);
>   }
> #endif
>
157a172,178
> #ifdef SOLARIS10
>     /* process not running in my zone? */
>     if (my_zoneid != psinfo.pr_zoneid) {
>       continue;
>     }
> #endif
>

this will cause pst3 to output only processes from the zone it is running.
(Makefile has to be modified too to define "SOLARIS10" in CFLAGS)
 
maybe that's useful for some others too   :-)))
 
christian
 
 

___________________________________________________________

        Christian Masopust

        SIEMENS AG  SIS SDE SVI CON IPB
        Tel:   +43 (0) 5 1707 26866
        E-mail: christian.masopust at siemens.com
        Addr: Austria, 1210 Vienna, Siemensstraße 90-92, B. 33, Rm. 243

        Leader of the RUGA <http://www.rational-ug.org/groups.php?groupid=119> 

        Firma: Siemens Aktiengesellschaft Österreich, Rechtsform: Aktiengesellschaft, 
        Sitz: Wien, Firmenbuchnummer: FN 60562 m, 
        Firmenbuchgericht: Handelsgericht Wien, DVR 0001708 
        ___________________________________________________________



 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20100331/a5d52fd5/attachment.html>


More information about the Devel mailing list