Page 1 of 2

Error when I run through the check_nrpe

Posted: Mon Apr 22, 2019 10:24 am
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...

Re: Error when I run through the check_nrpe

Posted: Mon Apr 22, 2019 11:06 am
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.

Re: Error when I run through the check_nrpe

Posted: Mon Apr 22, 2019 11:40 am
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;;
$

Re: Error when I run through the check_nrpe

Posted: Mon Apr 22, 2019 11:50 am
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.

Re: Error when I run through the check_nrpe

Posted: Mon Apr 22, 2019 12:14 pm
by fraguillen
Dear:

Attached as requested.

Re: Error when I run through the check_nrpe

Posted: Mon Apr 22, 2019 12:24 pm
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?

Re: Error when I run through the check_nrpe

Posted: Mon Apr 22, 2019 12:50 pm
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
$

Re: Error when I run through the check_nrpe

Posted: Mon Apr 22, 2019 5:05 pm
by ssax
Please send the output of these commands on the HPUX server:

Code: Select all

ps aux | grep nrpe
find / -name nrpe.cfg

Re: Error when I run through the check_nrpe

Posted: Tue Apr 23, 2019 8:23 am
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:/ #

Re: Error when I run through the check_nrpe

Posted: Tue Apr 23, 2019 11:10 am
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