4

Intro

I have a cluster to monitor using Zabbix 2.0, everything works fine and I have all the data I need on Zabbix, but the way zabbix displays the data is not optimal for our use case. At the same time I have a python app running with a web front end I can use to create a more refined way of displaying Zabbix's data. What I want to do is to turn Zabbix's latest data tab into a grid view with a host in every row and the items as columns (like a spreadsheet).

The problem

Apparently Zabbix's API is still a work in progress and the interface sometimes changes, which should not be a problem if some basic functionality is working. What I need to do is to be able to fetch the list of hosts not only IDs but the host's info as well. And for each host I need to be able to fetch some items, again not only the items ID but the entire data too. So far I've tried using two Python libraries to do it: zabbix_api and PyZabbix, no luck so far since both libraries fetch only IDs and not the data I need for hosts and items.

The question

Is there a library/way of doing this that actually works or is this API in a too early stage yet?

Thanks in advance!

Sergio Ayestarán
  • 5,590
  • 4
  • 38
  • 62

2 Answers2

1

I use zabbix_api to do navigate through zabbix catalogs, get hosts, get host, get host's items, etc. Though I didn't try to get the data with python, I don't see why it shouldn't work. I do get data from PHP using PhpZabbixApi. Any specific problems you've run into?

Michael Tabolsky
  • 3,429
  • 2
  • 18
  • 11
  • Yes Michael, when I try to fetch data using zabbix_api from python I only get the IDs, for instance if I get a host it returns only the host id, maybe we are talking about different libraries?, can you provide a link to the one you use?. Thanks in advance! – Sergio Ayestarán Nov 06 '13 at 16:25
  • I've found it, and yes we are talking about different libraries, the one you use is way more advanced than the ones available on Python but still a useful response. – Sergio Ayestarán Nov 06 '13 at 16:35
0

PyZabbix is vital and pretty usable. In fact it is 1:1 mapping of Zabbix API to Python.

nudzo
  • 17,166
  • 2
  • 19
  • 19
  • Have you actually tried to use it? can you please provide a working small example to fetch a list of hosts and the full info of each host? – Sergio Ayestarán Feb 21 '14 at 21:10
  • Yes. I combined it with Fabric... getting list of all servers in group Solaris and then connecting to them by SSH in Fabric tasks and getting configuration data, IPs, Solaris release/patches... and those goes back to Zabbix hosts inventory. Doing it manually in GUI... I'm too lazy for that. ;-) – nudzo Feb 21 '14 at 21:52