PacketFence - BTS - PacketFence
View Issue Details
0001868PacketFenceconfigurationpublic2015-02-17 22:472015-02-18 10:24
ah27 
jsemaan.inverse 
normalfeaturealways
assignedopen 
LinuxRHEL / CentOS6
4.5.0 
 
0001868: Netgear M Series module does not handle up/down SNMP traps
There is no handling of up/down traps on the Netgear M Series module.

When it receives the trap, the following is written to the log:

Feb 17 19:33:29 pfsetvlan(12) WARN: SNMP trap handling not implemented for this type of switch. (pf::Switch::parseTrap)
Feb 17 19:33:29 pfsetvlan(12) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 670.
 (main::parseTrap)
Feb 17 19:33:29 pfsetvlan(12) ERROR: Use of uninitialized value $trapType in string ne at /usr/local/pf/sbin/pfsetvlan line 678.
 (main::parseTrap)
Feb 17 19:33:29 pfsetvlan(12) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 689.
 (main::parseTrap)
Feb 17 19:33:29 pfsetvlan(12) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 698.
 (main::parseTrap)
Feb 17 19:33:29 pfsetvlan(12) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 703.
 (main::parseTrap)
Feb 17 19:33:29 pfsetvlan(12) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 703.
 (main::parseTrap)
Feb 17 19:33:29 pfsetvlan(12) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 709.
 (main::parseTrap)
Feb 17 19:33:29 pfsetvlan(12) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 713.
 (main::parseTrap)
Feb 17 19:33:29 pfsetvlan(12) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 716.
 (main::parseTrap)
Feb 17 19:33:29 pfsetvlan(12) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 719.
 (main::parseTrap)
Feb 17 19:33:29 pfsetvlan(12) ERROR: Use of uninitialized value $switch_port in concatenation (.) or string at /usr/local/pf/sbin/pfsetvlan line 729.
 (main::parseTrap)
Feb 17 19:33:29 pfsetvlan(12) ERROR: Use of uninitialized value $trapType in concatenation (.) or string at /usr/local/pf/sbin/pfsetvlan line 729.
 (main::parseTrap)
Feb 17 19:33:29 pfsetvlan(1) WARN: unable to parse trapLine.. here's the line: 10.100.6.30||||||||| (main::startTrapHandlers)
Feb 17 19:33:29 pfsetvlan(1) INFO: nb of items in queue: 1; nb of threads running: 0 (main::startTrapHandlers)
Feb 17 19:33:29 pfsetvlan(1) ERROR: Use of uninitialized value $ifType in numeric eq (==) at /usr/local/pf/lib/pf/vlan.pm line 138.
 (pf::vlan::doWeActOnThisTrap)
Feb 17 19:33:29 pfsetvlan(1) ERROR: Use of uninitialized value $ifType in numeric eq (==) at /usr/local/pf/lib/pf/vlan.pm line 138.
 (pf::vlan::doWeActOnThisTrap)
Feb 17 19:33:29 pfsetvlan(1) INFO: trap received on (10.100.6.30) ifindex which is not ethernetCsmacd (pf::vlan::doWeActOnThisTrap)
Feb 17 19:33:29 pfsetvlan(1) INFO: doWeActOnThisTrap returns false. Stop handling (main::handleTrap)
Feb 17 19:33:29 pfsetvlan(1) INFO: finished (main::cleanupAfterThread)
Feb 17 19:33:39 pfsetvlan(13) WARN: SNMP trap handling not implemented for this type of switch. (pf::Switch::parseTrap)
Feb 17 19:33:39 pfsetvlan(13) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 670.
 (main::parseTrap)
Feb 17 19:33:39 pfsetvlan(13) ERROR: Use of uninitialized value $trapType in string ne at /usr/local/pf/sbin/pfsetvlan line 678.
 (main::parseTrap)
Feb 17 19:33:39 pfsetvlan(13) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 689.
 (main::parseTrap)
Feb 17 19:33:39 pfsetvlan(13) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 698.
 (main::parseTrap)
Feb 17 19:33:39 pfsetvlan(13) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 703.
 (main::parseTrap)
Feb 17 19:33:39 pfsetvlan(13) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 703.
 (main::parseTrap)
Feb 17 19:33:39 pfsetvlan(13) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 709.
 (main::parseTrap)
Feb 17 19:33:39 pfsetvlan(13) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 713.
 (main::parseTrap)
Feb 17 19:33:39 pfsetvlan(13) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 716.
 (main::parseTrap)
Feb 17 19:33:39 pfsetvlan(13) ERROR: Use of uninitialized value $trapType in string eq at /usr/local/pf/sbin/pfsetvlan line 719.
 (main::parseTrap)
Feb 17 19:33:39 pfsetvlan(13) ERROR: Use of uninitialized value $switch_port in concatenation (.) or string at /usr/local/pf/sbin/pfsetvlan line 729.
 (main::parseTrap)
