[ZBX-7838] Maps become unavailable when an item is in maintenance Created: 2014 Feb 19  Updated: 2017 May 30  Resolved: 2014 Apr 08

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.2.0
Fix Version/s: 2.2.3

Type: Incident report Priority: Major
Reporter: Peter van den Berg Assignee: Kodai Terashima
Resolution: Fixed Votes: 0
Labels: packaging, rhel
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File maintenance.patch    

 Description   

When an element of a map is in maintenance you cannot select this map from monitoring -> maps.

This seems to be a return of the issue in ZBX-1605. The same error is logged in the apache logs:
[Wed Feb 19 13:10:59 2014] [error] [client ********] PHP Fatal error: Call to undefined function get_maintenance_by_maintenanceid() in /usr/share/zabbix/include/maps.inc.php on line 1248

Workaround is to add require_once('include/maintenances.inc.php'); to include/maps.inc.php ;
The map can still be edited, just not displayed.



 Comments   
Comment by Pavels Jelisejevs (Inactive) [ 2014 Feb 20 ]

I can't seem to reproduce this issue. Have you made any modifications to the source?

Could you please run "cat include/classes/core/ZBase.php | grep /include/" from the frontend directory and show us the output? This will make sure that all files are included correctly.

Comment by Peter van den Berg [ 2014 Feb 20 ]

I have not made any modifications to the source.

cat include/classes/core/ZBase.php | grep /include/
require_once $this->getRootDir().'/include/debug.inc.php';
require_once $this->getRootDir().'/include/gettextwrapper.inc.php';
require_once $this->getRootDir().'/include/defines.inc.php';
require_once $this->getRootDir().'/include/func.inc.php';
require_once $this->getRootDir().'/include/html.inc.php';
require_once $this->getRootDir().'/include/perm.inc.php';
require_once $this->getRootDir().'/include/audit.inc.php';
require_once $this->getRootDir().'/include/js.inc.php';
require_once $this->getRootDir().'/include/users.inc.php';
require_once $this->getRootDir().'/include/validate.inc.php';
require_once $this->getRootDir().'/include/profiles.inc.php';
require_once $this->getRootDir().'/include/locales.inc.php';
require_once $this->getRootDir().'/include/db.inc.php';
require_once $this->getRootDir().'/include/nodes.inc.php';
require_once $this->getRootDir().'/include/acknow.inc.php';
require_once $this->getRootDir().'/include/actions.inc.php';
require_once $this->getRootDir().'/include/discovery.inc.php';
require_once $this->getRootDir().'/include/draw.inc.php';
require_once $this->getRootDir().'/include/events.inc.php';
require_once $this->getRootDir().'/include/graphs.inc.php';
require_once $this->getRootDir().'/include/hosts.inc.php';
require_once $this->getRootDir().'/include/httptest.inc.php';
require_once $this->getRootDir().'/include/ident.inc.php';
require_once $this->getRootDir().'/include/images.inc.php';
require_once $this->getRootDir().'/include/items.inc.php';
require_once $this->getRootDir().'/include/maps.inc.php';
require_once $this->getRootDir().'/include/media.inc.php';
require_once $this->getRootDir().'/include/services.inc.php';
require_once $this->getRootDir().'/include/sounds.inc.php';
require_once $this->getRootDir().'/include/triggers.inc.php';
require_once $this->getRootDir().'/include/valuemap.inc.php';
$this->rootDir.'/include/classes',
$this->rootDir.'/include/classes/core',
$this->rootDir.'/include/classes/api',
$this->rootDir.'/include/classes/db',
$this->rootDir.'/include/classes/debug',
$this->rootDir.'/include/classes/validators',
$this->rootDir.'/include/classes/validators/schema',
$this->rootDir.'/include/classes/validators/string',
$this->rootDir.'/include/classes/validators/object',
$this->rootDir.'/include/classes/validators/hostgroup',
$this->rootDir.'/include/classes/validators/host',
$this->rootDir.'/include/classes/validators/hostprototype',
$this->rootDir.'/include/classes/validators/event',
$this->rootDir.'/include/classes/export',
$this->rootDir.'/include/classes/export/writers',
$this->rootDir.'/include/classes/export/elements',
$this->rootDir.'/include/classes/import',
$this->rootDir.'/include/classes/import/importers',
$this->rootDir.'/include/classes/import/readers',
$this->rootDir.'/include/classes/import/formatters',
$this->rootDir.'/include/classes/items',
$this->rootDir.'/include/classes/server',
$this->rootDir.'/include/classes/screens',
$this->rootDir.'/include/classes/sysmaps',
$this->rootDir.'/include/classes/helpers',
$this->rootDir.'/include/classes/helpers/trigger',
$this->rootDir.'/include/classes/macros',
$this->rootDir.'/include/classes/tree',
$this->rootDir.'/include/classes/html',
$this->rootDir.'/include/classes/parsers',
require_once $this->getRootDir().'/include/translateDefines.inc.php';

I mentioned this problem on the irc channel and Richlv said:
14:09 Richlv> peterb_, well, in trunk maps seem to be complete broken for me
Perhaps he can give more info.

I have installed zabbix 2.2.2 on a test server, run the above command and there the next line IS included:
require_once $this->getRootDir().'/include/maintenances.inc.php';

The 2.2.0 installation we have is from the official zabbix repo.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Feb 20 ]

Yes, looks like the package you've installed is missing this line.

    require_once $this->getRootDir().'/include/maintenances.inc.php';

What package did you install exactly?

Comment by Peter van den Berg [ 2014 Feb 20 ]

Installed version 2.2.0-1.el6 from the zabbix repository:

$ yum list installed | grep zabbix
fping.x86_64 2.4b2-16.el6 @zabbix-non-supported
libssh2.x86_64 1.4.2-2.el6 @zabbix-non-supported
zabbix.x86_64 2.2.0-1.el6 @zabbix
zabbix-agent.x86_64 2.2.0-1.el6 @zabbix
zabbix-get.x86_64 2.2.0-1.el6 @zabbix
zabbix-java-gateway.x86_64 2.2.0-1.el6 installed
zabbix-release.noarch 2.2-1.el6 @zabbix
zabbix-sender.x86_64 2.2.0-1.el6 @zabbix
zabbix-server.x86_64 2.2.0-1.el6 @zabbix
zabbix-server-mysql.x86_64 2.2.0-1.el6 @zabbix
zabbix-web.noarch 2.2.0-1.el6 @zabbix
zabbix-web-mysql.noarch 2.2.0-1.el6 @zabbix

Comment by Pavels Jelisejevs (Inactive) [ 2014 Feb 20 ]

Thanks for all the information. This file is indeed included incorrectly in the RHEL 2.2.0 package. I'll reassign the issue to Kodai, our RHEL package manager, to fix the package. But as for now you can use the attached patch to fix the problem.

Comment by Frederico Passos [ 2014 Feb 24 ]

The maintenance.patch is incorrect.

The correct is maintenances.inc.php (plural), not maintenance.inc.php (singular).

Comment by Pavels Jelisejevs (Inactive) [ 2014 Feb 25 ]

Frederico Passos, right, my mistake. I've corrected the patch.

Comment by Kodai Terashima [ 2014 Apr 08 ]

Fixed in 2.2.3

Generated at Mon Apr 28 18:41:56 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.