Objective
Troubleshoot the error shown when making a query from the OpMon monitored server.
Symptom
When making a query from the OpMon on the monitored server, occurs the error “Connection refused or timed out“.
[root@opmon]# /usr/local/opmon/libexec/check_nrpe -H IP_DO_SERVIDOR Connection refused or timed out
Solution
Verify that the agent is running.
[root@localhost]#netstat-vantup | grep 5666 tcp 0 0 0.0.0.0:5666:* LISTEN 2202/xinetd
Verify the local communication
[root@localhost]# /usr/local/opmon/libexec/check_nrpe -H 127.0.0.1 NRPE v2.13
If you have Firewall running on the server, you will need to create an access rule, freeing a TCP port 5666. As an example, we have the following rule that must be executed.
[root@localhost]# iptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport 5666 -j ACCEPT
Check whether you can access te destination IP, maybe the problem is routing.
[root@opmon~]#ping 192.168.10.146 PING 192.168.10.146 (192.168.10.146) 56(84)bytes of data. 64 bytes from 192.168.10.146:icmp_seq=1 ttl=64 time=2.10ms ---192.168.10.146 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rrt min/avg/max/mdev=2.104/2.104/2.104/0.000ms
[root@opmon~]# traceroute 192.168.10.146 traceroute to 192.168.10.146(192.168.10.146), 30 hops max, 40 byte packets 192.168.10.146(192.168.10.146) 1.058ms 0.984ms 0.926ms