From: <dba...@us...> - 2009-11-02 06:51:27
|
Revision: 158 http://devmon.svn.sourceforge.net/devmon/?rev=158&view=rev Author: dbaldwin Date: 2009-11-02 06:50:45 +0000 (Mon, 02 Nov 2009) Log Message: ----------- Add option on DEVMON tag line to specify custom IP address using ip() Very handy for devices with multiple interfaces which choose a different source IP address for their SNMP reply packets than the primary IP in bb-hosts definitions. e.g. (from bb-hosts file) 10.0.0.11 multihomehost # conn=worst,10.0.0.12 DEVMON:ip(10.0.0.12) Modified Paths: -------------- trunk/docs/USING trunk/modules/dm_config.pm Modified: trunk/docs/USING =================================================================== --- trunk/docs/USING 2009-10-27 07:32:42 UTC (rev 157) +++ trunk/docs/USING 2009-11-02 06:50:45 UTC (rev 158) @@ -45,6 +45,10 @@ other than the ones specified in the SNMPCIDS variable in the devmon.cfg file + ip() : Define a custom IP address for this device + (other than the primary address in bb-hosts - + useful for hosts with multiple interfaces) + port() : Define a custom UDP SNMP port for this device (other than the default port of 161) @@ -107,6 +111,18 @@ + ip() + + If, for some reason, the device you are attempting to poll does + not answer on the primary IP address in bb-hosts, you can define + a custom IP address to query the device with - for UDP protocols + like SNMP the source address in the reply packet may not match + the address in the bb-hosts file: + +10.0.0.10 multihomehost # conn=worst,10.0.0.11 DEVMON:ip(10.0.0.11) + + + port() If, for some reason, the device you are attempting to poll does Modified: trunk/modules/dm_config.pm =================================================================== --- trunk/modules/dm_config.pm 2009-10-27 07:32:42 UTC (rev 157) +++ trunk/modules/dm_config.pm 2009-11-02 06:50:45 UTC (rev 158) @@ -1329,6 +1329,11 @@ $bb_hosts{$host}{'cid'} = $1; $custom_cids = 1; } + + # See if we have a custom IP + if($options =~ s/(?:,|^)ip\((\d+\.\d+\.\d+\.\d+)\),?//) { + $ip = $1; + } # See if we have a custom port if($options =~ s/(?:,|^)port\((\d+?)\),?//) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |