Host groups and templates

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
eko
Posts: 10
Joined: Mon Apr 22, 2013 1:53 am

Host groups and templates

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Host groups and templates

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
eko
Posts: 10
Joined: Mon Apr 22, 2013 1:53 am

Re: Host groups and templates

Post 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?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Host groups and templates

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
eko
Posts: 10
Joined: Mon Apr 22, 2013 1:53 am

Re: Host groups and templates

Post 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?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Host groups and templates

Post by abrist »

It should. You would add the hostgroup/servicegroup to the respective template in XI.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
eko
Posts: 10
Joined: Mon Apr 22, 2013 1:53 am

Re: Host groups and templates

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Host groups and templates

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
eko
Posts: 10
Joined: Mon Apr 22, 2013 1:53 am

Re: Host groups and templates

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Host groups and templates

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked