Le Fri, 27 Nov 2009 14:28:34 -0600,
Marc Powell <[email protected]> a écrit :

> 
> Next, you'll need to create a host{} definition for each of your
> switches. Your script-fu powers should come in handy here (i.e. a

I agree. Use scripts to create config files are finally the best way.
Keep your scripts, you can use their to modify configs in the future.

> 
> define host{
>       host_name       cool_switch
>       alias           Freezer Switch
>       address         192.168.1.2
>       hostgroups      switches
>       check_command   check_fping ;(or whatever it's called)
>       check_period    24x7 ; (or whatever your schedule is)
>       check_interval  5 ; (or whatever your schedule is)
>       retry_interval  1 ; (or whatever your schedule is)
>       other required parameters   ...
> }

I like to use template.

define host{
        name            switch-template
        register        0
        hostgroups      switches
        check_command   check_fping ;(or whatever it's called)
        check_period    24x7 ; (or whatever your schedule is)
        check_interval  5 ; (or whatever your schedule is)
        retry_interval  1 ; (or whatever your schedule is)
        other required parameters   ...
}

define host{
        host_name       cool_switch
        alias           Freezer Switch
        address         192.168.1.2
        use             switch-template
}

I you want to change a value for all your switches, you just have to
modify the template. If you just want to modify one switch, you can
overwrite a parameter, you change it in the switch config file. Object
inheritance is useful [1].

For example :

define host{
        host_name       other_switch
        alias           Another Switch
        address         192.168.1.3
        use             switch-template
        retry_interval  3 ; change from template
        ...
}

[1] http://nagios.sourceforge.net/docs/3_0/objectinheritance.html

-- 
Flyinvap


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagios-users mailing list
[email protected]
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

Reply via email to