Find Zabbix Agent version easily across all hostsPosted: January 7, 2013
I recently completed the Server upgrade from Zabbix 1.8 to 2.0. To take full advantage of 2.0 I needed to also upgrade all of my host’s Zabbix agents to 2.0.
I have 450+ hosts in my Zabbix environment so manually upgrading all of them is not an option. I wrote up a few scripts and found some good posts to help me automate this process, which I will write about soon, but one thing that helped a lot was to be able to quickly see which hosts were on what version of the Zabbix agent.
I couldn’t easily find a way to do this in the Zabbix dashboard so I figured I would just grab this info out of the database. Turns out it is a pretty simple MySQL query to list all of the hostnames and what version of the software they were running. I modified this query a bit so I could then feed it into my scripts and target exactly the hosts that needed to be upgraded.
Today it’s yours… Have fun
select hosts.host, items.lastvalue from hosts join items on hosts.hostid=items.hostid where items.name like '%zabbix_agent%' and items.lastvalue like '1.8%';