红联Linux门户
Linux帮助

使用check_tcp来监测端口是否通

发布时间:2016-11-26 09:34:31来源:linux网站作者:houzhizhen
把所有服务器的ip地址都放到accept1文件中,使用批量执行程序,命令如下:
./upgrade.sh common  accept1 '/usr/local/nagios/libexec/check_tcp -H sdf-namenode1 -p 9000'  
 
如果结果成功,会输出TCP OK,输出如下:
==================10.130.211.149======================  
TCP OK - 0.002 second response time on sdf-namenode1 port 9000|time=0.001660s;;;0.000000;10.000000  
Pseudo-terminal will not be allocated because stdin is not a terminal.  
Warning: Permanently added '10.130.211.150' (RSA) to the list of known hosts.  
==================10.130.211.150======================  
TCP OK - 0.002 second response time on sdf-namenode1 port 9000|time=0.001784s;;;0.000000;10.000000  
Pseudo-terminal will not be allocated because stdin is not a terminal.  
Warning: Permanently added '10.183.223.132' (RSA) to the list of known hosts.  
==================10.183.223.132======================  
TCP OK - 0.002 second response time on sdf-namenode1 port 9000|time=0.001791s;;;0.000000;10.000000  
Pseudo-terminal will not be allocated because stdin is not a terminal.  
Warning: Permanently added '10.183.223.147' (RSA) to the list of known hosts.  
==================10.183.223.147======================  
TCP OK - 0.002 second response time on sdf-namenode1 port 9000|time=0.001797s;;;0.000000;10.000000  
Pseudo-terminal will not be allocated because stdin is not a terminal.  
Warning: Permanently added '10.183.223.162' (RSA) to the list of known hosts.  
==================10.183.223.162======================  
TCP OK - 0.002 second response time on sdf-namenode1 port 9000|time=0.001633s;;;0.000000;10.000000  
Pseudo-terminal will not be allocated because stdin is not a terminal.  
Warning: Permanently added '10.183.223.193' (RSA) to the list of known hosts.  
==================10.183.223.193======================  
TCP OK - 0.002 second response time on sdf-namenode1 port 9000|time=0.001784s;;;0.000000;10.000000  
Pseudo-terminal will not be allocated because stdin is not a terminal.  
Warning: Permanently added '10.180.207.29' (RSA) to the list of known hosts.  
==================10.180.207.29======================  
TCP OK - 0.002 second response time on sdf-namenode1 port 9000|time=0.001801s;;;0.000000;10.000000  
Pseudo-terminal will not be allocated because stdin is not a terminal.  
Warning: Permanently added '10.180.207.30' (RSA) to the list of known hosts.  
==================10.180.207.30======================  
TCP OK - 0.002 second response time on sdf-namenode1 port 9000|time=0.001783s;;;0.000000;10.000000  
Pseudo-terminal will not be allocated because stdin is not a terminal.  
Warning: Permanently added '10.130.214.43' (RSA) to the list of known hosts.  
==================10.130.214.43======================  
TCP OK - 0.002 second response time on sdf-namenode1 port 9000|time=0.001759s;;;0.000000;10.000000  
Pseudo-terminal will not be allocated because stdin is not a terminal.  
Warning: Permanently added '10.130.214.44' (RSA) to the list of known hosts.  
==================10.130.214.44======================  
TCP OK - 0.002 second response time on sdf-namenode1 port 9000|time=0.001639s;;;0.000000;10.000000  
Pseudo-terminal will not be allocated because stdin is not a terminal.  
Warning: Permanently added '10.135.28.66' (RSA) to the list of known hosts.  
==================10.135.28.66======================  
TCP OK - 0.002 second response time on sdf-namenode1 port 9000|time=0.001812s;;;0.000000;10.000000  
Pseudo-terminal will not be allocated because stdin is not a terminal.  
Warning: Permanently added '10.135.28.67' (RSA) to the list of known hosts.  
==================10.135.28.67======================  
TCP OK - 0.002 second response time on sdf-namenode1 port 9000|time=0.001548s;;;0.000000;10.000000
 
本文永久更新地址:http://www.linuxdiyf.com/linux/26335.html