使用API​​将图形项目添加到zabbix中的现有图形 [英] add graph items to existing graph in zabbix using API's

查看:275
本文介绍了使用API​​将图形项目添加到zabbix中的现有图形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在zabbix中创建的图。我想更新此图表以包含来自其他主机的项目。为此,我使用python脚本调用graph.update()zabbix API。该方法正在更新图形项目,而不是添加/附加到现有图形项目列表。有没有人有这个想法?

graph.update(graphid = graph_id,gitems = [{itemid:10735,color:26265b}] )

其中 graph_id 是和现有图形的id。

预先感谢!!

I have a graph created in zabbix. I want to update this graph to include items from other hosts. For that I am calling graph.update() zabbix API using a python script. The method is updating the graph item instead of adding/appending to the existing graph item list. Does any one has idea about this ?
graph.update(graphid=graph_id,gitems=[{"itemid" :"10735", "color":"26265b"}])
where graph_id is and id of existing graph.
Thanks in advance!!

推荐答案

首先使用 graph.get 获取现有图项,然后更新图表并传递所有现有项目(包括这些项目的 gitemid )并添加新项目。

Get the existing graph items with graph.get first, then update the graph and pass all the existing items (include gitemid for these items) with your new items added.

这篇关于使用API​​将图形项目添加到zabbix中的现有图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