Nagios to monitor multiple windows processes with same name

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

Nagios to monitor multiple windows processes with same name

Post 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.
You do not have the required permissions to view the files attached to this post.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios to monitor multiple windows processes with same n

Post 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.
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
https://www.mcapra.com/
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

Re: Nagios to monitor multiple windows processes with same n

Post 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.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios to monitor multiple windows processes with same n

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

Re: Nagios to monitor multiple windows processes with same n

Post by inas.labib »

Thanks for the assistance. It works fine. Kindly close
Locked