Ad Widget

Collapse

Setting HostID for New Host Records

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CountryConnections
    Junior Member
    • Jan 2010
    • 6

    #1

    Setting HostID for New Host Records

    I recently installed Zabbix 1.8 and imported over 700 hosts from another database via a large SQL script. It successfully added the hosts and detail records and they now show up nicely in the list of hosts using the web interface. When I inserted the new records I looked at the last stored hostid and added one to it and then added one for each new host I added. But now when I try to add new hosts via the zabbix web interface it fails because it tries to set the new hostid to the first host that I added via SQL. Unfortunately, the ID already exists and so it will not save. I need to somehow tell Zabbix to add future hosts by starting with a hostid that is about 700 greater so it will skip past the ones I added via SQL statements. Please tell me how I can get Zabbix to add new hosts starting with a higher hostid number.

    Thanks,
    Mark
  • CountryConnections
    Junior Member
    • Jan 2010
    • 6

    #2
    Maybe I answered my own question

    I found that in the table called "ids" there is a field called "hostid." I set its "nextid" value to the value of the highest existing host in my database and I can now add hosts normally from the web interface. So far it seems that the import trick worked well and saved many hours.

    Thanks,
    Mark

    Comment

    Working...