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

Thomas Guyot-Sionnest dermoth at aei.ca
Tue Apr 13 06:34:07 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 31/03/10 08:34 AM, Masopust, Christian wrote:
> 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   :-)))

Thanks for the patch. Could you please re-send it in the unified diff
format (diff -u)?

I may apply it but likely as an option to check_procs, as making it the
default could badly break existing checks.

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFLw/Q/6dZ+Kt5BchYRAszKAJ9Xzf1uWk0b8aAq4NIYJycECwcH7ACgh/kd
kZ2UagDh0FV0tLS8S1y4xJc=
=uChm
-----END PGP SIGNATURE-----




More information about the Devel mailing list