On usage of check_procs

Ralph.Grothe at itdz-berlin.de Ralph.Grothe at itdz-berlin.de
Thu Aug 11 09:45:44 CEST 2005


Hi Andreas,

> -----Original Message-----
> From: Andreas Ericsson [mailto:ae at op5.se]
> Sent: Wednesday, August 10, 2005 5:11 PM
> To: Ralph.Grothe at itdz-berlin.de
> Cc: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] On usage of check_procs
> 
> 

> check_procs will do this for you.

I thought so.

> This 2-line shell-script will actually consume a great deal
more CPU 
> cycles than simply using check_procs, because it needs to 
> invoke several 
> subshells.

I knew,
that's why I preferred using the binary check_procs.
Mind you, I only put the parentheses around the 2nd line to make
the return
not kick out my interactive shell (only marked and pasted lines
from my terminal window)
I wouldn't spawn unnecessary sub shells in a script.
However, I am aware about the processing costs of shell scripts
in general
as every not shell built-in command eventually would make a fork
and exec 
(let alone all the IPC fuss like pipe etc.)

While on the performance subject.
I'm not quite into C hacking.
I guess it would cost me at least ten times as long as doing it
in Perl.
(besides, I guess that the perils of memory leaks, dangling
pointers etc. owe to my unwary coding in C 
were more serious, Perl has a nice garbage collector that cleans
things up silently as soon
as a thingy goes out of scope)
That's why I prefer writing my own plug-ins in Perl.
When browsing through the docs I also came accross the chapter on
envPerl.
Since I haven't built my nagios binary with envPerl enabled,
and since I regarded that topic one of the more advanced (for
later deliberation),
I haven't yet cared much about it.
Is there more documentation, howtos, examples on envPerl than is
in the Nagios docs?
E.g. the mod_perl Apache fork dedicated a whole site with an
abundance of documentation
to their built-in Perl.
How does an envPerl Nagios compare to a standard one?


> 
> check_procs -m PROCS -w 1:1 -c 1:1 -s RDS -C sleep
> 
> will show only the 'sleep' processes in Running (or Runnable),
D 
> (Dormant, uninterruptable IO), S (Sleeping, interruptable IO)
mode, 
> which is more or less the states that aren't crashed. Some 
> systems have 
> the W (Paging) state as well, but I'm not sure about AIX.


So I got it almost.
Thanks for reminding me of the -s option.
No AIX on the remote hosts (which are mostly HP-UX, Solaris,
Linux, and well, AIX).
It's only my Nagios server that has to run under AIX.



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list