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

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

问题描述

我在 zabbix 中创建了一个图表.我想更新此图以包含来自其他主机的项目.为此,我使用 python 脚本调用 graph.update() zabbix API.该方法是更新图形项而不是添加/附加到现有图形项列表.有人对此有想法吗?
graph.update(graphid=graph_id,gititems=[{"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天全站免登陆