When I run the following command locally from a command prompt on a server I get good results, but when I incorporate it into a check with Nagios I get nothing.
command = check_winprocess.exe --filter "imagename eq cmd.exe" --filter "windowtitle eq Administrator: 2) NITROSERVER64 UNDERLYING"
results = PROCESS OK - 1 process(es)|processes=1;;;
results from Nagios attempt see below
Status Information: PROCESS OK - 0 process(es)
Performance Data: processes=0;;;
OS = Windows 2008 R2 64bit
Your command checks if there is a window with the title "Administrator". That kind of operation requires access to Windows interface. This is true when you run the command from a command prompt in Windows. However, the same can not be said when you run check_winprocess as a plugin: It is run by an other program and has no access to Windows interface. Try to run the command without the filter windowtitle.
Hi, I just found this thread describing exactly the problems we are having when we want to include check_winprocess in our Nagios config. We want to monitor if a certain process is in NOT RESPONDING state and I have tried to do this by using both the status filter and the windowtitle filter without luck when running the command remotely (via check_nrpe on the Nagios host to the NRPE plugin in NSClient++ where I have specified the check_winprocess command as an external script). When I run these commands locally it's all good.
Is there no way at all to get this working?
As I described at my previous post, checking windows titles won't work: check_winprocess is run by a service account with no access to Windows GUI.
I got that from your last reply. How about process status? Is the situation the same there or is it possible to get that working somehow? One would think that shouldn't be related to the GUI.
Maybe it is time to publish your command.
When I run it locally like this while I'm trying to open a 800mb logfile in notepad:
check_winprocess.exe --filter "imagename eq notepad.exe" --filter "status eq NOT RESPONDING" --kill --critical 1
Everything is great and I get this result:
PROCESS OK - 1 process(es) (killed)|processes=1;;1;
But when I specify it as an external script in NSClient++ like this:
check_notresponding=check_winprocess.exe --filter "imagename eq notepad.exe" --filter "status eq NOT RESPONDING" --kill --critical 1
And run it from our Nagios host like this:
/usr/lib/nagios/plugins/check_nrpe -H <ip of machine> -c check_notresponding
...it doesn't detect the unresponsive application:
PROCESS OK - 0 process(es) (killed)|processes=0;;1;
If I disable the "status eq NOT RESPONDING" filter it finds the process and kills it, but that's not what I want to do. :)
Thanks. I think the problem can be related to permissions of the NSClient++ service account. It seems that it has sufficient permissions to read name of the process. However, the same is not true for reading detailed process information to determine if a process is in zombie state.