Page 1 of 1
Nagios to monitor multiple windows processes with same name
Posted: Tue May 02, 2017 10:49 am
by inas.labib
Hi Team ,
We use Nagios xi 5.2.2. Currently we monitor Windows processes as below.
COMMAND: /usr/local/nagios/libexec/check_nt -H <Windows_Host> -s "Password" -p 12489 -v PROCSTATE -l Rundbb.exe -d SHOWALL
OUTPUT: rundbb.exe: Running
But the "rundbb.exe" process is running in different names in Windows server (attached screenshot). We need to monitor each rundbb processes separately .
Please assist.
Re: Nagios to monitor multiple windows processes with same n
Posted: Tue May 02, 2017 3:32 pm
by mcapra
This community post covers that:
http://forums.nsclient.org/t/check-proc ... ent/3665/2
FYI I wasn't able to get this working on the latest version of NSClient++. Had to use 0.4.3:
Code: Select all
[root@xi-stable ~]# /usr/local/nagios/libexec/check_nrpe --host 192.168.67.99
I (0.4.3.143 2015-04-29) seem to be doing fine...
One thing you will need to change is to use check_nrpe and the NSClient++ NRPEServer rather than check_nt. Here's an example using Java processes:
Code: Select all
[root@xi-stable ~]# /usr/local/nagios/libexec/check_nrpe --host 192.168.67.99 --command check_process -a "process=javaw.exe"
OK: all processes are ok.|'javaw.exe state'=1;0;0 'javaw.exe state'=1;0;0 'count'=2;0;0
But maybe I want to match something like this with the
arg1 specifically:
2017_05_02_15_24_38_192.168.67.99_Remote_Desktop_Connection.png
NSClient++ offers the
filter argument to do that sort of thing. Like so:
Code: Select all
[root@xi-stable ~]# /usr/local/nagios/libexec/check_nrpe --host 192.168.67.99 --command check_process -a process="javaw.exe" "filter=command_line like 'arg1'"
OK: all processes are ok.|'javaw.exe state'=1;0;0 'count'=1;0;0
Which can target my special process specifically.
Re: Nagios to monitor multiple windows processes with same n
Posted: Wed May 03, 2017 9:25 am
by inas.labib
Hi ,
Thanks for the response. We tried to execute the same.
Manual execution:
nagios@nagios_server:~$ /usr/local/nagios/libexec/check_nrpe --host 10.x.x.x --command check_process -a process="rundbb.exe" "filter=command_line like 'WF_EmailSms'"
OK: all processes are ok.|'rundbb.exe state'=1;0;0 'count'=1;0;0
nagios@nagios_server:~$ /usr/local/nagios/libexec/check_nrpe --host 10.x.x.x --command check_process -a process="rundbb.exe" "filter=command_line like 'WF_EmailSms'"
OK: No processes found|'count'=0;0;0
Also, we tried to implement the same command in Nagios xi web interface. please find the screenshot attached
Defined command :
$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c check_process -a process="$ARG1$" "filter=command_line like '$ARG2$'"
in GUI, insted of "Critical" its showing "Unknown". Please assist.
Re: Nagios to monitor multiple windows processes with same n
Posted: Wed May 03, 2017 11:55 am
by tgriep
To get the check to return a critical instead of an unknown status, you would have to add the empty-state option to your command.
Code: Select all
/usr/local/nagios/libexec/check_nrpe --host 10.x.x.x --command check_process -a process="rundbb.exe" "filter=command_line like 'WF_EmailSms'" empty-state=critical
When the check is run and no processes are matched, it is considered an empty state and that option will return a critical status instead of an unknown.
http://forums.nsclient.org/t/check-proc ... cal/4022/3
https://docs.nsclient.org/0.4.4/referen ... mpty-state
Re: Nagios to monitor multiple windows processes with same n
Posted: Sun May 07, 2017 4:02 am
by inas.labib
Thanks for the assistance. It works fine. Kindly close