how to install NRPE check plugin for Windows

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: how to install NRPE check plugin for Windows

Post by lmiltchev »

I believe the issue is caused by the spaces in the service name ("Teamcenter DispatcherClient V10000.1.0.41_20150609.00"). Is this the "Service name" or "Display name"? Can you right-click on the service, go to Properties, and see if there is an "alternative" name with no spaces? The plugin works, but escaping these spaces proves to be quite challenging...

For example, if I use a service with no spaces, the plugin works just fine:

Code: Select all

[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -t 300 -c check_winprocess -a '--filter "services eq CarboniteService"'
PROCESS OK - 1 process(es)|'processes'=1
Adding a second filter works, too.

Code: Select all

[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -t 300 -c check_winprocess -a '--filter "services eq CarboniteService" --filter "memusage gt 10000" --warn 0'
PROCESS WARNING - 1 process(es)|'processes'=1;0
[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -t 300 -c check_winprocess -a '--filter "services eq CarboniteService" --filter "memusage gt 10000000" --warn 0'
PROCESS OK - 0 process(es)|'processes'=0;0
In the second command, I am getting "0 processes" as the memory usage of the CarboniteService is less than 10000000K.
The "--warn" flag also works.

Code: Select all

[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -t 300 -c check_winprocess -a '--filter "services eq CarboniteService" --filter "memusage gt 10000" --warn 0'
PROCESS WARNING - 1 process(es)|'processes'=1;0
[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -t 300 -c check_winprocess -a '--filter "services eq CarboniteService" --filter "memusage gt 10000" --warn 1'
PROCESS OK - 1 process(es)|'processes'=1;1
In the second command, I get "PROCESS OK" instead of "PROCESS WARNING" as the number of processes doesn't exceed the warning threshold.

So far, so good. Now, when I try to run the same check against a service with spaces in the name, it fails.

Code: Select all

[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -t 300 -c check_winprocess -a '--filter "services eq Adobe Acrobat Update Service"'
PROCESS OK - 0 process(es)|'processes'=0
As you can see, it shows "0 processes". I tried escaping the spaces, used single, and double quotes, etc. but I was not able to make this work. :(

However, when I use the "Service name", which doesn't contain spaces ("AdobeARMservice"), I get the expected output:

Code: Select all

[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -t 300 -c check_winprocess -a '--filter "services eq AdobeARMservice"'
PROCESS OK - 1 process(es)|'processes'=1
Be sure to check out our Knowledgebase for helpful articles and solutions!
caterpillartce
Posts: 117
Joined: Mon Jul 11, 2016 11:22 am

Re: how to install NRPE check plugin for Windows

Post by caterpillartce »

Unfortunately that is both the service name and display name...

I can run the check_winprocess.exe with all those parameters in Windows command line on the server being monitored and get the desired result, which tells me check_winprocess.exe doesn't care about the spaces in the name (it recognizes the " around the filters)... See attached scrrenshot.

Is there a way for Nagios check_nrpe to work with it too?

Thanks
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: how to install NRPE check plugin for Windows

Post by lmiltchev »

Try the following.
1. Change your command in the nsclient.ini file to this:

Code: Select all

check_winprocess=scripts\check_winprocess.exe --filter "services eq $ARG1$" --filter "memusage gt $ARG2$" --warn "$ARG3$"
2. Restart the NSClient++ service, so that changes can take effect.

3. Test it by running the following command from the CLI on the Nagios XI server:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_winprocess -a 'Teamcenter DispatcherClient V10000.1.0.41_20150609.00' 50 0
This *should* work. Well, it worked for me:

Code: Select all

[root@localhost libexec]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_winprocess -a 'AMD External Events Utility' 100 0
PROCESS WARNING - 1 process(es)|'processes'=1;0
[root@localhost libexec]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_winprocess -a 'AMD External Events Utility' 100 1
PROCESS OK - 1 process(es)|'processes'=1;1
Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
caterpillartce
Posts: 117
Joined: Mon Jul 11, 2016 11:22 am

Re: how to install NRPE check plugin for Windows

Post by caterpillartce »

Thanks for all the help. I found a way to make this kind of plugins work - use a wrapper bat file to put in the entire command line with all the parameters and call for the bat file in the nsclient.ini file instead.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: how to install NRPE check plugin for Windows

Post by lmiltchev »

Great! I am glad the issue has been resolved. I am locking this topic. If you have any more questions, please start a new thread.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked