使用check_tcp来监测端口是否通

把所有服务器的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




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值