Custom per-host attributes

Marc Powell marc at ena.com
Mon Jun 19 18:15:01 CEST 2006



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Jee Kay
> Sent: Monday, June 19, 2006 10:12 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Custom per-host attributes
> 
> Is there anyway of storing custom per-host attributes? Specifically
> I'd like to be able to store things like SNMP communities so that I
> can access them in command configurations. At the moment I end up
> having to having different command definitions for hosts with
> different communities, which means I have to split hosts into
> different hostgroups for services etc etc. It's a pain, and its not
> just SNMP :) Things like interfaces to exclude from ifstatus would
> also be fantastic to be able to define per-host.
> 
> I'm running 1.3 at the moment if that makes any difference... though
> an upgrade is possible if necessary :)

Full user custom macros are not yet supported and are expected to be
available in 3.0 (http://www.nagios.org/development/upcoming.php). 

You can pass that information as part of your service definition using
the $ARGn$ macros now however. For example, using the following command
definition I can support different SNMP community strings --

define command {
    command_name                   check_temperature
    command_line                   $USER1$/check_snmp -H $HOSTADDRESS$
-u 'Degrees Celsius' -o .1.3.6.1.4.1.9.9.13.1.3.1.3.2 -C $ARG1$ -w 35:32
-c 99:36 -l 'Temperature is'
    }

define service {
    use                            generic-service
    host_name                      my-router-1
    service_description            INLET TEMP
    retry_check_interval           3
    contact_groups                 whoever
    check_command                  check_temperature!READCOM1
    }

define service {
    use                            generic-service
    host_name                      my-router-2
    service_description            INLET TEMP
    retry_check_interval           3
    contact_groups                 whoever
    check_command                  check_temperature!READCOM2
    }

Using the above example, $ARG1$ is 'READCOM1' when the service on
'my-router-1' is checked and 'READCOM2' when the same service is checked
on 'my-router-2'. You can pass up to 32 ! separated arguments in this
way ($ARG1$, $ARG2$, ... $ARG32$)

--
Marc


_______________________________________________
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