Examples of Items for Zabbix

In this article I will give some examples of items for Zabbix agent and server.

Here is an example of counting the number of active processes (Element type is Zabbix agent, so I often count the number of processes nginx, apache2, sshd, named, radiusd, etc., and for a value of 0 you can make a trigger that the process does not work):


Traffic on the network interface (Element type – Zabbix agent, User multiplier – 8, Value storage: Delta (speed per second), where ens1f0 is the name of the network interface):


Errors and dropped packets per second on the network interface (Element type – Zabbix agent, Value storage – Delta (simple change)):


Traffic on the network interface (Element type – SNMPv2 agent, User multiplier – 8, Storage value: Delta (speed per second), ifInOctets and ifOutOctets for 100 megabit ports, ifHCInOctets and ifHCOutOctets – for gigabit and more):


The sum of the number of rows in the MySQL table (Element type is Zabbix agent, the key is as specified in the – sqlcount parameter, the line must be added to the Zabbix agent configuration and restarted):

UserParameter=sqlcount,mysql -u root -D database_name -e "SELECT count(*) FROM table_name;" -s -N

MySQL database size (where DBNAME is the name of the database):

UserParameter=size_database_dbname,mysql -u root -e "SELECT SUM( data_length + index_length ) AS 'size' FROM information_schema.TABLES WHERE table_schema = 'DBNAME' LIMIT 1;" -s -N

The number of active connections on the ports (Element type is Zabbix agent, keys such as specified in the parameters, the lines need to be added to the Zabbix agent configuration and restarted):

UserParameter=count_active_connections_all,netstat -an | wc -l
UserParameter=count_active_connections_http,netstat -na | grep :80 | wc -l
UserParameter=count_active_connections_https,netstat -na | grep :443 | wc -l
UserParameter=dns.udp,netstat -nua | grep :53 | wc -l
UserParameter=dns.tcp,netstat -nta | grep :53 | wc -l

In this way, one can observe everything that only the soul desires, for example, here are some more of my examples:

UserParameter=nf_conntrack_count,cat /proc/sys/net/netfilter/nf_conntrack_count
UserParameter=nf_conntrack_max,cat /proc/sys/net/netfilter/nf_conntrack_max
UserParameter=count_max_in_apache_error_log,cat /var/log/apache2/error.log |grep Max |wc -l
UserParameter=count_vlan,ip a | grep ': vlan' | wc -l
UserParameter=count_iptables_192_168_5_5,iptables-save | grep | wc -l

See also my articles:
Examples of Zabbix Triggers
Tracking file changes via Zabbix

Did my article help you? How about buying me a cup of coffee as an encouragement? Buy me a coffe.

Leave a comment

Leave a Reply