Defining parents

Hello everyone…

I am trying to define parent switches…
So my question is… Does the parent and child information have to reside in one CFG file or could they be in multiple files within a folder and
could they be in multiple folders in multiple files.

================================================================

Nagios is contacting proxy…through switch 1 and 2…


nagios
switch1
switch2
proxy


define host {
host_name proxy

parents switch2
}

define hosts {
host_name switch2

parents switch1
}

define hosts {
host_name switch1

}

======================================================================================

I get an error when I restart nagios with a similar configuration. I am creating seperate .cfg file within the same folder for each switch.

So my question is do all the configuration have to reside inside the same text file for all parents and child. Or if I do multiple cfg files how do I get them to communicate
:slight_smile:

it can be in whatever file or directory you want, as long as the files get loaded as indicated in nagios.cfg :slight_smile:

Does the sample configuration look ok.
Not sure why it errors out…when nagios is restarted…

:wink:

try runnning nagios in config verify mode.
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/objects/nagios.cfg

There are some information that is required to be in a define host directive. See Nagios Documentation for details on which - make sure you have the required directives defined either in the host defininition, or using a host template. Also the last 2 hosts you defined - the directive is wrong - it is define host ,not define hosts.

Could you point me to the section or link in the documentation that talks about defining parents in 3.0

Thanks
:slight_smile:

nagios.sourceforge.net/docs/3_0/ … ility.html

To anyone who comes across this… I had a very interesting time understanding this… The above is not one file… It it the output of multiple files placed in one file. If you look at the link below you will have a better chance understanding this.

nagios.sourceforge.net/docs/3_0/ … .html#host

Thanks
:slight_smile:

Thanks
:slight_smile: