Search in sources :

Example 41 with SnmpInstId

use of org.opennms.netmgt.snmp.SnmpInstId in project opennms by OpenNMS.

the class InstanceStrategy method getInstanceFromPhysAddr.

public static SnmpInstId getInstanceFromPhysAddr(String physAddr) {
    String[] elm;
    elm = physAddr.split(":");
    if (elm.length != 6) {
        return null;
    }
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < 6; i++) {
        sb.append(".");
        sb.append(Integer.parseInt(elm[i], 16));
    }
    return new SnmpInstId(sb.toString());
}
Also used : SnmpInstId(org.opennms.netmgt.snmp.SnmpInstId) OnmsAccessPoint(org.opennms.netmgt.model.OnmsAccessPoint)

Aggregations

SnmpInstId (org.opennms.netmgt.snmp.SnmpInstId)41 SnmpObjId (org.opennms.netmgt.snmp.SnmpObjId)22 SnmpValue (org.opennms.netmgt.snmp.SnmpValue)21 SnmpAgentConfig (org.opennms.netmgt.snmp.SnmpAgentConfig)16 InetAddress (java.net.InetAddress)15 Map (java.util.Map)13 Test (org.junit.Test)10 PollStatus (org.opennms.netmgt.poller.PollStatus)10 ParameterMap (org.opennms.core.utils.ParameterMap)9 SnmpResult (org.opennms.netmgt.snmp.SnmpResult)9 HashMap (java.util.HashMap)8 ArrayList (java.util.ArrayList)7 ServiceParameters (org.opennms.netmgt.collection.api.ServiceParameters)7 MockDataCollectionConfig (org.opennms.netmgt.mock.MockDataCollectionConfig)6 GenericIndexResource (org.opennms.netmgt.collectd.GenericIndexResource)5 GenericIndexResourceType (org.opennms.netmgt.collectd.GenericIndexResourceType)5 SnmpCollectionAgent (org.opennms.netmgt.collectd.SnmpCollectionAgent)5 SnmpCollectionResource (org.opennms.netmgt.collectd.SnmpCollectionResource)5 AttributeGroupType (org.opennms.netmgt.collection.api.AttributeGroupType)5 MibObject (org.opennms.netmgt.config.datacollection.MibObject)5