When we no longer have the (wrong) array, descriptions on interfaces which are not following eachother wee not working anymore.
As snmpd needs a getnext, we need to figure out which one is the next and pass it on. Some extensive changes were needed, updated script on the wiki now.
Tom
On Wed, 2013-02-20 at 11:28 +0100, Tom Laermans wrote:
Got it,
# echo $INTERFACE vlan201@eth2
Stripping from the @ on now :-)
Thanks for the fix!
Tom
On Wed, 2013-02-20 at 11:13 +0100, Tom Laermans wrote:
Hi Daniel,
I've finally been able to take a look at this, it was indeed wrong :-) My description for interface 67 ended up at index 30.
Now with your fix I only have the indexes that are actually there, unfortunately the description doesn't show up anymore even with regular snmpwalk.
I've adjusted the wiki with your fix, will try to figure out what else is up with it.
Tom
On Fri, 2013-01-18 at 07:03 +0100, Daniel Preussker wrote:
Hi,
I came across a design flaw in ifAlias.
First of all the flaw:
declare -a INTERFACES=($(ip l|grep mtu|cut -d: -f2|sed s/\ //g)) ... INTERFACE=$(echo ${INTERFACES[$INDEX]}|cut -d@ -f1)
The Interface INDEX is rarely equal to the indexes of the array. Thus getting all interfaces here is useless, we already get the right Interface ID from SNMPd, so the fix is:
#declare -a INTERFACES=($(ip l|grep mtu|cut -d: -f2|sed s/\ //g)) ... #INTERFACE=$(echo ${INTERFACES[$INDEX]}|cut -d@ -f1) INTERFACE=$((ip l | grep "^${ID}: " | cut -d " " -f 2 | sed 's/://g') 2> /dev/null)
This way, even when tap* respawns with a new INDEX it will still be mapped to the right Description and Alias.
A 2nd bug has been spotted in snmpbulkwalk vs snmpwalk; snmpbulkwalk -QOUs [...] ifAlias leaves out some descriptions but snmpwalk does not, needs further investigation for now I just hacked the snmp.inc.php...
Kind Regards,
Daniel Preussker
[ Security Consultant, Network & Protocol Security and Cryptography [ LPI & Novell Certified Linux Engineer and Researcher [ +49 178 600 96 30 [ Daniel@Preussker.Net [ http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x87E736968E490AA1
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium