Search in sources :

Example 1 with SnmpTrapType

use of net.percederberg.mibble.snmp.SnmpTrapType in project opennms by OpenNMS.

the class Mib2Events method convertMibToEvents.

public Events convertMibToEvents(Mib mib, String ueibase) {
    Events events = new Events();
    for (MibSymbol sym : getAllSymbolsFromMib(mib)) {
        if (!(sym instanceof MibValueSymbol)) {
            continue;
        }
        MibValueSymbol vsym = (MibValueSymbol) sym;
        if ((!(vsym.getType() instanceof SnmpNotificationType)) && (!(vsym.getType() instanceof SnmpTrapType))) {
            continue;
        }
        events.addEvent(getTrapEvent(vsym, ueibase));
    }
    return events;
}
Also used : SnmpTrapType(net.percederberg.mibble.snmp.SnmpTrapType) Events(org.opennms.netmgt.xml.eventconf.Events) MibValueSymbol(net.percederberg.mibble.MibValueSymbol) SnmpNotificationType(net.percederberg.mibble.snmp.SnmpNotificationType) MibSymbol(net.percederberg.mibble.MibSymbol)

Aggregations

MibSymbol (net.percederberg.mibble.MibSymbol)1 MibValueSymbol (net.percederberg.mibble.MibValueSymbol)1 SnmpNotificationType (net.percederberg.mibble.snmp.SnmpNotificationType)1 SnmpTrapType (net.percederberg.mibble.snmp.SnmpTrapType)1 Events (org.opennms.netmgt.xml.eventconf.Events)1