1

I am trying to create a graph in zabbix over multiple hosts against a single item say "cpu utilization". But the hosts are getting discovered through auto-registration process and are added to group "zServers" and are attached with template "testTemplate" which has item "cpu utilization". I would like to have a graph of cpu utilization against all discovered hosts. Does anyone knows how to resolve this?
Thanks in advance.

Yogesh Jilhawar
  • 5,605
  • 8
  • 44
  • 59

2 Answers2

0

There is no built-in way to achieve that. Your best bet might be using the Zabbix API to find those items, then use the graph.create method.

Richlv
  • 3,954
  • 1
  • 17
  • 21
  • I think I need to find all the hosts belongs to hostgroup "zServers" and then call graph.create method to have the graph. Am I right Richlv? – Yogesh Jilhawar Jan 12 '17 at 08:52
  • You need item IDs to create the graph. You should be able to grab them with a single API all to item.get method while filtering by host group and item key. – Richlv Jan 12 '17 at 09:50
  • I tried graph.create and graph.update option. I stuck at final stage where Im updating the graph using graph.update command,but, the method is updating the existing graphitems instead of appending the items. following is the command- `graph.update(graphid=graph_id,gitems=[{"gitemid":gitem_id,"itemid":item1,"color":"3333FF"},{"itemid" :ite['itemid'], "color":"26265b"}])` – Yogesh Jilhawar Jan 18 '17 at 07:04
  • Your question was about creating graphs. Updating existing graphs seems to be filed by you in a separate question at http://stackoverflow.com/questions/41694723/add-graph-items-to-existing-graph-in-zabbix-using-apis , so it would be better to handle there. – Richlv Jan 23 '17 at 15:17
0

There is no built-in way to create these kind of graphs. However you can achieve it by creating a duplicate host and create a new graph with all the parameters required. (In your case add all the CPU Utlization items from different hosts.)