How to make 1 exception for 1 host when mapping services to hostgroups?

Max perldork at webwizarddesign.com
Mon Sep 7 17:16:02 CEST 2009


On Mon, Sep 7, 2009 at 10:54 AM, Jelle Smet<nagios at smetj.net> wrote:
> For one of the hosts I want to have a different threshold for only the "Root
> Disk" test.

Hi Jelle,

One way to do this is use the custom host and service variables that
Nagios 3.x provides in it's configuration DSL.  We use this
extensively.

http://nagios.sourceforge.net/docs/3_0/customobjectvars.html

If you use custom host variables in your service definitions, you can
then define thresholds for services at the host level, which means you
can use inheritance to have a common base set of thresholds but then
override those as needed.

SHort example:

define command {
    command_name my_check_command
    command_line /path/to/command -w $_HOST_MY_CHECK_WARN$ -c
$_HOST_MY_CHECK_CRIT$
}

define service {
    service_description My Service
    check_command my_check_command
    hostgroup_name my_group
}

define host {
     name      my_template
     hostgroups +my_group
     __my_check_warn foo,gt,90
     __my_check_crit   foo,gt,98
    register 0
}

define host {
    use my_template
    host_name my_host
    alias My Host
    ;  Override the critical threshold
   __my_check_crit foo,gt,60
}

------------------------------------------------------------------------------
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
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