更新zabbix screen报错The Y coordinate of screen element xxx is too big

screen
当一个Screen中的Item数量需要增加时,执行Screen会报错

The Y coordinate of screen element xxx is too big

这个问题一直存在了好久,以前都是先删除原来的Screen,再重新创建新的Screen临时解决,今天总算一次性解决了。
原来的代码

print "Updating Screen Name %s  Screen ID %s" %(screen_name,update_screenid)
       values1 = {
               "jsonrpc" : "2.0",
               "method"  : "screen.update",
               "params"  : {
                       "screenid" : update_screenid,
                       "screenitems": []
                           },
               "auth"    : auth,
               "id"      : 2               
                 }
       output1 = requestJson(url,values1)

关键就在于使用screen.update这里,没有把hsize和vsize这两个参数写上,因为如果当需要添加的Screen中的Item需要增加时,这两个参数也会跟着变动,如果保持原来的不变,那么的新增的Item就添加不进去,没有办法更新Screen,所以报错The Y coordinate of screen element xxx is too big

解决办法:

values1 = {
               "jsonrpc" : "2.0",
               "method"  : "screen.update",
               "params"  : {
                       "screenid" : update_screenid,
                       "screenitems": [],
                       "hsize": columns,
                       "vsize": vsize,
                           },
               "auth"    : auth,
               "id"      : 2
                 }

Zabbix API官方说明

https://www.zabbix.com/documentation/2.2/manual/api/reference/screen/update

https://www.zabbix.com/documentation/2.2/manual/api/reference/screen/object#screen

https://www.zabbix.com/documentation/2.2/manual/api/reference/screenitem/object#screen_item

还没有评论,快来抢沙发!

发表评论

  • 😉
  • 😐
  • 😡
  • 😈
  • 🙂
  • 😯
  • 🙁
  • 🙄
  • 😛
  • 😳
  • 😮
  • emoji-mrgree
  • 😆
  • 💡
  • 😀
  • 👿
  • 😥
  • 😎
  • ➡
  • 😕
  • ❓
  • ❗
  • 67 queries in 0.394 seconds