Services inheritance through hostgroup and host template
Services inheritance through hostgroup and host template
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
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
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Services inheritance through hostgroup and host template
Are they marked Active?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).
Also, we do have the hostgroups in the services correct?
Re: Services inheritance through hostgroup and host template
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.
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.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Services inheritance through hostgroup and host template
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/nagiosRe: Services inheritance through hostgroup and host template
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.
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.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Services inheritance through hostgroup and host template
Hmm, it does look like the nagios directory has the wrong permissions
run
Not positive this is the problem though.
run
Code: Select all
chown nagios.nagios /usr/local/nagiosRe: Services inheritance through hostgroup and host template
any updates on this? I'm running into the same issue?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Services inheritance through hostgroup and host template
Exactly the same?
Can you post the output of
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/nagiosRe: Services inheritance through hostgroup and host template
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 ~]#
[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
@nagra
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.
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: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.
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.
Be sure to check out our Knowledgebase for helpful articles and solutions!