Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-3943

zabbix_sender can't update items if hosts have been created via API

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Minor Minor
    • None
    • 1.8.4, 1.8.5
    • API (A)
    • None
    • OS : debian 5.0.3
      mysql : 5.1.41

      After creating a series of hosts using the api, and associating them with a template containing only item type of zabbix trapper. zabbix_sender is unable to update any of those items.

      A work around is to edit a host configuration and change something ; it can be anything (ip, dns, proxy port, "connect to" drop down menu, etc). After confirming and using zabbix_sender, the host can have it's items updated.

      Unfortunatly, a massive update on the hosts does not work, so does exporting all the hosts and re-importing them after doing a simple change. The only way the work around works is by going single handly on every host files.

      I'm using a perl module to interface with the api. Here's the code I've been using to create the hosts :

      my $z = Net::Zabbix->new($url,$user,$password);
      
      my @lines = read_file('hostlist.log');
      
      foreach my $hostname (@lines){
          my $host = $z->create('host',{host => $hostname, useip => '1', groups => [{groupid => '8'}], templates => [{templateid =>'10085'}]});
      }
      

            Unassigned Unassigned
            gde Guillaume Douté
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: