Anonymous | Login | 2024-11-22 05:08 EST |
Main | My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||
0000940 | PacketFence | public | 2010-04-01 08:27 | 2011-01-26 15:38 | ||||
Reporter | maikel | |||||||
Assigned To | obilodeau | |||||||
Priority | normal | Severity | tweak | Reproducibility | always | |||
Status | closed | Resolution | fixed | |||||
Platform | OS | OS Version | ||||||
Product Version | 1.8.7 | |||||||
Target Version | Fixed in Version | 1.9.0 | ||||||
Summary | 0000940: Net-snmp 5.4 traps not regonized | |||||||
Description | Parse Trap doesnt recoginize net-snmp 5.4 traps | |||||||
Additional Information | Fix: 451c451,452 < =~ /^\d{4}-\d{2}-\d{2}\|\d{2}:\d{2}:\d{2}\|(?:UDP: \[)?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\]:\d+)?\|([^|]*)\|(.+)$/ --- > #=~ /^\d{4}-\d{2}-\d{2}\|\d{2}:\d{2}:\d{2}\|(?:UDP: \[)?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\]:\d+)?\|([^|]*)\|(.+)$/ > =~ /^\d{4}-\d{2}-\d{2}\|\d{2}:\d{2}:\d{2}\|(?:UDP: \[)?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\]:\d+)\]?\-\>\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]\|([^|]*)\| (.+)$/ 593c594,595 < if ( $trapLine =~ /^\d{4}-\d{2}-\d{2}\|\d{2}:\d{2}:\d{2}\|(?:UDP: \[)?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\]:\d+)?\|([^|]*)\|(.+)$/ ) { --- > # if ( $trapLine =~ /^\d{4}-\d{2}-\d{2}\|\d{2}:\d{2}:\d{2}\|(?:UDP: \[)?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\]:\d+)\]?\|([^|]*)\|(.+)$/ ) { > if ( $trapLine =~ /^\d{4}-\d{2}-\d{2}\|\d{2}:\d{2}:\d{2}\|(?:UDP: \[)?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\]:\d+)\]?\-\>\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]\|([^|]*)\|(.+)$/ ) { | |||||||
Tags | No tags attached. | |||||||
fixed in git revision | ||||||||
fixed in mtn revision | bc2b66c425ad68f2097994016d2348f5db657801 | |||||||
Attached Files | pfsetvlan.patch [^] (1,684 bytes) 2010-04-01 09:34 [Show Content] | |||||||
Notes | |
(0001502) obilodeau (reporter) 2010-04-01 09:25 |
Hi Maikel, Thanks for the finding and letting us know. Can you attach a `diff -u` to the bug instead of in the bug because the wrapping is making this thing harder to read than it should. and don't you think it would be more preferable to change the format in conf/snmptrapd.log instead of the code? |
(0001503) maikel (reporter) 2010-04-01 09:37 |
see the log: 2010-04-01|13:32:16|UDP: [127.0.0.1]:33469->[127.0.0.1]|217.117.225.53|BEGIN TYPE 6 END TYPE BEGIN SUBTYPE .0 END SUBTYPE BEGIN VARIABLEBINDINGS .1.3.6.1.6.3.1.1.4.1.0 = OID: .1.3.6.1.4.1.29464.1.1|.1.3.6.1.2.1.2.2.1.1.5 = INTEGER: 5 END VARIABLEBINDINGS the problem is that net-snmp 5.4 adds an extra ip again Its now like [switch]:port->[destination] The older(CentOS) net-snmp doesnt set the destination ip. So i think its now up to you to see if this new regexp is better, or changing the logformat. |
(0001555) obilodeau (reporter) 2010-05-05 16:53 |
After all, this portion is the result of %b in snmptrapd format so I can't really modify the config, I had to change the regexp like you did. I modified your regexp a little bit since it wasn't working on the old trap format I had here. I also took the opportunity to comment it and avoid code duplication. Here's the end result (not so sure what wrapping will do): my $TRAP_PATTERN = qr/ ^\d{4}-\d{2}-\d{2}\|\d{2}:\d{2}:\d{2}\| # date|time (?:UDP:\ \[)? # Optional "UDP: [" (since v2 traps I think) (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) # network device ip address (?:\]:\d+)? # Optional "]:port" (since v2 traps I think) (?:\-\>\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])? # Optional "->[ip address]" (since net-snmp 5.4) \|([^|]*)\| # Used to carry network device ip if it's a local trap (.+)$ # Trap message /x; This will make upcoming 1.9.0rc1 |
Issue History | |||
Date Modified | Username | Field | Change |
2010-04-01 08:27 | maikel | New Issue | |
2010-04-01 09:19 | obilodeau | Status | new => assigned |
2010-04-01 09:19 | obilodeau | Assigned To | => obilodeau |
2010-04-01 09:25 | obilodeau | Note Added: 0001502 | |
2010-04-01 09:34 | maikel | File Added: pfsetvlan.patch | |
2010-04-01 09:37 | maikel | Note Added: 0001503 | |
2010-05-05 16:53 | obilodeau | mtn revision | => bc2b66c425ad68f2097994016d2348f5db657801 |
2010-05-05 16:53 | obilodeau | Note Added: 0001555 | |
2010-05-05 16:53 | obilodeau | Status | assigned => resolved |
2010-05-05 16:53 | obilodeau | Resolution | open => fixed |
2010-05-05 16:53 | obilodeau | Category | 1.8.7 => regression |
2010-05-05 16:53 | obilodeau | Fixed in Version | => 1.9.0 |
2011-01-26 15:38 | obilodeau | Status | resolved => closed |
Copyright © 2000 - 2012 MantisBT Group |