[ZBX-5461] Importing default OS (and other) templates fails in 2.0.2 - Undefined index: expression/Cannot implode expression "". Created: 2012 Aug 16  Updated: 2017 May 30  Resolved: 2012 Aug 29

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A), Server (S), Templates (T)
Affects Version/s: 2.0.2
Fix Version/s: 2.0.3rc1, 2.1.0

Type: Incident report Priority: Major
Reporter: Aaron Smart Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: api, templates, usability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS 5.8
linux 2.6.18-308.11.1.el5 x86_64
apache 2.2.3, php 5.1.6, mysql 5.0.95


Issue Links:
Duplicate
duplicates ZBX-5185 unable to clone or import templates c... Closed
is duplicated by ZBX-5507 Errors when import template with trig... Closed

 Description   

I upgraded from Zabbix 1.8.6 to 2.0.2 and did not experience any issues during the upgrade process.
I used Kodai Terashima's RPM packages from here: http://www.kodai74.net/packages/zabbix/zabbix-2.0/rhel/5/x86_64/

I noticed the new default templates were not present, so after searching the forums I found them here:
https://zabbix.org/wiki/Zabbix_Templates/Official_Templates#Zabbix_2.0.0

I was able to import all the App and SNMP templates successfully, however importing the OS templates fail (I have tried Linux, Windows, Mac OS X, and OpenBSD).

Here is the error I get when importing "Template OS Windows":

Created: Application "Zabbix agent" on "Template OS Windows".
Created: Item "Host name of zabbix_agentd running" on "Template OS Windows".
Created: Item "Agent ping" on "Template OS Windows".
Created: Item "Version of zabbix_agent(d) running" on "Template OS Windows".
Created: Trigger "Host name of zabbix_agentd was changed on

{HOSTNAME}" on "Template OS Windows".
Created: Trigger "Zabbix agent on {HOSTNAME}

is unreachable for 5 minutes" on "Template OS Windows".
Created: Trigger "Version of zabbix_agent(d) was changed on

{HOSTNAME}

" on "Template OS Windows".
Created: Application "CPU" on "Template OS Windows".
Created: Application "Filesystems" on "Template OS Windows".
Created: Application "General" on "Template OS Windows".
Created: Application "Memory" on "Template OS Windows".
Created: Application "Network interfaces" on "Template OS Windows".
Created: Application "OS" on "Template OS Windows".
Created: Application "Performance" on "Template OS Windows".
Created: Application "Processes" on "Template OS Windows".
Created: Item "Average disk read queue length" on "Template OS Windows".
Created: Item "Average disk write queue length" on "Template OS Windows".
Created: Item "File read bytes per second" on "Template OS Windows".
Created: Item "File write bytes per second" on "Template OS Windows".
Created: Item "Free memory" on "Template OS Windows".
Created: Item "Free swap space" on "Template OS Windows".
Created: Item "Number of processes" on "Template OS Windows".
Created: Item "Number of threads" on "Template OS Windows".
Created: Item "Processor load (1 min average)" on "Template OS Windows".
Created: Item "Processor load (5 min average)" on "Template OS Windows".
Created: Item "Processor load (15 min average)" on "Template OS Windows".
Created: Item "System information" on "Template OS Windows".
Created: Item "System uptime" on "Template OS Windows".
Created: Item "Total memory" on "Template OS Windows".
Created: Item "Total swap space" on "Template OS Windows".
Created: Discovery rule "Mounted filesystem discovery" on "Template OS Windows".
Created: Discovery rule "Network interface discovery" on "Template OS Windows".
Created: Item prototype "Free disk space on $1" on "Template OS Windows".
Created: Item prototype "Free disk space on $1 (percentage)" on "Template OS Windows".
Created: Item prototype "Free inodes on $1 (percentage)" on "Template OS Windows".
Created: Item prototype "Total disk space on $1" on "Template OS Windows".
Created: Item prototype "Used disk space on $1" on "Template OS Windows".
Created: Item prototype "Incoming network traffic on $1" on "Template OS Windows".
Created: Item prototype "Outgoing network traffic on $1" on "Template OS Windows".
Undefined index: expression [api/classes/CTriggerPrototype.php:1139]
Undefined index: expression [api/classes/CTriggerPrototype.php:1141]
Cannot implode expression "".

The last three error lines are the same when importing other OS templates. I also get the same error when importing a user-created NetApp template from here: http://www.zabbix.com/forum/showthread.php?t=26466

I don't see any obvious errors in zabbix_server.log or Apache error_log



 Comments   
Comment by richlv [ 2012 Aug 17 ]

could you please try with latest 2.0 svn head (or development snapshot) ? those templates seem to import just fine for me

Comment by Aaron Smart [ 2012 Aug 17 ]

I'm sorry I haven't a clue about svn and don't see anything newer than 2.0.2 on the SourceForge page. What do I do?

Comment by richlv [ 2012 Aug 17 ]

you can read about nightly builds and/or svn at https://zabbix.org/wiki/Get_Zabbix

Comment by Aaron Smart [ 2012 Aug 17 ]

OK I tried 2.0.3rc1 revision 29617 and get the same error but with different line references:

Undefined index: expression [api/classes/CTriggerPrototype.php:1151]
Undefined index: expression [api/classes/CTriggerPrototype.php:1153]
Cannot implode expression "".

Comment by Alexey Fukalov [ 2012 Aug 29 ]

dev branch: svn://svn.zabbix.com/branches/dev/ZBX-5461

Fixed problem with PHP 5.1.6
And problem with dependency importing.

Comment by Toms (Inactive) [ 2012 Aug 30 ]

TESTED

Comment by Alexey Fukalov [ 2012 Aug 31 ]

Fixed in 2.0.3rc1 29985, 2.1.0rc1 29986

Generated at Fri Apr 19 07:25:34 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.