Ad Widget

Collapse

Add new item to template - Zabbix 2.0.5 API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • boogie590
    Junior Member
    • Jul 2013
    • 2

    #1

    Add new item to template - Zabbix 2.0.5 API

    Hi,
    How can I add new item to template through API? Every example (that i found) is showing how to add item to single host (by required hostid) not to host groups or templates.

    Thanks
  • tzn
    Junior Member
    • Apr 2011
    • 19

    #2
    I think you should use item.create or item.update with corresponding templateid

    Comment

    • boogie590
      Junior Member
      • Jul 2013
      • 2

      #3
      I've solved it. Every template has its own hostid. That hostid is invisible through host.get method, but it can be used to item.create. So if You wanna create template item through API, first get some item from that template with output = extend and read "hostid", then used that id to create item.

      Comment

      • grosendorf
        Junior Member
        • Sep 2013
        • 2

        #4
        You can actually get template host ids using host.get, but you have to have the "templated_hosts" flag set to true.

        Comment

        Working...