thecamels/zabbix

Error import Template App S.M.A.R.T.xml

Closed this issue · 4 comments

Good day! I have an error when importing template template App S.M.A.R.T.xml.


Created: Application "S.M.A.R.T." on "Template App S.M.A.R.T.".
mb_strlen() expects parameter 1 to be string, array given [conf.import.php:130 → CConfigurationImport->import() → CConfigurationImport->processDiscoveryRules() → CAPIObject->create() → CAPIObject->__call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CDiscoveryRule->create() → CDiscoveryRule->createReal() → DB::insert() → DB::checkValueTypes() → zbx_strlen() → mb_strlen() in /usr/share/zabbix/include/func.inc.php:955]
Array to string conversion [conf.import.php:130 → CConfigurationImport->import() → CConfigurationImport->processDiscoveryRules() → CAPIObject->create() → CAPIObject->call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CDiscoveryRule->create() → CDiscoveryRule->createReal() → DB::insert() → implode() in /usr/share/zabbix/include/classes/db/DB.php:450]
Error in query [INSERT INTO items (name,type,snmp_community,snmp_oid,delay,status,snmpv3_contextname,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authprotocol,snmpv3_authpassphrase,snmpv3_privprotocol,snmpv3_privpassphrase,delay_flex,params,ipmi_sensor,authtype,username,password,publickey,privatekey,port,filter,lifetime,description,key
,trapper_hosts,hostid,flags,value_type,data_type,interfaceid,itemid) VALUES ('Disks discovery','0','','','3600','0','','','0','0','','0','','','','','0','','','','','',Array,'30','','hdd_discovery','','10433','1','4','0',NULL,'27072')] [Unknown column 'Array' in 'field list']
SQL statement execution has failed "INSERT INTO items (name,type,snmp_community,snmp_oid,delay,status,snmpv3_contextname,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authprotocol,snmpv3_authpassphrase,snmpv3_privprotocol,snmpv3_privpassphrase,delay_flex,params,ipmi_sensor,authtype,username,password,publickey,privatekey,port,filter,lifetime,description,key
,trapper_hosts,hostid,flags,value_type,data_type,interfaceid,itemid) VALUES ('Disks discovery','0','','','3600','0','','','0','0','','0','','','','','0','','','','','',Array,'30','','hdd_discovery','','10433','1','4','0',NULL,'27072')".

Which version of Zabbix do you have? I was testing this on 2.4.6 and its working.

Zabbix 2.2.1

Can you try to upgrade to newest zabbix 2.2, which is 2.2.9? Zabbix 2.2.1 is 2 years old, and might contain multiple bugs which could cause this. Also what PHP are you using? There are plenty php bugs in your output.

Also you have SQL syntax error "Unknown column 'Array' in 'field list'" . This looks like database issue, no template import should ever display such error.

Thank you very much for your help! I will update my Zabbix and try to import the template again.