1.1 zabbix 客户端配置
[[email protected] zabbix_agentd.d]# cat tcp.conf UserParameter=tcp[*],/data/sh/zabbix_sh/zabbix_tcp.sh $1
1.2 客户端脚本文件
[[email protected] zabbix_sh]# cat zabbix_tcp.sh #!/bin/bash Port=80 function SYNRECV() { ss -ant | grep -w $Port| grep -c SYNRECV } function ESTAB() { ss -ant | grep -w $Port| grep -c ESTAB } function TIMEWAIT() { ss -ant | grep -w $Port| grep -c TIME-WAIT } function LISTEN() { ss -ant | grep -w $Port| grep -c LISTEN } $1
1.3 重启zabbix客户端
[[email protected] zabbix_sh]# /etc/init.d/zabbix-agent restart Shutting down Zabbix agent: [确定] Starting Zabbix agent: [确定]
1.4 服务器zabbix测试
[[email protected] zabbix_agentd.d]# zabbix_get -s 10.10.10.101 -k ‘tcp[TIMEWAIT]‘ 7
1.5 导入模板绑定模板
参照zabbix disk io监控
时间: 2024-10-18 10:17:40