Page 1 of 3

Host groups and templates

Posted: Mon Apr 22, 2013 2:53 am
by eko
I'm new to Nagios XI and trying to set up some host groups and templates, but I'm experiencing some difficulties.

The first problem is that hosts sometimes won't show up in the host groups's assigned hosts list. The specific host is greyed out so I can't add it. If I then go to that specific host, and go to 'manage hostgroups' it does list the hostgroup as assigned?

The second problem I'm having is that my template won't flow down to the hosts. Maybe I'm just trying something that isn't supposed to work. I made a fresh 'company template' with some misc. setttings in it, then I made a 'department template' without any settings (yet) which I assigned the 'company template' and a hostgroup. I would expect the hosts in this hostgroup to recieve the misc. settings from the 'company template' but they don't. Should this work in the first place? If yes, what am I doing wrong?

Thanks in advance, Erik

Re: Host groups and templates

Posted: Mon Apr 22, 2013 9:48 am
by abrist
1. You can assign hosts to hostgroups two ways: from the hostgroups configuration in the CCM, and from the hosts. If an object is gray in the list, it usually implies they are already added to the hostgroup somewhere else (in your case the host's configuration). In fact, you should see "=>" Denotes object relationship elsewhere underneath the left hand pane where you add hosts, explaining the grayed out option.

2. Any options you want inherited from a template must be left blank, or set to 'skip' on the host/service/group object configuration. Local, primary object setting will take precedence over template settings, thus, you will need to set the "skip" value for the those inherited options.

Re: Host groups and templates

Posted: Tue Apr 23, 2013 2:28 am
by eko
Thanks,

1. thanks for clearing that up, is there any difference in adding a host to a host group or adding a host group to a host?

2. I know that, everything is left blank. In fact I got two seperate 'department templates', which are the same except the name. One is working, the other one isn't. Looks like the hosts itself are causing trouble. I tried deleting and re-adding a host, and repairing the database, didn't make a difference. I deleted the non-working template and copied the working template, no result.

Is it possible that Nagios holds some old information from these hosts (I did a lot of 'testing' with these hosts), is there any place to purge this?

Re: Host groups and templates

Posted: Tue Apr 23, 2013 1:56 pm
by abrist
1. Not really, you just have to be aware of how you create the relationships so that you can easily remove or change them in the future.

2. What specific settings are not working? I would like to test this.
eko wrote:Is it possible that Nagios holds some old information from these hosts (I did a lot of 'testing' with these hosts), is there any place to purge this?
The configs are generated from the database, and the database is represented by the CCM. If everything is in sync in the CCM, we should be able to hunt down the issues there.

Re: Host groups and templates

Posted: Wed Apr 24, 2013 3:11 am
by eko
1. tnx

2. Well, actually nothing is working. Before diving further into this: it does work if I assign a template directly to the host or service. I assume this should not be necessary, adding a host/service to a host-/servicegroup which has an assigned template should do the trick right?

Re: Host groups and templates

Posted: Wed Apr 24, 2013 12:10 pm
by abrist
It should. You would add the hostgroup/servicegroup to the respective template in XI.

Re: Host groups and templates

Posted: Thu Apr 25, 2013 3:03 am
by eko
Allright then, this is the situation:

- Company host template with an icon specified in misc. settings.
- Department host template which has no settings defined. It's template is the Company template, and it's hostgroup is Department host group.
- The Department host group has hosts in it, no host groups.

They are all active but stuff does not work. Any suggestions, things I could do or starting points?

Re: Host groups and templates

Posted: Thu Apr 25, 2013 2:55 pm
by scottwilkerson
When you create the hosts files and the templates, in the Hostgroup Options of the "Manage Hostgroups" section do you have the + selected or is it just set to standard?

You will need the + selected if you want them to be additive and not have the template overwritten by other templates or the host file

Re: Host groups and templates

Posted: Fri Apr 26, 2013 2:00 am
by eko
I add the hosts to the host group, not the other way around, so I don't have those options (so there is a difference!). But when I do, it still doesn't make a difference.

Re: Host groups and templates

Posted: Fri Apr 26, 2013 11:41 am
by scottwilkerson
Based on what you are saying, this should work. Can we verify that it isn't something else (like db corruption) causing it

Lets run the following and return the results

Code: Select all

tail /var/log/mysql.log