mib2zabbix
mib2zabbix copied to clipboard
SQL duplicate key while importing template
I tried to convert mib file for megaraid controller and importing it to zabbix fails with the below error:
mib file: LSI-MegaRAID-SAS-MIB.mib.txt
Error in query [INSERT INTO items (name,authtype,data_type,delay,delay_flex,delta,description,formula,history,inventory_link,ipmi_sensor,logtimefmt,multiplier,params,password,port,privatekey,publickey,snmp_community,snmp_oid,snmpv3_authpassphrase,snmpv3_authprotocol,snmpv3_contextname,snmpv3_privpassphrase,snmpv3_privprotocol,snmpv3_securitylevel,snmpv3_securityname,status,trends,type,units,username,value_type,key_,trapper_hosts,hostid,interfaceid,flags,itemid) VALUES ('enclosureID for {#SNMPINDEX}','0','0','60','','0','EnclosureID for this enclosure.(Unique)','1','7','0','','','0','','','{$SNMP_PORT}','','','{$SNMP_COMMUNITY}','.1.3.6.1.4.1.3582.4.1.5.2.1.1.{#SNMPINDEX}','','0','','','0','0','','0','365','4','','','0','enclosureID[{#SNMPINDEX}]','','10160',NULL,'2','33490')] [Duplicate entry '10160-enclosureID[{#SNMPINDEX}]' for key 'items_1'] SQL statement execution has failed "INSERT INTO items (name,authtype,data_type,delay,delay_flex,delta,description,formula,history,inventory_link,ipmi_sensor,logtimefmt,multiplier,params,password,port,privatekey,publickey,snmp_community,snmp_oid,snmpv3_authpassphrase,snmpv3_authprotocol,snmpv3_contextname,snmpv3_privpassphrase,snmpv3_privprotocol,snmpv3_securitylevel,snmpv3_securityname,status,trends,type,units,username,value_type,key_,trapper_hosts,hostid,interfaceid,flags,itemid) VALUES ('enclosureID for {#SNMPINDEX}','0','0','60','','0','EnclosureID for this enclosure.(Unique)','1','7','0','','','0','','','{$SNMP_PORT}','','','{$SNMP_COMMUNITY}','.1.3.6.1.4.1.3582.4.1.5.2.1.1.{#SNMPINDEX}','','0','','','0','0','','0','365','4','','','0','enclosureID[{#SNMPINDEX}]','','10160',NULL,'2','33490')". [conf.import.php:176 → CFrontendApiWrapper->import() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CConfiguration->import() → CConfigurationImport->import() → CConfigurationImport->processDiscoveryRules() → CItemPrototype->create() → CItemPrototype->createReal() → DB::insert() → DB::exception() in include/classes/db/DB.php:441]