[Ddclient-support] IP address query through SNMP
Brought to you by:
supersandro2000,
wimpunk
From: Detlef G. <dgt...@ya...> - 2009-04-26 14:58:23
|
Hello, maybe it would be a nice feature if ddclient would support getting the IP address with SNMP from the device. I think this is a generic way to get the IP address. Most devices which are SNMP capable are then supported. This feature works of course with the external command (use=cmd). With the following command you "walk" through the interface table: snmpwalk -v 1 -c public 192.168.1.1 IP-MIB::ipAdEntIfIndex IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1 IP-MIB::ipAdEntIfIndex.192.168.1.1 = INTEGER: 2 IP-MIB::ipAdEntIfIndex.217.xx.y.z = INTEGER: 3 The loopback devices and rfc1918 adresses must be discarded. In most cases the remaining IP address is the one which is needed. The Net::SNMP package ist needed if this query is done with Perl. With best regards, Detlef Graef |