templates and inheritance

Tom Welsh twelsh at square-box.com
Mon Jun 2 20:38:36 CEST 2003


Slap me if I'm being stupid.

What I'd like to do is put a bunch of generic stuff in a hosts.cfg file
then have multiple /usr/local/nagios/etc/<config Dirs> pointed to with
system specific host config's. Again these could be hosts.cfg but would
only contain stuff for that item.

In the etc/hosts.cfg I'd stick

# Generic host definition template
define host{
        	name                            generic-host
notification_interval           60      
		notifications_enabled           1       
		event_handler_enabled           1       
		flap_detection_enabled          1       
		process_perf_data               1       
		retain_status_information       1       
		retain_nonstatus_information    1       
		register                        0       
       	 }

an example of what id want in my etc/switches/hosts.cfg

#'cat 6509' host definition
define host{
        use                     generic-host      
        host_name               cat6509-core
        alias                   Catalyst 6509
        address                 172.122.10.254
        check_command           check-host-alive
        max_check_attempts      3
        notification_period     24x7
        notification_options    d,r
        }

I'd then have the nagios.cfg point to various config's

cfg_file=/usr/local/nagios/etc/hosts.cfg             # for generic
stuffs
cfg_file=/usr/local/nagios/etc/switches/hosts.cfg    # every switch
config's 
cfg_file=/usr/local/nagios/etc/routers/hosts.cfg     # every router
config's
cfg_file=/usr/local/nagios/etc/Microsoft/hosts.cfg   # Microsoft
config's
cfg_file=/usr/local/nagios/etc/UNIX/hosts.cfg        # UNIX box config's


My question is would all the generic stuff be inherited from
etc/hosts.cfg into etc/switches/hosts.cfg and the others?

The purpose is so I can change stuff for generic host and only need to
change it in one place as opposed to 5 different locations. Obviously id
use like to use the same mechanism for services as well

Ta in advance

Tom Welsh
twelsh at square-box.com

DISCLAIMER: This e-mail contains proprietary information some or all of
which may be legally privileged. It is for the intended recipient only.
If an addressing or transmission error has misdirected this e-mail,
please notify the author by replying to this e-mail. If you are not the
intended recipient you must not use, disclose, distribute, copy, print,
or rely on this e-mail.

Sender accepts no liability for any damage resulting from the use and/or
acceptation of the content of this e-mail. 

Always scan attachments before opening them.

The views expressed in this communication may not necessarily be the
views held by squareBOX technologies ltd





-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list