Page 1 of 1

nrpe timeout

Posted: Wed Oct 02, 2019 7:35 am
by junkertf
Hello,

I have a local disk wait time monitor script, what is working well on out half infrastructure, but on the other half not.

/etc/sudoers
# NEEDED TO ALLOW NAGIOS TO CHECK SERVICE STATUS
Defaults:nagios !requiretty
nagios ALL = NOPASSWD:SETENV: /sbin/service, /usr/local/nagios/libexec/check_init_service, /usr/sbin/dmidecode, /usr/local/nagios/libexec/xsos, /usr/local/nagios/libexec/check_osinfo.sh, /usr/local/nagios/libexec/check_iostst_v110.sh

nrpe.cfg
command[check_diskawt]=sudo -E /usr/local/nagios/libexec/check_iostst_v110.sh $ARG1$
nrpe_user=nagios
nrpe_group=nagios

[root@host ~]# ls -l /usr/local/nagios/libexec/check_iostst_v110.sh
-rwxr-xr-x 1 nagios nagios 6928 Oct 2 09:20 /usr/local/nagios/libexec/check_iostst_v110.sh

logging in as nagios:
[nagios@host ~]$ sudo -E /usr/local/nagios/libexec/check_iostst_v110.sh -w 20 -c 38
OK - sda await (ms): 0.00; | 'sda tps'=2.99; 'sda KB_read/s'=0.00; 'sda KB_written/s'=59.70; 'sda await'=0.00; |

but if i run same chack from nrpe side:
[nagios@host ~]$ /usr/local/nagios/libexec/check_nrpe -H localhost -t 90 -c check_diskawt -a '-w 25 -c 38'
NRPE: Command timed out after 60 seconds

Now i am totally clueless, strace not give any help, also debug mode logging give me the lines:
Oct 2 13:50:10 host nrpe[18432]: WARNING: my_system() seteuid(0): Operation not permitted
Oct 2 13:50:20 host nrpe[18527]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
Oct 2 13:50:20 host nrpe[18528]: WARNING: my_system() seteuid(0): Operation not permitted
Oct 2 13:50:40 host nrpe[18567]: INFO: SSL/TLS initialized. All network traffic will be encrypted.

what is, if i found well, normal messages, and logged on that times also when other checks are coming in and working well...

Please help the issue,

best regards,

Ferenc

Re: nrpe timeout

Posted: Wed Oct 02, 2019 1:36 pm
by benjaminsmith
Hello Ferenec,

On the other half that is not working, did it ever work?

1. What version of the NRPE did you install?

Code: Select all

./check_nrpe
2. From the Nagios XI server, run nmap on the remote host running NRPE and post the output. The default port for NRPE is and it should be open.

Code: Select all

nmap <remote host ip address>
3. Run this tail command and post the output. Thanks.

Code: Select all

tail -/var/log/messages

Re: nrpe timeout

Posted: Mon Oct 07, 2019 1:59 am
by junkertf
Hello,

Thank you for the answer, the script is running well now. All the other nrpe check worked still when these one not...
The error was with that the nrpe calling of the command.
[command]=sudo cmd
and also the cmd contained a sudo line. When i let the sudo line in the script and delete the "sudo" section before the cmd in the [command] line, the solution begin worked on all hosts.

The case can be closed, thank you, best regards,

ferenc

Re: nrpe timeout

Posted: Mon Oct 07, 2019 6:45 am
by scottwilkerson
junkertf wrote:Hello,

Thank you for the answer, the script is running well now. All the other nrpe check worked still when these one not...
The error was with that the nrpe calling of the command.
[command]=sudo cmd
and also the cmd contained a sudo line. When i let the sudo line in the script and delete the "sudo" section before the cmd in the [command] line, the solution begin worked on all hosts.

The case can be closed, thank you, best regards,

ferenc
Great!

Locking