Portál AbcLinuxu, 24. října 2025 12:51
root@host:~# /usr/local/nagios/libexec/check_nrpe -H localhost NRPE v2.12 root@host:~# netstat -at | grep nrpe tcp 0 0 *:nrpe *:* LISTENBohuzel z toho stroje s Nagios serverem to uz tak dobre nevypada:
[root@nagios ~]# /usr/local/nagios/libexec/check_nrpe -H host.domain.cz Connection refused by hostKonfigurace na tom hostu vypada nasledovne:
root@host:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:nrpe
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere loopback/8 reject-with icmp-port-unreachable
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:www
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT icmp -- anywhere anywhere icmp echo-request
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
root@host:~# cat /etc/xinetd.d/nrpe
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
flags = REUSE
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 11.22.33.44 127.0.0.1
}
root@host:~# cat /etc/hosts.allow
nrpe: LOCAL, 11.22.33.44
root@host:~# cat /etc/hosts.deny
nrpe: ALL
Je ale zajimave, ze telnet projde:
[root@nagios ~]# telnet host.domain.cz 5666 Trying 22.44.66.88... Connected to host.domain.cz (22.44.66.88). Escape character is '^]'. root@nagios:~# netstat -at | grep nrpe tcp 0 0 *:nrpe *:* LISTEN tcp 0 0 host.domain.cz:nrpe 44.33.22.11.rev.c:38130 ESTABLISHEDA ted prosim sem s napady, kde se stala chyba.
Řešení dotazu:
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.