I first tried using the check_listen_tcp_udp.sh script out on the host that is running the service I want to monitor
https://exchange.nagios.org/directory/P ... sh/details
This is my command definition out on the remote host;
Code: Select all
command[check_nexus_listen]=/usr/lib64/nagios/plugins/check_listen_tcp_udp.sh -p 8070 -P tcp
Code: Select all
# /usr/lib64/nagios/plugins/check_listen_tcp_udp.sh -p 8070 -P tcp
OK - Listening on :::8070 (protocol: tcp)
Code: Select all
define service{
use generic-service
host_name nexusfirewall
service_description Nexus listening port
check_command check_nrpe!check_nexus_listen
}
Code: Select all
[root@engmon objects]# /usr/local/nagios/libexec/check_nrpe -H 10.177.177.220 -c check_total_procs
PROCS OK: 381 processes | procs=381;600;700;0;
[root@engmon objects]# /usr/local/nagios/libexec/check_nrpe -H 10.177.177.220 -c check_nexus_listen
NRPE: Unable to read output
I am able to successfully check a port on the remote host from the nagios server;
Code: Select all
# /usr/local/nagios/libexec/check_tcp -H 10.177.177.220 -p 8070
TCP OK - 0.001 second response time on 10.177.177.220 port 8070|time=0.001022s;;;0.000000;10.000000
Code: Select all
# 'check_tcp' command definition
define command{
command_name check_tcp
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
}
Code: Select all
define service{
use local-service
host_name engmon
service_description tcp8070 on Nexusfirewall
check_command check_tcp!10.177.177.220!8070
}
Code: Select all
tcp8070 on Nexusfirewall UNKNOWN 08-23-2016 15:06:04 0d 1h 3m 25s 4/4 check_tcp: Port must be a positive integer
I'm also interested in thoughts related to the merits of checking whether the port is listening from the client, or contactable via an external command.
Thanks, Rob