YSmetana / zabbix-mikrotik-snmp

Mikrotik SNMP template for Zabbix
GNU General Public License v2.0
23 stars 7 forks source link

Import error #5

Open Fisiu opened 9 years ago

Fisiu commented 9 years ago

Hi,

I tried to import this template, but I get erros:

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]
mysqli_real_escape_string() expects parameter 2 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_dbstr() → mysqli_real_escape_string() in /usr/share/zabbix/include/db.inc.php:1224]
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 ('Interfaces','4','public','.1.3.6.1.2.1.2.2.1.2','30','0','','','0','0','','0','','','','','0','','','','','',Array,'1','','snmp.discovery','','10117','1','4','0',NULL,'24499')] [Unknown column 'Array' in 'field list']
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 ('Interfaces','4','public','.1.3.6.1.2.1.2.2.1.2','30','0','','','0','0','','0','','','','','0','','','','','',Array,'1','','snmp.discovery','','10117','1','4','0',NULL,'24499')".

I use zabbix 2.2.10 on CentOS 7 (with mariadb 5.5.44).

YSmetana commented 9 years ago

Hi. I am sorry about that.

Probably an incompatibility issue. Please consider to upgrade you installation to Zabbix 2.4.

menyesg commented 9 years ago

Hi, I'm experiencing the same issue. We are using Zabbix 2.2.9 and I get the same errors az Fisiu. I need a Mikrotik template just like yours... isn't there a way to fix this somehow? (we cannot upgrade our Zabbix installation due to compatibility issues)

YSmetana commented 9 years ago

isn't there a way to fix this somehow?

You can install Zabbix 2.4 on spare/virtual server, import the template and copy all the items manually to your Zabbix 2.2.

Also you can recreate it from the screenshots:

screenshot_15-09-08_12-54-45 screenshot_15-09-08_12-55-04 screenshot_15-09-08_12-55-29 screenshot_15-09-08_12-57-41

berlevdv commented 9 years ago

Hi! I'm use zabbix 2.2.2 and have the same errors when import this template. But i found the reason, and delete sections (also, i do not need them - port status down/up):

<filter>
<value>@Mikrotik interfaces</value>
</filter>

and

<trigger_prototypes>
<trigger_prototype>
<expression>{Template_Mikrotik_SNMP:.1.3.6.1.2.1.2.2.1.7.[&quot;{#SNMPINDEX}&quot;].last(0)}=1 and {Template_Mikrotik_SNMP:.1.3.6.1.2.1.2.2.1.8.[&quot;{#SNMPINDEX}&quot;].last(0)}&lt;&gt;1</expression>
<name>{#SNMPVALUE} is down on {HOST.NAME}</name>
<url/>
<status>0</status>
<priority>4</priority>
<description/>
<type>0</type>
</trigger_prototype>
</trigger_prototypes>

There is exported template for Zabbix 2.2 based on commits on Mar 14, 2015: http://www.extralan.ru/wp-content/uploads/2015/09/zabbix_2.2-mikrotik-snmp.zip

YSmetana thanks for template!