1. Add custom monitoring items
1. Requirements: Monitor the concurrent number of web80 ports of a platform and set graphics.
2. The zabbix monitoring center creates a monitoring project and defines the script vim /usr/local/sbin/estab.sh on the client side.
# bin / bash
netstat -ant | grep ': 80' | grep -c ESTABLISHED
chmod 755 /usr/local/sbin/estab.sh
3. Edit the zabbix-agent configuration file vim /etc/zabbix/zabbix_agentd.conf, define the key of the monitoring item. Restart the zabbix-agent service.
UnsafeUserParameters=1 #represents the use of custom scripts
UserParameter=my.estab.count[*],/usr/local/sbin/estab.sh #The key of the custom monitoring item is the parameter of the script in my.estab.count [*], followed by the path of the script.
4. Verify that the configuration just now is correct on the server side. If the return value is 0, it means it is correct, because there is no port 80 on the 131 server.
[root@localhost ~]# zabbix_get -s 192.168.134.131 -p 10050 -k 'my.estab.count'
0
5、