Check_winprocess.exe

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
sarpione
Posts: 49
Joined: Fri Oct 14, 2016 10:02 am

Check_winprocess.exe

Post by sarpione »

Hi, im using Nagios XI and i need to do a passive checks from a windows 7 host.

To do that i use NRDS client, now i need to check if some process exist or not, for example "CMD.exe" and if exist say "OK" and if not say "Critical"

Can anyoone explain me what i have to type to do that?

that is my example and dosent work...

command[process_CMD]= .\plugins\check_winprocess.exe --filter "imagename eq cmd.exe" --compare le --critical 0

Thx a lot
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Check_winprocess.exe

Post by mcapra »

Did you reference this document when setting up NRDS? It describes the process pretty efficiently:
https://labs.nagios.com/2014/07/31/how- ... nagios-xi/

You might also consider using NCPA to submit your passive checks since NCPA is a bit more modern and in active development:
https://assets.nagios.com/downloads/ncp ... g_NCPA.pdf
Former Nagios employee
https://www.mcapra.com/
sarpione
Posts: 49
Joined: Fri Oct 14, 2016 10:02 am

Re: Check_winprocess.exe

Post by sarpione »

i already use NRDS and works excellent with some plugins like check_log.exe, but i cant configure check_winprocess.exe as well...
so maybe someone can say me what i need to type in the config.ini (nrds) to check if one process exist or not..
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Check_winprocess.exe

Post by mcapra »

Can you run your sample command from the command prompt and share it's output? This will help us in figuring out what is going wrong with the command itself (if anything).

The basic syntax looks correct. Here's the output I get from my sample command for Google Chrome processes:

Code: Select all

C:\Program Files\NSClient++\scripts>check_winprocess.exe --filter "imagename eq chrome.exe" --compare le --critical 0
PROCESS OK - 3 process(es)|processes=3;;0;
And if I kill off the Chrome processes:

Code: Select all

C:\Program Files\NSClient++\scripts>check_winprocess.exe --filter "imagename eq chrome.exe" --compare le --critical 0
PROCESS CRITICAL - 0 process(es)|processes=0;;0;
Former Nagios employee
https://www.mcapra.com/
sarpione
Posts: 49
Joined: Fri Oct 14, 2016 10:02 am

Re: Check_winprocess.exe

Post by sarpione »

mcapra wrote:Can you run your sample command from the command prompt and share it's output?
I dont now how to do that.
If you guide me, i can share that information.
ty
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_winprocess.exe

Post by tgriep »

Can you post your full config.ini file so we can review it?
Also, the first time a new check is run on the remote host, you will have to configure it in the XI web interface.
If you login to the XI GUI and go to the Admin > Unconfigured Objects menu, so you see that service there?
If so, click in it to configure it, then the XI server will start to monitor it after that.
Be sure to check out our Knowledgebase for helpful articles and solutions!
sarpione
Posts: 49
Joined: Fri Oct 14, 2016 10:02 am

Re: Check_winprocess.exe

Post by sarpione »

This is my config.ini

[settings]
CONFIG_VERSION=0
CONFIG_NAME=
URL="My IP"
TOKEN=1234567
PLUGIN_DIR=C:\Program Files\Nagios\NRDS_Win\plugins
UPDATE_CONFIG=1
UPDATE_PLUGINS=1
LOG_FILE=C:\Program Files\Nagios\NRDS_Win\logs\NRDS_debug.log

[services]
#<check_name> = <path location\file name> <check arguments>
Time = .\plugins\check_windows_time.bat 192.168.230.69 180 300


#<check_name> = <path location\file name> <check arguments>
LOG = .\plugins\check_log3.exe -s NUL -l "C:\ISALtda\PTPOS\terminal.properties" -p "usa_controladora=[Ss]i" --negate -c 1


#<check_name> = <path location\file name> <check arguments>
command[process_CMD]= .\plugins\check_winprocess.exe --filter "imagename eq cmd.exe" --compare le --critical 0



[extensions]
vbs = cscript //nologo $CHECK_COMMAND$
ps1 = powershell -ExecutionPolicy Bypass -File $CHECK_COMMAND$

Can you post your full config.ini file so we can review it?
tgriep wrote:Also, the first time a new check is run on the remote host, you will have to configure it in the XI web interface.
If you login to the XI GUI and go to the Admin > Unconfigured Objects menu, so you see that service there?
If so, click in it to configure it, then the XI server will start to monitor it after that.
Im already do it, the service work find, but i got problems with the report of "Check_winprocess.exe" i need they show me "OK" if the process are runninig and critical if process isn't.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_winprocess.exe

Post by tgriep »

I tested that command like your example and it worked for me like it should.
Can you post a screen capture of what you are seeing in the XI GUI?
Be sure to check out our Knowledgebase for helpful articles and solutions!
sarpione
Posts: 49
Joined: Fri Oct 14, 2016 10:02 am

Re: Check_winprocess.exe

Post by sarpione »

Without a cmd process running it show me ok 1 process

Image

When i have 1 cmd process running in nagios show me 2 ok.

Image

So, never show me critical...
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_winprocess.exe

Post by tgriep »

I tested that command using notepad.exe and it worked.
What I am guessing is that when the plugin is ran, is spawns a command prompt to run it and that is why you always see 1 process.
Try changing the critical threshold to 1 and you should get the outcome you are looking for.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked