check_nrpe issue

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
dimitri_ak
Posts: 6
Joined: Fri May 08, 2015 7:21 am

check_nrpe issue

Post by dimitri_ak »

Hi everyone,

I have a problem and I don't know where I can find a solution. Please help me.

I have the latest nagios core installed on centos 7. Except others checking commands I used check_nrpe to monitor windows processes. I have the following issue: I can have a status of all processes except, for example, notepad++.exe or any others which have special chars. How can I resolve this issue?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_nrpe issue

Post by ssax »

Please post your service definition for the notepad++.exe one.

I know it works from the command line like this:

Code: Select all

./check_nrpe -H 192.168.5.232 -c check_process -a notepad++.exe
Or this:

Code: Select all

./check_nrpe -H 192.168.5.232 -c check_process -a notepad\+\+.exe
You might try escaping it:

Code: Select all

notepad\+\+.exe
dimitri_ak
Posts: 6
Joined: Fri May 08, 2015 7:21 am

Re: check_nrpe issue

Post by dimitri_ak »

Thanks for response.

I have already tried your variants, it didn't help:
CRITICAL: notepad++.exe: stopped < critical|'notepad++.exe'=0;0;1
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_nrpe issue

Post by lmiltchev »

I tried the "legacy" check_nt and it worked just fine:

Code: Select all

/usr/local/nagios/libexec/check_nt -H x.x.x.x -s "password" -p 12489 -v PROCSTATE -l notepad++.exe -d SHOWALL
 notepad++.exe: Running
I will test it with "check_nrpe" as well but if it doesn't work, you can always use "check_nt". :)

Update: check_nrpe worked fine for me, too.

In the nsclient.ini:

Code: Select all

alias_process = check_process "process=$ARG1$" "crit=state != 'started'"
Testing from the CLI:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c alias_process -a notepad++.exe
OK: |'notepad++.exe state'=1;0;1
Be sure to check out our Knowledgebase for helpful articles and solutions!
dimitri_ak
Posts: 6
Joined: Fri May 08, 2015 7:21 am

Re: check_nrpe issue

Post by dimitri_ak »

I also tried check_nrpe on other server with the same version of nagios and it worked fine.

So I have a question what component I missed? Maybe there is some additional plugin for supporting special chars (like + and -)?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: check_nrpe issue

Post by jdalrymple »

My off the cuff guess would be that it's related to nsclient versions and the "allow nasty characters" setting in nsclient.ini. In order to know for sure I'd have to setup a test scenario - but in lieu of doing that I'd prefer to just recommend you use the most current version of nsclient you are able to and set the "allow nasty characters" to 1 where necessary.
dimitri_ak
Posts: 6
Joined: Fri May 08, 2015 7:21 am

Re: check_nrpe issue

Post by dimitri_ak »

I installed the latest version of NSClient++ and set "allow nasty characters" to true - it didn't help. Could you tell me where I should find the problem on client side or on server side?
I should say that I have a problem only with checking the process that contain "+" and "-".
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: check_nrpe issue

Post by jdalrymple »

If it works on one server and not another, it wouldn't be related to nagios. The only thing that would really come into play would be the check_nrpe binary, or how the arguments are being passed on the command line. You're saying that both servers work OK as long as there are no special characters, but only 1 works OK with special characters (to the same client).

Also - we've never seen what your error is, you've only told us "it doesn't work" - knowing an error output might be helpful in debugging.
dimitri_ak
Posts: 6
Joined: Fri May 08, 2015 7:21 am

Re: check_nrpe issue

Post by dimitri_ak »

This is the output of check_nrpe command:

Code: Select all

[root@nagios objects]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c alias_process -a notepad++.exe
CRITICAL: notepad++.exe: stopped < critical|'notepad++.exe'=0;0;1
If you need any logs it is not a problem, just say which one. Thanks.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: check_nrpe issue

Post by jdalrymple »

dimitri_ak wrote:This is the output of check_nrpe command:

Code: Select all

[root@nagios objects]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c alias_process -a notepad++.exe
CRITICAL: notepad++.exe: stopped < critical|'notepad++.exe'=0;0;1
If you need any logs it is not a problem, just say which one. Thanks.
From a Nagios perspective - this is golden. Nothing is wrong here. I'm assuming that notepad++.exe was actually running when you ran the check and it gave you unexpected results? If so that is something you need to take to the nsclient forums - Nagios and NRPE are doing their job A-OK in the example you shared.
Locked