Page 2 of 4

Re: NRPE Socket timeout

Posted: Thu Oct 10, 2019 10:02 am
by scottwilkerson
fsodah wrote:check_hda1
bash: check_hda1: command not found...
From the Nagios XI server

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H YOUR_REMOTE_HOST_IP -c check_hda1

Re: NRPE Socket timeout

Posted: Fri Oct 11, 2019 1:25 pm
by fsodah
Is not working ...

On the remote client

Code: Select all

[root@ccccccc ~]# systemctl status nrpe.service
â—ڈ nrpe.service - Nagios Remote Program Executor
   Loaded: loaded (/usr/lib/systemd/system/nrpe.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-10-11 21:21:25 EEST; 5s ago
     Docs: http://www.nagios.org/documentation
  Process: 6946 ExecStopPost=/bin/rm -f /var/run/nrpe/nrpe.pid (code=exited, status=0/SUCCESS)
 Main PID: 6948 (nrpe)
    Tasks: 1
   CGroup: /system.slice/nrpe.service
           └─6948 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f

Oct 11 21:21:25 cccccccc systemd[1]: Started Nagios Remote Program Executor.
Oct 11 21:21:25 ccccccccc nrpe[6948]: Starting up daemon
Oct 11 21:21:25 cccccccccccc.nrpe[6948]: Server listening on 0.0.0.0 port 5666.
Oct 11 21:21:25 ccccccccc nrpe[6948]: Server listening on :: port 5666.
Oct 11 21:21:25 cccccccccnrpe[6948]: Listening for connections on port 5666
Oct 11 21:21:25 ccccccccc nrpe[6948]: Allowing connections from: 127.0.0.1, 10.1.23.222


On the nagios server

Code: Select all

[-t timeout] [-u unit] [-v] [-X type] [-N type] [-n]
[root@nagios libexec]# /usr/local/nagios/libexec/check_nrpe -H 10.38.10.1 -c check_disk
NRPE: Command 'check_disk' not defined
[root@nagios libexec]# /usr/local/nagios/libexec/check_nrpe -H 10.38.10.1 -c check_disk
NRPE: Command 'check_disk' not defined
[root@nagios libexec]# /usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v3.2.1
[root@nagios libexec]# /usr/local/nagios/libexec/check_nrpe -H 10.38.10.1 
NRPE v3.2.1
[root@nagios libexec]# /usr/local/nagios/libexec/check_nrpe -H 10.38.10.1 -c check_hda1
NRPE: Unable to read output
[root@nagios libexec]# /usr/local/nagios/libexec/check_nrpe -H 10.38.10.1 -c check_sda1
NRPE: Command 'check_sda1' not defined
[root@nagios libexec]# /usr/local/nagios/libexec/check_nrpe -H 10.38.10.1 -c check_sda
NRPE: Command 'check_sda' not defined
[root@nagios libexec]# /usr/local/nagios/libexec/check_nrpe -H 10.38.10.1 -c check_hda2
NRPE: Command 'check_hda2' not defined
[root@nagios libexec]# 

Re: NRPE Socket timeout

Posted: Fri Oct 11, 2019 1:27 pm
by fsodah
on the remote client

Code: Select all

[root@ccccccccccc ~]# cd /usr/lib64/nagios/plugins/
[root@cccccccccc plugins]# ls
eventhandlers  negate  urlize  utils.sh
[root@cccccccccc plugins]# ls -al
total 84
drwxr-xr-x 3 root root    71 Oct  3 16:59 .
drwxr-xr-x 3 root root    21 Oct  3 16:59 ..
drwxr-xr-x 2 root root     6 Jan 17  2019 eventhandlers
-rwxr-xr-x 1 root root 41136 Aug 30 00:57 negate
-rwxr-xr-x 1 root root 36840 Aug 30 00:57 urlize
-rwxr-xr-x 1 root root  2791 Aug 30 00:56 utils.sh
[root@cccccccccc plugins]# pwd
/usr/lib64/nagios/plugins
[root@cccccccccc plugins]# pwd
/usr/lib64/nagios/plugins
[root@cccccccccc plugins]# 


Re: NRPE Socket timeout

Posted: Fri Oct 11, 2019 1:27 pm
by scottwilkerson
check_hda1 is the only command you actually have defined of all you tried

What do you get when you run this on the remote server?

Code: Select all

/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1

Re: NRPE Socket timeout

Posted: Fri Oct 11, 2019 1:28 pm
by scottwilkerson
fsodah wrote:on the remote client

Code: Select all

[root@ccccccccccc ~]# cd /usr/lib64/nagios/plugins/
[root@cccccccccc plugins]# ls
eventhandlers  negate  urlize  utils.sh
[root@cccccccccc plugins]# ls -al
total 84
drwxr-xr-x 3 root root    71 Oct  3 16:59 .
drwxr-xr-x 3 root root    21 Oct  3 16:59 ..
drwxr-xr-x 2 root root     6 Jan 17  2019 eventhandlers
-rwxr-xr-x 1 root root 41136 Aug 30 00:57 negate
-rwxr-xr-x 1 root root 36840 Aug 30 00:57 urlize
-rwxr-xr-x 1 root root  2791 Aug 30 00:56 utils.sh
[root@cccccccccc plugins]# pwd
/usr/lib64/nagios/plugins
[root@cccccccccc plugins]# pwd
/usr/lib64/nagios/plugins
[root@cccccccccc plugins]# 

Oh, it doesn't even look like you have any plugins installed. Did you install the plugins?

Re: NRPE Socket timeout

Posted: Fri Oct 11, 2019 1:29 pm
by scottwilkerson
What OS is this?

Re: NRPE Socket timeout

Posted: Fri Oct 11, 2019 1:38 pm
by fsodah
Yes I did ... how can i check it?

Code: Select all

 uname -a
Linux ccccccccc 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@ccccccc plugins]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.6 (Maipo)

