Parent Host Config Issue

Support requests, bug reports, questions etc.
Locked
traxxx9
Parent Host Config Issue

Post by traxxx9 » Fri May 29, 2009 18:19

This looks like a great product and, so far, I believe my company is going to proceed large-scale with it. Before we do, however, there are two things that we we need to resolve; I'll post them separately to keep a little sanity and clarity for others that may have similar issues.
I've been able to install and configure both Nagios and NConf with no issues, but configuring through NConf gives me one little problem. When I add a Parent Host in NConf for a host configuration, it doesn't show up in the Nagios interface (Status Map) and also never makes it to the config file. I've looked at the schema (I have NOT edited it) and it shows that this is a parameter that *should* be written to the config. Since we have several datacenters that we monitor, this is pretty important. If one datacenter loses connectivity we don't need to receive an alert for every server located there, just the one telling us that the Parent Host (router/switch) is down.
Any ideas on why this is happening (or not happening, depending on the point of view) and how I can make it work?
I'm running this on Slackware 12.2, Nagios 3.0.6, NConf 1.2.4.
Thanks!

User avatar
agargiulo
NConf developer
NConf developer
Posts:725
Joined:Fri Mar 06, 2009 17:50
Location:Zurich, Switzerland
Contact:

Re: Parent Host Config Issue

Post by agargiulo » Sun May 31, 2009 21:50

Hi.

Are you using multiple collector servers in NConf? The idea with multiple collectors is that each server only has to know the servers it monitors itself. So if you have configured parent hosts, chances are that your parent host is monitored by a different collector.
When the config is generated by NConf, each collector's config will only contain the hosts which are assigned to it. This is also true for parent hosts (the Nagios syntax check does not allow you to configure a parent host that is not contained in your hosts.cfg). So the solution would be to assign the same collector server to your host and your parent host.

Let me know if this solves the issue. Otherwise I will need a little more information on your setup.

Traxxx9

Re: Parent Host Config Issue

Post by Traxxx9 » Thu Jun 04, 2009 17:11

To make things simple for testing, I have only configured a single collector. The parent (a switch) and the hosts "under" it all point to this collector. The parent is configured in my hosts.cfg file and also recognized by Nagios. What other information would you like me to provide?

User avatar
agargiulo
NConf developer
NConf developer
Posts:725
Joined:Fri Mar 06, 2009 17:50
Location:Zurich, Switzerland
Contact:

Re: Parent Host Config Issue

Post by agargiulo » Fri Jun 05, 2009 11:34

Let me understand correctly. You have the following setup in NConf:

- switch (parent host)
---- host 1 (child of switch)
---- host 2 (child of switch)
- collector

All hosts are monitored by the same collector.
When you click "generate", you get a hosts.cfg file containing 3 servers: switch, host1, host2
When you look at the generaed config everything is correct, except this: host1 and host2 don't have a "parents" attribute pointing to the switch.

Is this correct? Have you really set the "monitored by" attribute for each host (also for the switch)?

traxxx9

Re: Parent Host Config Issue

Post by traxxx9 » Fri Jun 05, 2009 16:38

Yes, that is all correct. Host1 and Host2 do not have the "parent" attribute at all, it never makes it to the config file.

User avatar
agargiulo
NConf developer
NConf developer
Posts:725
Joined:Fri Mar 06, 2009 17:50
Location:Zurich, Switzerland
Contact:

Re: Parent Host Config Issue

Post by agargiulo » Fri Jun 05, 2009 17:19

Is it possible that you have also added a "monitor" server to your configuration? The following behavior is intended:

Case A: If there is no monitor server present, then NConf assumes that you are not using a distributed Nagios setup. In this case the "parent" items are written to the hosts.cfg of your collector.

Case B: If a monitor server exists, then it is likely that you are using more than one collector and are forwarding all results to your monitor. In this case, the "parent" items are not written to the collector config, to prevent problems with dependencies, where you set a parent host, that is unknown to one collector. In this kind of setup, the parent items are written to the hosts.cfg file of the monitor server instead.

If you have not added a monitor server, then I would need a dump of your database to be able to reconstruct the error.

Let me know.

traxxx9

Re: Parent Host Config Issue

Post by traxxx9 » Fri Jun 05, 2009 19:01

I am not presently doing distributed monitoring, but plan to implement it.
Regarding monitors and collectors, I have left the defaults that were created when I first generated my config through NConf; I have added no additional monitors or collectors. This gave me a Nagios-monitor named "localhost" and a Nagios-collector named "Default Nagios". For all hosts, I have "host is collector" set to "no" and "monitored by" set to "Default Nagios". If I set the "monitored by" option to nothing (blank) then I lose the hosts in Nagios.
I have looked at the hosts.cfg file for localhost and I DO see the "parent" entries there, although when I enable the localhost directory for Nagios parsing in nagios.cfg, Nagios will fail to restart, telling me "... CONFIG ERROR! Restart aborted. Check your Nagios configuration". This localhost directory is created by NConf and not altered by me.
Should I delete the "Nagios-monitor" entry for localhost?
If not, what portions of my db can I supply you - do you want all cfg files that Nagios is parsing?

User avatar
agargiulo
NConf developer
NConf developer
Posts:725
Joined:Fri Mar 06, 2009 17:50
Location:Zurich, Switzerland
Contact:

Re: Parent Host Config Issue

Post by agargiulo » Sat Jun 06, 2009 08:39

Should I delete the "Nagios-monitor" entry for localhost?
Yes, delete it. When you do a fresh installation of NConf, there is no "Nagios-monitor" present. I don't know how your "localhost" has gotten there.
If not, what portions of my db can I supply you - do you want all cfg files that Nagios is parsing?
I would need a dump of your current NConf database.

traxxx9

Re: Parent Host Config Issue

Post by traxxx9 » Mon Jun 08, 2009 18:10

The issue has been resolved by deleting the "localhost" entry - thanks very much for your assistance. I *believed* the localhost entry to have been created when I first installed NConf, but perhaps this was not the case.
With this functionality working properly, it now looks like we're going to do a full-blown implementation of Nagios/ NConf on close to 300 Windows servers.

Please move this from the "Bug Reports" section the the "User Error" section ;)

ps - when can we expect version 1.2.5? It has some additional features we'd love to make use of.

User avatar
agargiulo
NConf developer
NConf developer
Posts:725
Joined:Fri Mar 06, 2009 17:50
Location:Zurich, Switzerland
Contact:

Re: Parent Host Config Issue

Post by agargiulo » Tue Jun 09, 2009 08:55

Don't worry about it ;)
We are planning to release NConf 1.2.5 this week!

traxxx9

Re: Parent Host Config Issue

Post by traxxx9 » Tue Jun 09, 2009 19:46

Sweet - I'm looking forward to implementing this as soon as it's available.
Thanks so much for putting this program together - this is really the greatest add-on for Nagios that I've seen or used.
I'm currently putting together a Nagios/NConf soup-to-nuts document for others in my group; this is for Nagios running under Slackware 12.2. Once finished I'll forward the NConf-relevant parts to you. Hopefully this can help some of your other users.
Thanks again!

User avatar
agargiulo
NConf developer
NConf developer
Posts:725
Joined:Fri Mar 06, 2009 17:50
Location:Zurich, Switzerland
Contact:

Re: Parent Host Config Issue

Post by agargiulo » Tue Jun 09, 2009 23:11

Cool, thx!

Locked