[Nagiosplug-help] check_procs syntax please advise......
Jonathan Angliss
jon at netdork.net
Sat May 21 04:13:29 CEST 2011
On 05/13/11 09:22, Mike Loud wrote:
> I am trying to check if a particular script is running constantly on my
> server. I was thinking of using check_procs, but the problem is, when i
> run a ps -e the process just shows as php so that is what check_procs
> sees it as. When I run ps aux, it shows what i need to verify which is:
> obs 14186 0.0 0.0 162892 8244 pts/0 S 08:52 0:00 php
> index.php logwatch/start . I need to make sure that logwatch/start is
> running.
>
> My question is how can i do this through check_procs, or if I cant, is
> there another way? I know I can mangle some commands to get just the
> output I want to see if its running such as ps aux |grep logwatch/start
> |grep -v grep | awk '{print $13}', but how do I tie that into the
> plugin? Any thoughts are appreciated. Thanks.
As logwatch/start is an argument, you should be able to use the -a
option, which looks for arguments of a running process. A helpful flag
is -v which shows exactly what check_procs is doing, the more v the more
details. -vv shows the ps command executed, -vvv shows the result set,
so you get an idea of what's being parsed. An example, if I want to see
if npcd is running on my machine, and is calling the cfg file, I'd use this:
./check_procs -w 2:2 -c 2:15 -a npcd.cfg -vv
Remove the -vv when you're happy with the results.
--
Jonathan Angliss
More information about the Help
mailing list