[root@ccccccccc plugins]# rpm -aq | grep epel
epel-release-7-11.noarch

Re: NRPE Socket timeout

Posted: Fri Oct 11, 2019 2:32 pm
by scottwilkerson
Well your nrpe.cfg is looking for plugins in /usr/lib64/nagios/plugins/ Specifically for our test it was /usr/lib64/nagios/plugins/check_disk

So

Code: Select all

ls -al /usr/lib64/nagios/plugins/check_disk
It's possible that you installed them in a different location such as

Code: Select all

ls -al /usr/local/nagios/libexec/
In which case the paths in the nrpe.cfg would need to be changed.

If you are using Nagios XI and the remote server is RHEL 7, I would actually recommend removing the nrpe package installed via yum

Code: Select all

yum remove nrpe
And install using the following method
https://support.nagios.com/kb/article.php?id=8

This will setup everything you need and will also have all the plugins expected when using the Linux Wizard in Nagios XI

Re: NRPE Socket timeout

Posted: Fri Oct 11, 2019 2:33 pm
by fsodah

Code: Select all


[root@ccccccccc ~]# 
[root@cccccccc ~]# rpm -aq | grep nagios
nagios-plugins-2.2.1-17.20190829gitfb792ff.el7.x86_64
nagios-common-4.4.3-1.el7.x86_64


Re: NRPE Socket timeout

Posted: Fri Oct 11, 2019 2:36 pm
by fsodah

Code: Select all

[root@ccccccccccc ~]# ls -al /usr/lib64/nagios/plugins/check_disk
ls: cannot access /usr/lib64/nagios/plugins/check_disk: No such file or directory
[root@ccccccccc ~]# ls -al /usr/local/nagios/libexec/
ls: cannot access /usr/local/nagios/libexec/: No such file or directory
[root@ccccccccc ~]#