NagiosEnterprises/nagiosvshell

Undefined property: Hostgroup::$members

Closed this issue · 5 comments

Hello I have problems with Host Groups summary.

When I try to get host groups summary the system fails and put in the web page:
Error failed to update hostgroups data from the V-Shell2 API Today at 1:29 PM

If I check the logs in /usr/local/vshell2/api/application/logs:
ERROR - 2014-12-24 19:27:17 --> Severity: Notice --> Undefined property: Hostgroup::$members /usr/local/vshell2/api/application/libraries/factory/objects/Hostgroup.php 55
ERROR - 2014-12-24 19:27:17 --> Severity: Notice --> Undefined variable: limit /usr/local/vshell2/api/application/core/VS_Controller.php 60
ERROR - 2014-12-24 19:27:18 --> Severity: Notice --> Undefined variable: limit /usr/local/vshell2/api/application/core/VS_Controller.php 60
ERROR - 2014-12-24 19:27:18 --> Severity: Notice --> Undefined variable: limit /usr/local/vshell2/api/application/core/VS_Controller.php 60

Hello I can reproduce the problem.

When a HostGroup is empty the parsing fails!!!

I'm having some trouble reproducing the problem on my end. Can you post your Nagios configuration for the host that is causing the error? Make sure to censor any important information first!

Thanks Esteban, really appreciate all of your feedback!

OK... I will to try to explain.

We have several HostGroups:
infraestructura
integracion
linux-servers

All of these hostgroups contains almost one host. If I created a empty hostgroup (without members)... for example:
empty-hostgroup

And restart the nagios service... the problems appears, the hostgrups.cfg content:

define hostgroup {
hostgroup_name empty-hostgroup
alias Empty
register 1
}

define hostgroup {
hostgroup_name infraestructura
alias Infraestructura
members infrahappyserver1,infrahappyserver2,infrahappyserver3,infrahappyserver4,infrahappyserver4,infrahappyserver5
register 1
}

define hostgroup {
hostgroup_name integracion
alias Integracion
members happyintegratedserver1,happyintegratedserver2,happyintegratedserver3,happyintegratedserver4,happyintegratedserver4
register 1
}

define hostgroup {
hostgroup_name linux-servers
alias Linux Servers
members NagiosCoreHappyServer
register 1
}

If I delete the empty-hostgroup. Problem resolved, the content of hostgroups.cfg file:
define hostgroup {
hostgroup_name infraestructura
alias Infraestructura
members infrahappyserver1,infrahappyserver2,infrahappyserver3,infrahappyserver4,infrahappyserver4,infrahappyserver5
register 1
}

define hostgroup {
hostgroup_name integracion
alias Integracion
members happyintegratedserver1,happyintegratedserver2,happyintegratedserver3,happyintegratedserver4,happyintegratedserver4
register 1
}

define hostgroup {
hostgroup_name linux-servers
alias Linux Servers
members NagiosCoreHappyServer
register 1
}

Thanks for the additional information, it was a big help identifying the issue.

Release v2.0.0-414 (eca71f3) should fix empty hostgroups and servicegroups. Let me know how it works on your end!

Looks like this was fixed! Closing the issue. Re-open if you think otherwise.