Configuring snmp ip for the hosts

Joan aseques at gmail.com
Fri Oct 1 12:52:38 CEST 2010


Hi, I've just migrated from nagios2 to nagios3, basically for the
custom macro feature.
In my network I've two kind of servers:
.- Single ip server (the same ip is used both for services and snmp server)
.- Dual ip server (public ip for the services and private ip for the
snmp server)

What I try to do is set a default value to the macro $_HOSTIPSNMP$ in
the host template ..

define host {
        name linux-server
        ...
        _IPSNMP                 $HOSTADDRESS$
        ...
}

I assumed that all the hosts automatically would set $_HOSTIPSNMP$
with the content of $HOSTADDRESS$

If I can get this working, the second part would be to set on a
per-host basis custom values for $_HOSTIPSNMP$, in the style of:

define host {
        use linux-server
        address           123.123.123.123
        _IPSNMP        192.168.1.10
}

So $_HOSTIPSNMP$ has always a sane value and I can set it to whatever
I want whenever I need.


The error I'm facing is this, it seems that the _HOSTIPSNMP doesn't
get replaced properly for the variable value, but instead it gets
replaced for the variable name.

cmd=[/usr/lib/nagios/plugins/check_snmp_storage.pl '-H' 'HOSTADDRESS'
'-C' 'comunity' '-m' '/' '-w' '80%' '-c' '85%']
output=[ERROR: Unable to resolve UDP/IPv4 address 'HOSTADDRESS'.

I tried changing the quoting of $HOSTADDRESS$ in the template, but
nothing I tried worked.

Thanks for your help.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
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