Error when I run through the check_nrpe

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
fraguillen
Posts: 47
Joined: Fri May 18, 2018 11:40 am

Error when I run through the check_nrpe

Post by fraguillen »

Good morning,

I created this post a few days ago, you solved it satisfactorily:

https://support.nagios.com/forum/viewto ... 16&t=53443

Now I have the problem on HP-UX servers when executing it through the check_nrpe, with the same script from the previous case:

spefacnfs02:/opt/iexpress/nagios/libexec # /opt/iexpress/nagios/libexec/check_nrpe -H 127.0.0.1 -t 30 -c check_count_file -a '/recovery/nfs1/pipe_data/pin_rel/data'
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
spefacnfs02:/opt/iexpress/nagios/libexec #

The version of nrpe is:

spefacnfs02:/opt/iexpress/nagios/libexec # ./check_nrpe -H 127.0.0.1
NRPE v2.15
spefacnfs02:/opt/iexpress/nagios/libexec #

The version of HP-UX is as follows:

spefacnfs02:/opt/iexpress/nagios/libexec # uname -a
HP-UX spefacnf B.11.31 U ia64 1755937424 unlimited-user license
spefacnfs02:/opt/iexpress/nagios/libexec #

When executing the script directly it does not give me problems:

spefacnfs02:/opt/iexpress/nagios/libexec # ./check_count_file.sh /recovery/nfs1/pipe_data/pin_rel/data
OK - Hay 100165 archivos en la carpeta /recovery/nfs1/pipe_data/pin_rel/data | 'Cantidad'=100165;;
spefacnfs02:/opt/iexpress/nagios/libexec #

Can you help me?

Best regards...
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Error when I run through the check_nrpe

Post by lmiltchev »

Can you show us how the "check_count_file" command is defined on the client? Please post the entire nrpe.cfg file on the forum.

Lastly, run the command as the nagios user:

Code: Select all

su nagios -
./check_count_file.sh /recovery/nfs1/pipe_data/pin_rel/data
and show the output.
Be sure to check out our Knowledgebase for helpful articles and solutions!
fraguillen
Posts: 47
Joined: Fri May 18, 2018 11:40 am

Re: Error when I run through the check_nrpe

Post by fraguillen »

spefacnfs02:/ # su nagios -
spefacnfs02:/ # whoami
nagios
spefacnfs02:/ # cd /opt/iexpress/nagios/libexec/
spefacnfs02:/opt/iexpress/nagios/libexec # ./check_count_file.sh /recovery/nfs1/pipe_data/pin_rel/data
OK - Hay 95117 archivos en la carpeta /recovery/nfs1/pipe_data/pin_rel/data | 'Cantidad'=95117;;
spefacnfs02:/opt/iexpress/nagios/libexec #


spefacnfs02:/ # su - nagios
(c)Copyright 1983-2006 Hewlett-Packard Development Company, L.P.

$ cd /opt/iexpress/nagios/libexec
$ whoami
nagios
$ ./check_count_file.sh /recovery/nfs1/pipe_data/pin_rel/data
OK - Hay 95117 archivos en la carpeta /recovery/nfs1/pipe_data/pin_rel/data | 'Cantidad'=95117;;
$
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Error when I run through the check_nrpe

Post by lmiltchev »

Can you show us how the "check_count_file" command is defined on the client? Please post the entire nrpe.cfg file on the forum.
Be sure to check out our Knowledgebase for helpful articles and solutions!
fraguillen
Posts: 47
Joined: Fri May 18, 2018 11:40 am

Re: Error when I run through the check_nrpe

Post by fraguillen »

Dear:

Attached as requested.
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: Error when I run through the check_nrpe

Post by lmiltchev »

Your command expects 3 arguments:
command[check_count_file]=/opt/iexpress/nagios/libexec/check_count_file.sh $ARG1$ $ARG2$ $ARG3$
but you are passing only one. Change this command to:

Code: Select all

command[check_count_file]=/opt/iexpress/nagios/libexec/check_count_file.sh $ARG1$
Also, change:

Code: Select all

dont_blame_nrpe=0
to:

Code: Select all

dont_blame_nrpe=1
Save, exit, and restart NRPE service, so that changes can take effect. Try your command again. Does it work now?
Be sure to check out our Knowledgebase for helpful articles and solutions!
fraguillen
Posts: 47
Joined: Fri May 18, 2018 11:40 am

Re: Error when I run through the check_nrpe

Post by fraguillen »

Dear:

The script is configured to work with a single parameter.

However, I executed it with the three parameters and I get the same result.

spefacnfs02:/ # su - nagios
(c)Copyright 1983-2006 Hewlett-Packard Development Company, L.P.

$ /opt/iexpress/nagios/libexec/check_nrpe -H 127.0.0.1 -t 30 -c check_count_file -a '/recovery/nfs1/pipe_data/pin_rel/data 100000 200000'
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
$ cat /opt/iexpress/nagios/etc/nrpe.cfg | grep dont_blame_nrpe
dont_blame_nrpe=1
$
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Error when I run through the check_nrpe

Post by ssax »

Please send the output of these commands on the HPUX server:

Code: Select all

ps aux | grep nrpe
find / -name nrpe.cfg
fraguillen
Posts: 47
Joined: Fri May 18, 2018 11:40 am

Re: Error when I run through the check_nrpe

Post by fraguillen »

Good morning

As I indicated in the post principal, this server is an HP UX.

spefacnfs02:/ # find / -name nrpe.cfg
/opt/iexpress/nagios/etc/nrpe.cfg
spefacnfs02:/ #

spefacnfs02:/ # ps -feH | grep nrpe
root 19823 16643 0 08:19:53 pts/0 00:00:00 grep nrpe
nagios 8458 1 0 12:45:14 ? 00:00:11 /opt/iexpress/nagios/bin/nrpe -c /opt/iexpress/nagios/etc/nrpe.cfg -d
spefacnfs02:/ #
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Error when I run through the check_nrpe

Post by lmiltchev »

Did you restart NRPE after changing the value for dont_blame_nrpe from 0 to 1? Keep in mind that this option will work ONLY if you compiled NRPE with "--enable-command-args" option.

Try "hard-coding" the arguments to your command in the nrpe.cfg file to see if this is going to work.

Code: Select all

command[check_count_file]=/opt/iexpress/nagios/libexec/check_count_file.sh /recovery/nfs1/pipe_data/pin_rel/data
Save, exit, and restart NRPE.

Try running from the CLI:

Code: Select all

/opt/iexpress/nagios/libexec/check_nrpe -H 127.0.0.1 -H 127.0.0.1 -c check_count_file
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked