Page 1 of 4
NRPE Socket timeout
Posted: Thu Oct 03, 2019 12:29 pm
by fsodah
I tried today again, trying to figure the nrpe ... went all ok during installation, however i made all necessary steps but still getting time out socket ... thanks in advance
Code: Select all
Oct 03 20:09:23 xxxxxxxxxx systemd[1]: Started Nagios Remote Program Executor.
Oct 03 20:09:23 xxxxxxx nrpe[24047]: Starting up daemon
Oct 03 20:09:23 xxxxxxx nrpe[24047]: Server listening on 0.0.0.0 port 5666.
Oct 03 20:09:23 xxxxxxx nrpe[24047]: Server listening on :: port 5666.
Oct 03 20:09:23 xxxxx nrpe[24047]: Listening for connections on port 5666
Oct 03 20:09:23 xxxxxxxxxx nrpe[24047]: Allowing connections from: 127.0.0.1, 10.xxxxx
Code: Select all
bash: iptable: command not found...
[root@xxxxxxxx1 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:5666
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:bootps
Re: NRPE Socket timeout
Posted: Thu Oct 03, 2019 12:44 pm
by fsodah
nmap 10.x.x.x -Pn -p 5666
Starting Nmap 6.47 (
http://nmap.org ) at 2019-10-03 20:43 EEST
Nmap scan report for 10.x.x.x
Host is up.
PORT STATE SERVICE
5666/tcp filtered nrpe
Nmap done: 1 IP address (1 host up) scanned in 2.13 seconds
Re: NRPE Socket timeout
Posted: Thu Oct 03, 2019 1:25 pm
by mbellerue
Good catch on the port being filtered. It definitely should not be filtered. That means there is something between Nagios and the NRPE agent. Are the Nagios server and the server running NRPE on the same subnet? Are there any network security appliances that may be interfering with communication?
Re: NRPE Socket timeout
Posted: Thu Oct 03, 2019 1:50 pm
by fsodah
I will check next week any firewall setting between the vlan .... i will keep you updated master
Re: NRPE Socket timeout
Posted: Thu Oct 03, 2019 2:56 pm
by mbellerue
Okay, perfect! We will keep the thread open and wait to hear back from you.
Re: NRPE Socket timeout
Posted: Sun Oct 06, 2019 8:45 am
by fsodah
I did open the ports through the firewall was able to get the socket ... but still this getting the unknown message
Re: NRPE Socket timeout
Posted: Sun Oct 06, 2019 12:19 pm
by fsodah
on the remote server I checked the following
Code: Select all
Starting Nmap 6.40 ( http://nmap.org ) at 2019-10-06 20:12 EEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000014s latency).
Other addresses for localhost (not scanned): 127.0.0.1 127.0.0.1
Not shown: 994 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
111/tcp open rpcbind
631/tcp open ipp
5666/tcp open nrpe
nrpe.cfg
Code: Select all
# The following examples use hardcoded command arguments...
# This is by far the most secure method of using NRPE
command[check_users]=/usr/lib64/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib64/nagios/plugins/check_load -r -w .15,.10,.05 -c .30,.25,.20
command[check_hda1]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w 150 -c 200
# The following examples allow user-supplied arguments and can
# only be used if the NRPE daemon was compiled with support for
# command arguments *AND* the dont_blame_nrpe directive in this
# config file is set to '1'. This poses a potential security risk, so
# make sure you read the SECURITY file before doing this.
### MISC SYSTEM METRICS ###
#command[check_users]=/usr/lib64/nagios/plugins/check_users $ARG1$
#command[check_load]=/usr/lib64/nagios/plugins/check_load $ARG1$
#command[check_disk]=/usr/lib64/nagios/plugins/check_disk $ARG1$
#command[check_swap]=/usr/lib64/nagios/plugins/check_swap $ARG1$
#command[check_cpu_stats]=/usr/lib64/nagios/plugins/check_cpu_stats.sh $ARG1$
#command[check_mem]=/usr/lib64/nagios/plugins/custom_check_mem -n $ARG1$
### GENERIC SERVICES ###
#command[check_init_service]=sudo /usr/lib64/nagios/plugins/check_init_service $ARG1$
#command[check_services]=/usr/lib64/nagios/plugins/check_services -p $ARG1$
### SYSTEM UPDATES ###
#command[check_yum]=/usr/lib64/nagios/plugins/check_yum
#command[check_apt]=/usr/lib64/nagios/plugins/check_apt
### PROCESSES ###
#command[check_all_procs]=/usr/lib64/nagios/plugins/custom_check_procs
#command[check_procs]=/usr/lib64/nagios/plugins/check_procs $ARG1$
### OPEN FILES ###
rpm epel
Code: Select all
rpm -aq | grep epel
epel-release-7-11.noarch
Code: Select all
[root@xxxxxx nrpe.d]# cd /usr/lib64/nagios/plugins/
[root@xxxxxxx plugins]# cd ..
[root@xxxxxxx nagios]# ls -al
total 128
drwxr-xr-x 3 root root 21 Oct 3 16:59 .
dr-xr-xr-x. 148 root root 86016 Oct 3 16:59 ..
drwxr-xr-x 3 root root 71 Oct 3 16:59 plugins
[root@xxxxx nagios]# cd plugins/
[root@xxxx plugins]# pwd
/usr/lib64/nagios/plugins
[root@xxxxx 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@xxx plugins]# cd eventhandlers/
[root@xxxx eventhandlers]# ls -al
total 0
drwxr-xr-x 2 root root 6 Jan 17 2019 .
drwxr-xr-x 3 root root 71 Oct 3 16:59 ..
[root@xxxxxxx eventhandlers]# cd ..
Code: Select all
uname -a
Linux xxxxxxxx 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
Re: NRPE Socket timeout
Posted: Mon Oct 07, 2019 9:41 am
by mbellerue
From your nrpe.cfg file, it looks like these are the only commands that are available to you.
Code: Select all
command[check_users]=/usr/lib64/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib64/nagios/plugins/check_load -r -w .15,.10,.05 -c .30,.25,.20
command[check_hda1]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w 150 -c 200
Can you try your command with check_hda1, and see what it returns?
Re: NRPE Socket timeout
Posted: Wed Oct 09, 2019 3:58 pm
by fsodah
i will do it tomorrow
Re: NRPE Socket timeout
Posted: Thu Oct 10, 2019 12:03 am
by fsodah
check_hda1
bash: check_hda1: command not found...