Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting actions on hostgroup gives error #4

Open
techadrian opened this issue Jan 27, 2017 · 1 comment
Open

Selecting actions on hostgroup gives error #4

techadrian opened this issue Jan 27, 2017 · 1 comment

Comments

@techadrian
Copy link

Hello Guys,

When selecting the Actions Icon on a Hostgroups View (Menu Locatgion : Monitor/Hostgroups/All Hostgroups)
I receive the following error :
Fatal error: Call to undefined method HostGroup_Model::get_icon_image() in /var/www/html/ninja/modules/monitoring/controllers/extinfo.php on line 324

I managed to track down the problem here :
/var/www/html/ninja/modules/monitoring/models/base/basehostgroup.php
Therese ones seem to be missing :
private $icon_image = "";
private $icon_image_alt = "";

in comparison with /var/www/html/ninja/modules/monitoring/models/base/basehost.php .

Same goes for Servicegroups, same error same apparently incomplete class.
Making the changes manually to basehostgroup.php and baseservicegroup.php fixed the issue.
I suspect something happening at build, maybe you can have a look. I attached both files, modified and original to take a look.

Cheers,
Adrian

basehostgroup.php.zip

@chelmertz
Copy link
Contributor

Thanks for the reports, keep 'em coming, Adrian! ;)

I think you are almost correct here, but I would look in a slightly different direction. Host- and servicegroups do not have icons. The best reference I can give you to this is this page, the overview of Naemon objects and their properties: http://www.naemon.org/documentation/usersguide/objectdefinitions.html

So, instead of adding a property to the Ninja ORM models, which would resolve to something that does not reside in Naemon; I think we need to check if the object is a host or service prior to calling $object->get_icon_image() in extinfo.php.

I will make this change in our internal CI system and get back to you here. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants