Page 1 of 2
check_nrpe issue
Posted: Fri May 08, 2015 7:40 am
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?
Re: check_nrpe issue
Posted: Fri May 08, 2015 9:53 am
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:
Re: check_nrpe issue
Posted: Fri May 08, 2015 10:12 am
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
Re: check_nrpe issue
Posted: Fri May 08, 2015 10:24 am
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
Re: check_nrpe issue
Posted: Tue May 12, 2015 4:35 am
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 -)?
Re: check_nrpe issue
Posted: Tue May 12, 2015 7:46 am
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.
Re: check_nrpe issue
Posted: Wed May 13, 2015 8:19 am
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 "-".
Re: check_nrpe issue
Posted: Wed May 13, 2015 9:25 am
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.
Re: check_nrpe issue
Posted: Wed May 13, 2015 9:39 am
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.
Re: check_nrpe issue
Posted: Wed May 13, 2015 9:53 am
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.