标签:
位置:/usr/local/nagios/libexec/
代码(新建可执行文件)
#!/bin/sh /usr/local/nagios/libexec/check_tcp -H $1 -p 80 -t 3 if [[ $? == 0 ]] then echo "OK:80 open" exit 0 else echo "CRITICAL:80 close" exit 2 fi
位置:/usr/local/nagios/etc/objects/)
在文件中添加命令
define command{ command_name check_winport command_line /usr/local/nagios/libexec/check_winport 172.16.41.5 }
位置:/usr/local/nagios/etc/objects/
在文件中添加服务
define service{ use generic-service-urgent,srv-pnp host_name 172.16.41.102 service_description 172.16.41.5:80端口 check_command check_winport }
结果就可以显示对172.16.41.5:80端口的监控
标签:
原文地址:http://www.cnblogs.com/kaituorensheng/p/4661634.html