在平常的主机监控中,常常需要监控某些具体的端口状态,下面介绍集体步骤:
一 脚本编写
需要建立两个脚本文件,port.con为指定的监控端口号(agent端),port_alert.sh为端口自发现脚本。
[root@izwz9j1alu0703rrt26x3uz ~]# cd /etc/zabbix/
root@izwz9j1alu0703rrt26x3uz zabbix]# mkdir script
[root@izwz9j1alu0703rrt26x3uz script]#vim port_alert.sh添加以下代码:
[root@izwz9j1alu0703rrt26x3uz script]# vim port.conf