It appears as though you do not have permission...

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
grymloch
Posts: 8
Joined: Tue Jul 14, 2015 4:53 pm

Re: It appears as though you do not have permission...

Post by grymloch »

Good catch @mcapra! I'm on holiday at the moment but will check that first thing upon my return, 2nd January.

Yes, admin is who I'm generally logged in as. Seems like I may want to create a read only group and assign them to everything as well so muggles can view their hosts/services.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: It appears as though you do not have permission...

Post by npolovenko »

@grymloch, Sounds good, keep us updated.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
grymloch
Posts: 8
Joined: Tue Jul 14, 2015 4:53 pm

Re: It appears as though you do not have permission...

Post by grymloch »

TL;DR Beware of nested hostgroups.

I did create an "admin" contact, and added it as a contact to all services defined and it did not change the results. Ultimately I ended up deleting all the contact references to the "admin" account as well as deleting the admin contact itself.

However, @mcapra's comments got me thinking and I started digging into the various .cfg files (services, servicegroups and hosts) and I noticed there were no members defined in servicegroups.cfg. I did have them defined via nagiosql but they weren't getting saved to the servicegroups.cfg file. I tried to mimic the nagiosql config in the servicegroups.cfg file manually, but it didn't seem to like using a hostgroup instead of a host name as part of the members definition. Nagios may not like me using a hostgroup that consists of other hostgroups

As a workaround I modified the individual services to include a "servicegroups" definition that pointed back to the service group I had defined in servicegroups.cfg. Once I made that change, all of the service groups links are working as expected.

servicegroups.cfg

Code: Select all

define servicegroup {
        servicegroup_name               esx_hosts
        alias                           ESX Hosts
        register                        1
}
check_host_alive_esx.cfg

Code: Select all

define service {
        #NAGIOSQL_CONFIG_NAME           check_host_alive_esx
        hostgroup_name                  ESX
        service_description             Host alive
        servicegroups                   esx_hosts
        use                             generic-service
        check_command                   check-host-alive
        contact_groups                  ESX_admins
        register                        1
}
Further testing confirmed that NagiosQL will not write a members definition to servicegroups.cfg if that members is a hostgroup consisting only of one or more other hostgroups. In my case I was using hostgroups for ESX servers in different labs and then creating a new hostgroup that included the lab hostgroups.

I had my services pointing to the high level ESX hostgroup instead of the lab level ones. Changing my services to point to the lab level ones, and then adding the lab levels hostgroups/services to the servicegroups.cfg (and removing the servicegroups definition from the individual services .cfg files that I'd added in the last block of code) allows everything to work as well.

I'd say everything is resolved and working as intended at this point. I appreciate everyone's input and hope this can help someone else out down the road.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: It appears as though you do not have permission...

Post by dwhitfield »

grymloch wrote: Further testing confirmed that NagiosQL will not write a members definition to servicegroups.cfg if that members is a hostgroup consisting only of one or more other hostgroups.
To the extent this is a bug, or poorly designed, NagiosQL is not a project we maintain. Clearly, the issue you had can be worked around, but to the extent someone wants to get this "fixed", you'll need to talk to the folks at NagiosQL. I am mentioning this not just for the OP, but for anyone else that might come along later and wonder why this isn't fixed.
grymloch
Posts: 8
Joined: Tue Jul 14, 2015 4:53 pm

Re: It appears as though you do not have permission...

Post by grymloch »

Excellent point. I tried to include as much information as I can to help the next person coming along with this issue.

Part of the issue was my belief that I could use a host group in the members line of servicegroups.cfg. NagiosQL allows me to do do that, but actually iterates through the underlying members of that hostgroup and builds the servicegroups.cfg file properly, unless you have a hostgroup of hostgroups.

Technically it's a bug with NagiosQL but I'd probably classify it as an unexpected use case :lol:
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: It appears as though you do not have permission...

Post by dwhitfield »

Thanks for the detail, btw!

Do you have anything else to add, or should I lock this up?
grymloch
Posts: 8
Joined: Tue Jul 14, 2015 4:53 pm

Re: It appears as though you do not have permission...

Post by grymloch »

Go ahead and lock it down.
Locked