Skip to main content
Gå til innhold

zabbix-cli.py

zabbix-cli.py can be run on system-utils.uninett.no to fetch various info from Zabbix.

$ zabbix-cli.py -h
usage: Zabbix cmd line client [-h]
{login,get-items,dump-vkilo,get-item,
get-web-tests,get-unreachable,get-hosts,
noicy-nodes,check-kind,find-empty,
get-triggers}
...

positional arguments:
{login,get-items,dump-vkilo,get-item,get-web-tests,get-unreachable,
get-hosts,noicy-nodes,check-kind,find-empty,get-triggers}
Command
login login
get-items Get script items
dump-vkilo Get verktøykasse ILO config
get-item Get item by ID
get-web-tests Get Web tests
get-unreachable Get unreachable hosts
get-hosts Get hosts
noicy-nodes Find hosts with most events
check-kind Find hosts that are not registerted in kind
find-empty Find empty host groups
get-triggers List triggers

optional arguments:
-h, --help show this help message and exit
$

You need to login and get a token for access:

$ zabbix-cli.py login
Username: <yourusername>
Password:

Token will be stored in ~/.zabbixauth. You will then have access to the data this user is authorized to see.

Example listing out all triggers with severity disaster (or higher):

$ zabbix-cli.py get-triggers --severity disaster
Triggers with severity disaster or higher:
- disaster agora.uninett.no (liferay-service.trofast.uio.no): http://agora.uninett.no er nede eller har problem med innlogging
- disaster uninett.box.com: http://uninett.box.com is not returning HTTP Status Code 200
- disaster www.ecampus.no: www.ecampus.no is not responding on http port 80.
- disaster UNINETT_SNMP_NetApp: Global Status problem
- disaster foodl.org: http://foodl.org is not working as expected
- disaster nova-iaas: No upstream connectivity on Nova routers
...