-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve update-l2database.pl #47
Improve update-l2database.pl #47
Conversation
@nickhilliard - this one's for you (thanks to your superior Perl foo!). Please note:
|
By the way: the snmp "bug" (not translating the output to hex if it decides the packed-string MAC looks like valid ASCII) also applies to the cli snmp tools and to all the language bindings I've seen - including PHP. So there needs to be an equivalent fix/workaround in the PHP controller which snmp-queries the switch in realtime. I haven't zeroed-in on location of that code yet. Also, it's not exactly an snmptools bug, more of a documentation-bug due to it being a nasty gotcha with almost no text explaining that this can happen when the heuristics occasionally misfire. With lower-level lib-interfaces it is possible to pass a parameter to force the output format to "translated-to-hex" from the outset (rather than deciding heuristically), but this perl script uses a more high-level wrapping library which doesn't pass the necessary parameters for that, so I just added a "normalize" function after the fact instead. I think I remember seeing that the used PHP libs can pass those parameters, so they should be able to do the workaround in a less circuitous manner. For the past month one of the "macaddresses" I've been looking at (on commandline and in IXP-Manager's interface) has looked like this |
(I just added a commit to add the models mentioned by @barryo to the comments) |
Is there anything I can/must do to make this PR (more) acceptable? It doesn't make any very invasive changes, but makes one absolutely vital fix (for those unfortunate enough to have a switch with a MAC in the doomed range). Before applying this I was unable to get graphs or anything because they were all borking on the garbage value. Also, I am still not sure whether an equivalent fix is needed for the php snmp calls, but I remember before this fix I was still receiving garbage values even when probing from within the interface (i.e. via php). Strangely now with this PR applied on my fork it apparently has no problem via perl or php (even though I only patched the perl). |
* add & use adapted version of Net::SNMP::Mixin::Util::normalize_mac() (needed because one stray MAC was outputing as ASCII, untranslated) * delete old copy of update-l2database.pl from sflow directory * copy comment about testing status on switches from old sflow version, and add Extreme BD-8806 to list * apply $do_nothing to *all* DB-affecting actions * improve debug output layout and increase output * replace a printf occurrence with print * standardise whitespace
For me, it seems update-l2database.pl doesn't work with Dell Force10 S4810 Switches |
@bcix Does it not work even with this PR applied? Or does it not work in its present state? It didn't work for me (with an Extreme switch) because of the heuristic translation problem until I applied this normalisation change. The OCTET_STRING representation of the MACs of some switch models fall in a range where the first bytes can be treated as valid ASCII, so the heuristics make a wrong guess and they get turned into weird short strings. If memory serves, running update-l2database.pl manually (having edited it so $debug = 1) should show if any of the returned MACs are being converted in this way. |
@rowanthorpe I just use your latest version and I still only see the MACs from my Brocade BigIron RX, but not from the Force10 S4810 in the IXP-Manager frontend. With your $debug =1 I'll see "undef" for my force10 switches: ./tools/runtime/l2database/update-l2database_2.pl $l2mapping = { |
@bcix I posted this pull request two months ago and now my memory is a bit hazy about the sequence of problems I encountered, but I think I also hit a few "undefs" along the way. When you say "my latest version" - do you mean you pulled the "update-l2database-fixes" branch from my fork (which this PR references)? I am not a part of the project, I just submit PRs as I hit bugs myself :-) Although @nickhilliard is probably the one to answer authoritatively about it, I suspect your problem may not be related to this PR - possibly something like firewalling?, SNMP "permissions"? (I struck all of those problems too...). |
@rowanthorpe I was leaving the PR to @nickhilliard but I may review it myself soon if he doesn't. @bcix Hi Thorlief and welcome to the project! Can you post the snmpwalk output of the following OIDs for us?
Probably best to post it in a Gist ( https://gist.github.com/ ). |
@barryo here we go with the SNMP OID output https://gist.github.com/bcix/6592380 @rowanthorpe No SNMP-Permission problem, connection is working. |
@rowanthorpe i mis-read the patch slightly on day one and decided that it needed a little work, but having gone through it carefully it's actually fine and I'll commit as-is. @bcix re: https://gist.github.com/bcix/6592380, oh dear. This patch won't fix that problem. Can you take the problem to ixpmanager@inex.ie and we can discuss it there because I'm going to close this pull request. |
Improve update-l2database.pl
@bcix well there's the problem.
We may not necessarily be using the best possible OIDs (although they work fine on Brocade, Cisco and Extreme at least). I look into this further, I'd need a complete SNMP dump ( |
I too am running into the same issue where using a Juniper switch. Brian Thompson Direct: 503.943.6779 On Tue, Sep 17, 2013 at 3:22 AM, barryo notifications@github.com wrote:
|
Hi Brian, We pushed this discussion to the mailing list. Archives: https://www.inex.ie/pipermail/ixpmanager/2013-September/thread.html Can you check of any of the posts help and take it up there? |
Hi Barry, I read through the archive, I am sorry I am not sure how to join that conversation. I also can: And did verify, those are the correct mac addresses with the INTEGER being the interface index. Unfortunately this coding is above my head. I am using a Juniper EX4500. Any help would be greatly appreciated. Our exchange is going through big changes for the better. www.nwax.net Cheers, |
See "Subscribing to ixpmanager" on https://www.inex.ie/mailman/listinfo/ixpmanager Nick is taking a look at the code soon for Thorlief in BCIX (same issue as you) so hopefully we'll have something soon. |
(needed because one stray MAC was outputing as ASCII, untranslated)
and add Extreme BD-8806 to list