[Nagiosplug-devel] oddity about check_procs plugin and solaris
Andreas Ericsson
ae at op5.se
Thu Mar 26 09:28:19 CET 2009
Philip Brown wrote:
> I've been compiling nagios-plugins version 1.4.13 on solaris.
>
> I noticed with distaste the "pst3" hack. which requires being installed as
> ROOT??
>
> I find this nasty, since /bin/ps itself does not require root.
> So I've been attempting to get the pluging to work "the old fashioned way",
> calling ps.
>
> it SEEMS like it should work.
> looking at debug output, etc, etc.
>
> /usr/bin/ps -Ao 's uid pid ppid vsz rss pcpu comm args'
>
> seems to give all the information needed.
> sample output:
>
> S 0 15175 1 11304 6832 0.4 /usr/lsd/kerberos/5-1.4.1/sbin/krb5kdc
> /usr/lsd/kerberos/5-1.4.1/sbin/krb5kdc
>
>
> HOWEVER: the -vvv output from check_procs, parses this as
>
>
> CMD: /usr/bin/ps -Ao 's uid pid ppid vsz rss pcpu comm args'
> ....
> proc#=0 uid=0 vsz=11304 rss=6832 pid=15175 ppid=1 pcpu=0.30 stat=
> S etime= prog=krb5kdc args=
> /usr/lsd/kerberos/5-1.4.1/sbin/krb5kdc
>
> (note how "prog" gets inexplicably truncated to `basename`, instead of full
> path?!!)
>
-vvv is debugging output. It shows variables important for the developer
to know about, so if you want to make sense of them (or see if it actually
uses the truncated path), you will have to browse the source.
> This is particularly troublesome, since we have previously been checking if
> prog is running with
>
> check_procs -C /usr/lsd/kerberos/5-1.4.1/sbin/krb5kdc
>
> Why is chgeck_procs truncating the prog path like that, when the raw PS
> command is clearly NOT truncating?!
>
Again, it may not. Copy-paste the code snippets where it truncates the
variables and then again where it actually uses the truncated variable.
Then we can talk, although preferrably with fewer exclamation marks.
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
More information about the Devel
mailing list