Nagios - 检查进程是否正在侦听端口

时间:2015-09-03 18:13:11

标签: tcp port monitoring nagios

是否有任何命令检查某个进程正在侦听端口。 我试过check_tcp,但它没有输出哪个进程正在侦听端口 它的输出是:

TCP OK - 0.000 second response time on port 8443|time=0.000421s;;;0.000000;10.000000

1 个答案:

答案 0 :(得分:0)

我没有在Nagios插件交换机上看到满足您需求的任何内容,所以我写了一个与NRPE一起使用。

https://github.com/jlyoung/nagios_check_listening_port_linux

输出如下:

[root@joeyoung.io ~]# python /usr/lib/nagios/plugins/nagios_check_listening_port_linux.py -n nginx -p 80
OK. nginx found listening on port 80 for the following address(es): [0.0.0.0] | 'listening_on_expected_port'=1;;;;

[root@joeyoung.io ~]# python /usr/lib/nagios/plugins/nagios_check_listening_port_linux.py -n nginx -p 9999
CRITICAL - No process named nginx could be found listening on port 9999 | 'listening_on_expected_port'=0;;;;
相关问题