Feb 17 19:33:39 pfsetvlan(13) ERROR: Use of uninitialized value $trapType in concatenation (.) or string at /usr/local/pf/sbin/pfsetvlan line 729.
 (main::parseTrap)
Feb 17 19:33:39 pfsetvlan(3) WARN: unable to parse trapLine.. here's the line: 10.100.6.30||||||||| (main::startTrapHandlers)
Feb 17 19:33:39 pfsetvlan(3) INFO: nb of items in queue: 1; nb of threads running: 0 (main::startTrapHandlers)
Feb 17 19:33:39 pfsetvlan(3) ERROR: Use of uninitialized value $ifType in numeric eq (==) at /usr/local/pf/lib/pf/vlan.pm line 138.
 (pf::vlan::doWeActOnThisTrap)
Feb 17 19:33:39 pfsetvlan(3) ERROR: Use of uninitialized value $ifType in numeric eq (==) at /usr/local/pf/lib/pf/vlan.pm line 138.
 (pf::vlan::doWeActOnThisTrap)
Feb 17 19:33:39 pfsetvlan(3) INFO: trap received on (10.100.6.30) ifindex which is not ethernetCsmacd (pf::vlan::doWeActOnThisTrap)
Feb 17 19:33:39 pfsetvlan(3) INFO: doWeActOnThisTrap returns false. Stop handling (main::handleTrap)
Feb 17 19:33:39 pfsetvlan(3) INFO: finished (main::cleanupAfterThread)

For reference, here is the up trap it received:

2015-02-17|03:41:46|UDP: [10.100.6.30]:33669->[10.100.16.108]|0.0.0.0|BEGIN TYPE 0 END TYPE BEGIN SUBTYPE 0 END SUBTYPE BEGIN VARIABLEBINDINGS .1.3.6.1.2.1.1.3.0 = Timeticks: (661683) 1:50:16.83|.1.3.6.1.6.3.1.1.4.1.0 = OID: .1.3.6.1.6.3.1.1.5.4|.1.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1|.1.3.6.1.2.1.2.2.1.7.1 = INTEGER: up(1)|.1.3.6.1.2.1.2.2.1.8.1 = INTEGER: up(1) END VARIABLEBINDINGS

and the down trap:

2015-02-17|03:42:30|UDP: [10.100.6.30]:33669->[10.100.16.108]|0.0.0.0|BEGIN TYPE 0 END TYPE BEGIN SUBTYPE 0 END SUBTYPE BEGIN VARIABLEBINDINGS .1.3.6.1.2.1.1.3.0 = Timeticks: (666103) 1:51:01.03|.1.3.6.1.6.3.1.1.4.1.0 = OID: .1.3.6.1.6.3.1.1.5.3|.1.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1|.1.3.6.1.2.1.2.2.1.7.1 = INTEGER: up(1)|.1.3.6.1.2.1.2.2.1.8.1 = INTEGER: down(2) END VARIABLEBINDINGS

These were both when working on port 1
-Enable link up/down traps on switch
-Plug/unplug device from port
This is also affecting the ability to use the location log and delete old devices on M-Series devices never close out the line for locations and show offline.

I've attached an image of what the location log looks like for this in the web interface.
No tags attached.
jpg locationlog.jpg (62,948) 2015-02-17 22:47
https://www.packetfence.org/bugs/file_download.php?file_id=221&type=bug
jpg
Issue History
2015-02-17 22:47ah27New Issue
2015-02-17 22:47ah27File Added: locationlog.jpg
2015-02-18 07:52jsemaan.inverseAssigned To => jsemaan.inverse
2015-02-18 07:52jsemaan.inverseStatusnew => assigned
2015-02-18 10:24fdurandNote Added: 0003845
2015-02-18 10:24fdurandNote Edited: 0003845bug_revision_view_page.php?bugnote_id=3845#r19

Notes
(0003845)
fdurand   
2015-02-18 10:24   
Hello,

can you add:

=item parseTrap

=cut

sub parseTrap {
    my ( $this, $trapString ) = @_;
    my $logger = Log::Log4perl::get_logger(__PACKAGE__);

    my $trapHashRef;

    # link up/down traps
    if ( $trapString =~
            /BEGIN\ VARIABLEBINDINGS\ [^|]+[|]\.
            1\.3\.6\.1\.6\.3\.1\.1\.4\.1\.0 # SNMP notification
            \ =\ OID:\ \.
            1\.3\.6\.1\.6\.3\.1\.1\.5\.([34]) # link UP(4) DOWN(3) trap
            \|\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]+) # ifIndex
            /x ) {
        $trapHashRef->{'trapType'} = ( ( $1 == 3 ) ? "down" : "up" );
        $trapHashRef->{'trapIfIndex'} = $2;
    }
    # unhandled traps
    else {
        $logger->debug("trap currently not handled");
        $trapHashRef->{'trapType'} = 'unknown';
    }

    return $trapHashRef;
}

in /usr/local/pf/lib/pf/Switch/Netgear/MSeries.pm

and restart pfsetvlan ?
Regards
Fabrice