Monitoring TCP 11 states zabbix
-agent side operation
Custom monitoring template save path
/etc/zabbix/zabbix_agentd.d/
vim /etc/zabbix/zabbix_agentd.d/tcp_status.conf
UserParameter=tcp_status[ ],netstat -ant|grep -c $1
Syntax note:
UserParameter: custom monitoring fixed name
tcp_status[ ]: monitoring item key name, [*] is The parameter of $1
netstat -ant|grep -c $1: The command used to get the value
After writing, restart
zabbix -agent systemctl restart zabbix-agent.service
zabbix -server command test zabbix_get -s 192.168.2.51 -k tcp_status[TIME]
After the test can obtain the value, add monitoring items in the zabbix panel
Add here to complete, and then test whether the value can be correctly obtained
Create a trigger for tcp state
Condition explanation: As long as the latest value of the monitoring item tcp_status_TIME is greater than 10, it will alarm
Test whether an alarm will be generated