Page 1 of 2

Services inheritance through hostgroup and host template

Posted: Thu Mar 14, 2013 5:48 am
by nagra
Hello,

I am currently doing some test with Nagios (Core and XI) and i am facing the following pb:

I have done a configuration that define a host - this host use a host template - this host template is define as a member of a (service)host group and i have 3 services associated to this (service)host group.

This configuration works fine with Nagios Core ( the host is correctly monitored using the 3 services) but using XI the host is never exported (no host file created in nagios etc/hosts directory) and the host status and the 3 services status remain "Sync Missed" in Nagios XI hosts and services view (I have no error when applying the configuration).
I have tried to split my configuration in in commands-hosttemplates-hosts-servicetemplate-service and servicegroup files to respect the preconized order but same result.


I would like to know if Nagios-XI manage services inheritance (through hostgroup) like the Nagios Core does ?


F.Mengel

Current version:
Latest Available Version: 2012R1.6
Installed Version: 2012R1.6
Last Update Check: 2013-03-14 14:03:47

Re: Services inheritance through hostgroup and host template

Posted: Thu Mar 14, 2013 9:15 am
by scottwilkerson
nagra wrote:and the 3 services status remain "Sync Missed" in Nagios XI hosts and services view (I have no error when applying the configuration).
Are they marked Active?
Also, we do have the hostgroups in the services correct?

Re: Services inheritance through hostgroup and host template

Posted: Thu Mar 14, 2013 9:32 am
by nagra
Yes , host and services are active.

I have run /usr/local/nagiosxi/scripts/reset_config_perms to verify files permissions.
I have also cheked permission with the GUI->admin->check files permission -> OK

I just discover that i have a pb when i try to disable my services - the error is :

There was a problem updating the selected item type: service
ID: 59
Errors while deleting the old configuration file: localhost.cfg - please check permissions!
Config file: /usr/local/nagios/etc/services//localhost.cfg failed to delete, check permissions and delete file manually!There was a problem updating the selected item type: service
ID: 2
Errors while deleting the old configuration file: localhost.cfg - please check permissions!
Config file: /usr/local/nagios/etc/services//localhost.cfg failed to delete, check permissions and delete file manually!There was a problem updating the selected item type: service
ID: 3
Errors while deleting the old configuration file: localhost.cfg - please check permissions!
Config file: /usr/local/nagios/etc/services//localhost.cfg failed to delete, check permissions and delete file manually!There was a problem updating the selected item type: service
ID: 8
Errors while deleting the old configuration file: localhost.cfg - please check permissions!
Config file: /usr/local/nagios/etc/services//localhost.cfg failed to delete, check permissions and delete file manually!


Any ideas ?
Thanks.

Re: Services inheritance through hostgroup and host template

Posted: Thu Mar 14, 2013 12:16 pm
by scottwilkerson
can you run

Code: Select all

ls -l /usr/local/nagios/etc/services/localhost.cfg
ls -ld /usr/local/nagios/etc/services
ls -ld /usr/local/nagios/etc
ls -ld /usr/local/nagios

Re: Services inheritance through hostgroup and host template

Posted: Fri Mar 15, 2013 4:58 am
by nagra
Hello Scott,
This is the current file and directory permissions:

[[email protected]:/home/root] # ls -l /usr/local/nagios/etc/services/localhost.cfg
-rw-rw-r-- 1 apache nagios 1869 Mar 13 12:52 /usr/local/nagios/etc/services/localhost.cfg
[[email protected]:/home/root] # ls -ld /usr/local/nagios/etc/services
drwsrwsr-x 2 apache nagios 4096 Mar 14 15:53 /usr/local/nagios/etc/services
[[email protected]:/home/root] # ls -ld /usr/local/nagios/etc
drwxrwxr-x 8 apache nagios 4096 Mar 14 15:53 /usr/local/nagios/etc
[[email protected]:/home/root] # ls -ld /usr/local/nagios
drwxr-xr-x 8 root root 4096 Feb 20 09:46 /usr/local/nagios

If i could not fix this , i will re-install nagios-xi from scratch (may it will be faster !).
Francois.

Re: Services inheritance through hostgroup and host template

Posted: Fri Mar 15, 2013 7:20 am
by scottwilkerson
Hmm, it does look like the nagios directory has the wrong permissions

run

Code: Select all

chown nagios.nagios /usr/local/nagios
Not positive this is the problem though.

Re: Services inheritance through hostgroup and host template

Posted: Mon Jan 06, 2014 6:05 pm
by jwu
any updates on this? I'm running into the same issue?

Re: Services inheritance through hostgroup and host template

Posted: Mon Jan 06, 2014 9:46 pm
by scottwilkerson
Exactly the same?

Can you post the output of

Code: Select all

ls -l /usr/local/nagios/etc/services/localhost.cfg
ls -ld /usr/local/nagios/etc/services
ls -ld /usr/local/nagios/etc
ls -ld /usr/local/nagios

Re: Services inheritance through hostgroup and host template

Posted: Tue Jan 07, 2014 11:01 am
by jwu
this is what I have

[root@cvglobal ~]# ls -l /usr/local/nagios/etc/services/localhost.cfg
-rw-rw-r-- 1 apache nagios 1869 Jan 6 18:31 /usr/local/nagios/etc/services/localhost.cfg
[root@cvglobal ~]# ls -ld /usr/local/nagios/etc/services
drwsrwsr-x 2 apache nagios 4096 Jan 6 17:10 /usr/local/nagios/etc/services
[root@cvglobal ~]# ls -ld /usr/local/nagios/etc
drwsrwsr-x 7 apache nagios 4096 Dec 20 14:58 /usr/local/nagios/etc
[root@cvglobal ~]# ls -ld /usr/local/nagios
drwxr-xr-x 8 nagios nagios 4096 Jun 5 2013 /usr/local/nagios
[root@cvglobal ~]#

Re: Services inheritance through hostgroup and host template

Posted: Tue Jan 07, 2014 12:51 pm
by lmiltchev
@nagra
I have done a configuration that define a host - this host use a host template - this host template is define as a member of a (service)host group and i have 3 services associated to this (service)host group.
In XI, you can add a service to either hostgroup and a servicegroup, but you cannot add a service template to a host. You can only add a host template to a host. I tried to recreate the issue by doing to following:

1. I defined a test host, and added the "generic-host" template to it.
2. I added a test hostgroup to the "generic-host" template
3. I added three services to the test hostgroup
4. Saved and applied configuration

Result:
The three services have been inherited from the template and I can see them in the web interface under the test host. So I guess it's working as intended as far as I can tell.