Use zabbix_get to retrieve the queue status

7.0 get:
zabbix_get --host 127.0.0.1 --port 30051 --protocol plaintext --key '{"request": "queue.get","sid": "18c16b337fd17d874daa72df0e500501","type": "details","limit":"500"}'
From Windows:
zabbix_get -s x.y.z.w -p 10051 -k "{\"request\": \"queue.get\",\"sid\": \"3ea37515082b9c1f8fc9c87e45af85fb\",\"type\": \"overview\"}"
From Linux:
zabbix_get -s x.y.z.w -p 10051 -k '{"request": "queue.get","sid": "3ea37515082b9c1f8fc9c87e45af85fb","type": "overview"}'
If you ask details but do not provide limit it will report:
"Unsupported limit value."
Find item ID's:
zabbix_get -s 127.0.0.1 -p 10051 -k '{"request": "queue.get","sid": "6f283c8e02e2e0b6599e0b89afa90d26","type": "details","limit":"500"}' | jq .
Pure item ID's:
zabbix_get -s 127.0.0.1 -p 10051 -k '{"request": "queue.get","sid": "6f283c8e02e2e0b6599e0b89afa90d26","type": "details","limit":"500"}' | jq ."data"[]."itemid"
To list all problematic hosts:
zabbix_get -s 127.0.0.1 -p 10051 -k '{"request": "queue.get","sid": "6f283c8e02e2e0b6599e0b89afa90d26","type": "details","limit":"500"}' | jq ."data"[]."itemid" | xargs -i echo "SELECT h.host FROM hosts h INNER JOIN items i ON h.hostid = i.hostid WHERE i.itemid='{}';" | mysql -sN zabbix | sort | uniq

No comments: