A custom monitor template:
Use templates to quickly add monitoring items, and can import and export templates
1, using 11 kinds of basic commands to monitor the status of TCP web02 node:
ESTABLISHED
SYN_SENT
SYN_RCVD
FIN_WAIT1
FIN_WAIT2
TIME_WAIT
CLOSED
CLOSE_WAIT
LAST_ACK
LISTEN
CLOSING
2, create a configuration file:
# vim /etc/zabbix/zabbix_agentd.d/tcp_status.conf
UserParameter=tcp.status[*],netstat -ant | grep -c "$1"
# systemctl restart zabbix-agent.service
3, web01 node test values:
# zabbix_get -s 192.168.11.207 -k tcp.status[ESTABLISHED]
# zabbix_get -s 192.168.11.207 -k tcp.status[LISTEN]
# zabbix_get -s 192.168.11.207 -k tcp.status[TIME_WAIT]
4, create a new template:
Configuration --> Templates --> Create template --> Add
5, set the template to create applications:
同理克隆Item,Key分别为tcp.status[SYN_SENT]、tcp.status[SYN_RCVD]、tcp.status[FIN_WAIT1]、tcp.status[FIN_WAIT2]、tcp.status[TIME_WAIT]、tcp.status[CLOSED]、tcp.status[CLOSE_WAIT]、tcp.status[LAST_ACK]、tcp.status[LISTEN]、tcp.status[CLOSING]
备注:也可以将其它主机的监控项复制至新的自定义模板中
8、查看最新监控数据:Monitoring --> Latest data
9、模板的导入导出:
(1)导入:
(1)导出: