Ad Widget

Collapse

error adding host or adding template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • systeembeheerder
    Junior Member
    • Mar 2013
    • 3

    #1

    error adding host or adding template

    Hi,
    If I want to add a template or a host (below is the error from adding host) I will get this error.

    Any Ideas what is wrong here and how to fix it?
    Using zabbix server version 2.0.6.

    Error in query [INSERT INTO hosts_groups (hostid,groupid,hostgroupid) VALUES ('10177','18','387')] [Duplicate entry '387' for key 'PRIMARY']
    SQL statement execution has failed "INSERT INTO hosts_groups (hostid,groupid,hostgroupid) VALUES ('10177','18','387')".

    This results in not being able to add any host or template.
    Any help is appreciated.
    Thx.
  • systeembeheerder
    Junior Member
    • Mar 2013
    • 3

    #2
    fixed

    ok, fixed it myself. database was off by one.

    I used the mysql log to find the syntax that caused the error and corrected it with the sql command:

    UPDATE ids SET nextid=387 WHERE nodeid=0 AND table_name='hosts_groups'

    before this command the command.
    SELECT nextid FROM ids WHERE nodeid=0 AND table_name='hosts_groups'
    resulted in 386 before this command.

    checking table hosts_groups resulted in an entry with 387, so the ids table was one off.
    Correct that, and no problems anymore.

    Comment

    Working...