anapsix/zabbix-haproxy

problems importing XML template in zabbix 2.2

dominikborkowski opened this issue · 2 comments

Hi!

I'm seeing these errors while trying to import the XML template into zabbix 2.2.9 server:

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 ('HAProxy backend discovery','0','','','3600','0','','','0','0','','0','','','','','0','','','','','',Array,'5','','haproxy.list.discovery[BACK]','','10352','1','4','0',NULL,'48806')] [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 ('HAProxy backend discovery','0','','','3600','0','','','0','0','','0','','','','','0','','','','','',Array,'5','','haproxy.list.discovery[BACK]','','10352','1','4','0',NULL,'48806')".

I think they may be related to https://support.zabbix.com/browse/ZBX-8689 . Was the template generated by Zabbix 2.2 or 2.4?

Thanks!

Found the problem and possible workaround: #2

fixed by a #2 merge