Customize an item trigger

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]

Insert picture description here

After the test can obtain the value, add monitoring items in the zabbix panel

Insert picture description here
Insert picture description here
Insert picture description here

Insert picture description here

Add here to complete, and then test whether the value can be correctly obtained
Insert picture description here

Create a trigger for tcp state
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Condition explanation: As long as the latest value of the monitoring item tcp_status_TIME is greater than 10, it will alarm
Insert picture description here

Test whether an alarm will be generated
Insert picture description here

Guess you like

Origin blog.csdn.net/bjgaocp/article/details/110921539