Ad Widget

Collapse

Zabbix API Python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bcarpio
    Member
    • Jun 2008
    • 96

    #1

    Zabbix API Python

    I'm having a problem with the zabbix API when I try and add a host to multiple host groups:

    api.host.create({ 'host' : (options.dns),'dns' : (options.dns),'ip' : (options.ipaddr),'port' : 10050,'useip' : 0,'groups' : [{ "groupid":100100000000002 }],'templates' : [{ "templateid":100100000010001}]})

    This works fine but as you can tell it only adds to a single host group, what if I wanted to add the host to other host groups? I have tried to add templateid multiple times and it seems only the last time is accepted.

    Thanks.
  • gescheit
    Senior Member
    • Jul 2007
    • 156

    #2
    Adding to many groups: 'groups' : [{ "groupid":100100000000002 },{"groupid":"100500"},{"groupid","100501"}].

    Comment

    • bcarpio
      Member
      • Jun 2008
      • 96

      #3
      thanks

      That worked perfectly!

      Thanks.

      Comment

      Working...