Distinguish SNMP trap - SNMP

This is a discussion on Distinguish SNMP trap - SNMP ; Hi list, is there a way in order to distinguish an OID trap reading the MIB .my file? Something like TRAP-TYPE or NOTIFICAN-TYPE can be used? Thanks, Embyte -- bash$ ){ :|:&};:...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Distinguish SNMP trap

  1. Distinguish SNMP trap

    Hi list,
    is there a way in order to distinguish an OID trap reading the MIB .my file?
    Something like TRAP-TYPE or NOTIFICAN-TYPE can be used?

    Thanks, Embyte
    --
    bash$ ){ :|:&};:

  2. Re: Distinguish SNMP trap

    HI,

    Would you supply another description and/or more information about
    what you are looking for.

    On Mon, 29 Sep 2003, embyte wrote:
    > Hi list,
    > is there a way in order to distinguish an OID trap reading the MIB .my file?
    > Something like TRAP-TYPE or NOTIFICAN-TYPE can be used?
    >
    > Thanks, Embyte
    > --
    > bash$ ){ :|:&};:
    >

    Regards,
    /david t. perkins


  3. Re: Distinguish SNMP trap

    dperkins@snmpinfo.com wrote:

    > HI,
    >
    > Would you supply another description and/or more information about
    > what you are looking for.


    I need fill up a list in which for every MIB i show available traps.
    For example:
    IF-MIB: linkUp, linkDown
    CISCO-SYSTEM-MIB: authTrap, etc..

    Ok?
    Thanks, Embyte

    --
    /"\ ASCII RIBBON CAMPAIGN AGAINST HTML MAIL
    \ / Member of: ICQ_UIN #48790142
    X S.P.I.N.E. : www.spine-group.org
    / \ BgLug : www.bglug.it
    \ / Rawlab : rawlab.cjb.net
    Use GPG Key : www.madlab.it/pgpkey/embyte.asc


  4. Re: Distinguish SNMP trap

    embyte wrote:

    > I need fill up a list in which for every MIB i show available traps.
    > For example:
    > IF-MIB: linkUp, linkDown
    > CISCO-SYSTEM-MIB: authTrap, etc..


    The command

    $ cd {directory_containing_MIB_files}
    $ grep -E 'NOTIFICATION-TYPE|TYPE-TRAP' * | grep -v ,

    would probably give you most of what you need.
    It'd need a bit of tidying up, but in the Net-SNMP MIB directory,
    that lists the 22 defined traps plus 9 extraneous lines
    (mostly either macro definitions or comments)

    Stripping out lines containing a comma eliminates most
    of the IMPORT entries.

    Dave

  5. Re: Distinguish SNMP trap

    embyte wrote:

    > I need fill up a list in which for every MIB i show available traps.
    > For example:
    > IF-MIB: linkUp, linkDown
    > CISCO-SYSTEM-MIB: authTrap, etc..


    The latest version of the 'identifiers' output format of the smidump
    MIB compiler (only available via CVS right now) can help you:

    $ ./smidump -u -f identifiers -l 0 IF-MIB SNMPv2-MIB | grep notification
    IF-MIB linkDown notification 1.3.6.1.6.3.1.1.5.3
    IF-MIB linkUp notification 1.3.6.1.6.3.1.1.5.4
    SNMPv2-MIB coldStart notification 1.3.6.1.6.3.1.1.5.1
    SNMPv2-MIB warmStart notification 1.3.6.1.6.3.1.1.5.2
    SNMPv2-MIB authenticationFailure notification 1.3.6.1.6.3.1.1.5.5

    With a little bit of AWK or Perl, you can get the list in the format
    you are looking for.

    /js

    --
    Juergen Schoenwaelder International University Bremen
    P.O. Box 750 561, 28725 Bremen, Germany

  6. Re: Distinguish SNMP trap

    In article <1365148.KPgOEAalyv@h4x0r.it>, embyte_NOSPAM_@bglug.it says...

    > I need fill up a list in which for every MIB i show available traps.
    > For example:
    > IF-MIB: linkUp, linkDown
    > CISCO-SYSTEM-MIB: authTrap, etc..


    While this tool is most likely overkill for your needs, for the benefit
    of others who might be curious (or desire the list from IETF MIBs),
    here's a simple MIB Smithy SDK script I just tossed together to do it:

    #!/usr/local/bin/tclsh

    package require SmithySDK

    # don't care about parser messages
    smilib set -logchannel ""

    # Load all the IETF MIBs
    foreach file [glob mibs/IETF/*.mib] {
    smilib import -filename $file
    }

    # Get notifications from all files/modules and assemble into an array
    # for uniqueness sorting. Not strictly necessary; just in case this
    # happened to load multiple versions of the same module.

    foreach {file moduleTrapList} [smilib get -notifications] {
    foreach {module trapList} $moduleTrapList {
    foreach trap $trapList {
    lappend moduleTraps($module) $trap
    }
    }
    }

    # Output the comma-separated list of notifications (sorted alphabetically
    # by module and notification name).

    foreach module [lsort [array names moduleTraps]] {
    set moduleTraps($module) [lsort -unique $moduleTraps($module)]
    set moduleTraps($module) [join $moduleTraps($module) ", "]
    puts "$module: $moduleTraps($module)"
    }
    ## End of script

    % ./listtraps.tcl
    MIB Smithy SDK Copyright (C)2003 Muonics ; All Rights Reserved
    ACCOUNTING-CONTROL-MIB: acctngFileFull, acctngFileNearlyFull
    ADSL-LINE-EXT-MIB: adslAtucFailedFastRThreshTrap, adslAtucSesLThreshTrap,
    adslAtucUasLThreshTrap, adslAturSesLThreshTrap, adslAturUasLThreshTrap
    ADSL-LINE-MIB: adslAtucInitFailureTrap, adslAtucPerfESsThreshTrap,
    adslAtucPerfLofsThreshTrap, adslAtucPerfLolsThreshTrap,
    adslAtucPerfLossThreshTrap, adslAtucPerfLprsThreshTrap,
    adslAtucRateChangeTrap, adslAturPerfESsThreshTrap,
    adslAturPerfLofsThreshTrap, adslAturPerfLossThreshTrap,
    adslAturPerfLprsThreshTrap, adslAturRateChangeTrap
    APPN-MIB: alertTrap
    APPN-TRAP-MIB: appnIsrAccountingDataTrap, appnLocalTgCpCpChangeTrap,
    appnLocalTgOperStateChangeTrap, appnLsOperStateChangeTrap,
    appnPortOperStateChangeTrap, dlurDlusStateChangeTrap
    APS-MIB: apsEventChannelMismatch, apsEventFEPLF, apsEventModeMismatch,
    apsEventPSBF, apsEventSwitchover
    BGP4-MIB: bgpBackwardTransition, bgpEstablished
    BRIDGE-MIB: newRoot, topologyChange
    DIAL-CONTROL-MIB: dialCtlPeerCallInformation, dialCtlPeerCallSetup
    DISMAN-EVENT-MIB: mteEventSetFailure, mteTriggerFailure,
    mteTriggerFalling, mteTriggerFired, mteTriggerRising
    DISMAN-PING-MIB: pingProbeFailed, pingTestCompleted, pingTestFailed
    DISMAN-SCHEDULE-MIB: schedActionFailure
    DISMAN-SCRIPT-MIB: smScriptAbort, smScriptException, smScriptResult
    DISMAN-TRACEROUTE-MIB: traceRoutePathChange, traceRouteTestCompleted,
    traceRouteTestFailed
    DLSW-MIB: dlswTrapCircuitDown, dlswTrapCircuitUp, dlswTrapTConnDown,
    dlswTrapTConnPartnerReject, dlswTrapTConnProtViolation, dlswTrapTConnUp
    DOT12-RPTR-MIB: vgRptrHealth, vgRptrResetEvent
    DS1-MIB: dsx1LineStatusChange
    DS3-MIB: dsx3LineStatusChange
    ENTITY-MIB: entConfigChange
    FR-ATM-PVC-SERVICE-IWF-MIB: frAtmIwfConnStatusChange
    FR-MFR-MIB: mfrMibTrapBundleLinkMismatch
    FRAME-RELAY-DTE-MIB: frDLCIStatusChange
    FRNETSERV-MIB: frPVCConnectStatusChange, frPVCConnectStatusNotif
    GSMP-MIB: gsmpAdjacencyUpdateEvent, gsmpDeadPortEvent,
    gsmpInvalidLabelEvent, gsmpNewPortEvent, gsmpPortDownEvent,
    gsmpPortUpEvent, gsmpReceivedFailureInd, gsmpSentFailureInd,
    gsmpSessionDown, gsmpSessionUp
    HC-ALARM-MIB: hcFallingAlarm, hcRisingAlarm
    HDSL2-SHDSL-LINE-MIB: hdsl2ShdslLocalPowerLoss,
    hdsl2ShdslLoopAttenCrossing, hdsl2ShdslLoopbackFailure,
    hdsl2ShdslPerfCRCanomaliesThresh, hdsl2ShdslPerfESThresh,
    hdsl2ShdslPerfLOSWSThresh, hdsl2ShdslPerfSESThresh,
    hdsl2ShdslPerfUASThresh, hdsl2ShdslSNRMarginCrossing,
    hdsl2ShdslSpanInvalidNumRepeaters, hdsl2ShdslconfigInitFailure,
    hdsl2ShdsldcContinuityFault, hdsl2ShdsldeviceFault,
    hdsl2ShdslnoNeighborPresent, hdsl2ShdslpowerBackoff,
    hdsl2ShdslprotocolInitFailure
    IF-MIB: linkDown, linkUp
    IPATM-IPMC-MIB: marsFaultTrap
    IPOA-MIB: ipoaDuplicateIpAddress, ipoaLisCreate, ipoaLisDelete,
    ipoaMtuExceeded
    IPV6-MIB: ipv6IfStateChange
    ISDN-MIB: isdnMibCallInformation
    L2TP-MIB: l2tpTunnelAuthFailure
    MAU-MIB: ifMauJabberTrap, rpMauJabberTrap
    MIP-MIB: mipAuthFailure
    OSPF-TRAP-MIB: ospfIfAuthFailure, ospfIfConfigError, ospfIfRxBadPacket,
    ospfIfStateChange, ospfLsdbApproachingOverflow, ospfLsdbOverflow,
    ospfMaxAgeLsa, ospfNbrStateChange, ospfOriginateLsa, ospfTxRetransmit,
    ospfVirtIfAuthFailure, ospfVirtIfConfigError, ospfVirtIfRxBadPacket,
    ospfVirtIfStateChange, ospfVirtIfTxRetransmit, ospfVirtNbrStateChange
    PIM-MIB: pimNeighborLoss
    PTOPO-MIB: ptopoConfigChange
    Printer-MIB: printerV2Alert
    RDBMS-MIB: rdbmsOutOfSpace, rdbmsStateChange
    RFC1269-MIB: bgpBackwardTransition, bgpEstablished
    RFC1286-MIB: newRoot, topologyChange
    RFC1315-MIB: frDLCIStatusChange
    RFC1382-MIB: x25Reset, x25Restart
    RMON-MIB: fallingAlarm, risingAlarm
    RSVP-MIB: lostFlow, newFlow
    SLAPM-MIB: slapmMonitoredEventNotAchieved, slapmMonitoredEventOkay,
    slapmPolicyMonitorDeleted, slapmPolicyProfileDeleted,
    slapmPolicyRuleDeleted, slapmPolicyRuleMonDeleted,
    slapmPolicyRuleMonNotOkay, slapmPolicyRuleMonOkay,
    slapmSubcMonitorNotOkay, slapmSubcMonitorOkay,
    slapmSubcomponentMonitoredEventNotAchieved,
    slapmSubcomponentMonitoredEventOkay
    SNA-NAU-MIB: snaLuSessnBindFailTrap, snaLuStateChangeTrap,
    snaNodeActFailTrap, snaNodeStateChangeTrap
    SNA-SDLC-MIB: sdlcLSStatusChange, sdlcPortStatusChange
    SNMP-REPEATER-MIB: rptrGroupChange, rptrHealth, rptrInfoHealth,
    rptrInfoResetEvent, rptrResetEvent
    SNMPv2-M2M-MIB: snmpFallingAlarm, snmpObjectUnavailableAlarm,
    snmpRisingAlarm
    SNMPv2-MIB: authenticationFailure, coldStart, warmStart
    TN3270E-RT-MIB: tn3270eRtCollEnd, tn3270eRtCollStart, tn3270eRtExceeded,
    tn3270eRtOkay
    UPS-MIB: upsTrapAlarmEntryAdded, upsTrapAlarmEntryRemoved,
    upsTrapOnBattery, upsTrapTestCompleted
    VRRP-MIB: vrrpTrapAuthFailure, vrrpTrapNewMaster

    --
    Michael Kirkham
    Muonics
    http://www.muonics.com/

  7. Re: Distinguish SNMP trap

    embyte wrote:

    >I need fill up a list in which for every MIB i show available traps.
    >For example:
    >IF-MIB: linkUp, linkDown
    >CISCO-SYSTEM-MIB: authTrap, etc..
    >
    >
    >

    Hi,

    I could not resist to post a script for MIB Explorer too,
    because Michael Kirkham posted his for MIB Smithy ;-)

    Here is the MIB Explorer/Velocity (http://www.apache.org)
    template for listing trap/notification names and their OIDs
    (see output below):

    ##BEGIN OF SCRIPT
    #macro ( loadMIB $m )
    #set ($OK = $mib.loadModule($m) )
    #if (!$OK)
    FAILED to load MIB module $m, aborting $utils.stop()
    #end
    #end
    ## end loadMIBs
    #*
    MAIN
    *#
    #foreach ($moduleName in $mib.moduleNamesInRepository)
    #loadMIB($moduleName)
    #set( $module = $mib.getModule($moduleName) )
    ${module.moduleName}:
    #foreach ($object in $module.objectsOrderedByOccurance())
    #if (($object.typeString == "NOTIFICATION-TYPE") || ($object.typeString
    == "TRAP-TYPE"))
    ${object.name}[$object.oid]
    #end
    #end
    #set($supressedOuput = $mib.unloadModule($moduleName))
    #end
    ## END OF SCRIPT

    Output of the above script for most MIBs available
    from http://www.mibdepot.com can be found here (because of its 250K size):
    http://www.mibexplorer.com/notification_list.txt

    Regards,
    Frank Fock


+ Reply to Thread