Re: how to install NRPE check plugin for Windows
Posted: Fri Aug 26, 2016 10:49 am
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:
Adding a second filter works, too.
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.
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.
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:
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'=1Code: 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;0The "--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;1So 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'=0However, 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