I'm in the process of upgrading agents from 2.0.x to 2.2.x, and I didn't want to have to logon to a bunch of servers just to find out they already had the latest agent, so I poked around the zabbix DB and came up with this.
Should give you Hostname, Agent Version and the last time the agent version was updated.
Hope someone finds it useful.
Code:
mysql> select hosts.host,history_str.value,from_unixtime(max(history_str.clock)) from hosts inner join items on hosts.hostid=items.hostid inner join history_str on items.itemid=history_str.itemid where items.key_ like 'agent.version' group by hosts.host;
Hope someone finds it useful.