Package org.opennms.netmgt.snmp
Class SnmpUtils
- java.lang.Object
-
- org.opennms.netmgt.snmp.SnmpUtils
-
public abstract class SnmpUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description SnmpUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SnmpWalker
createWalker(SnmpAgentConfig agentConfig, java.lang.String name, CollectionTracker tracker)
static SnmpWalker
createWalker(SnmpAgentConfig agentConfig, java.lang.String name, CollectionTracker... trackers)
static SnmpValue
get(SnmpAgentConfig agentConfig, SnmpObjId oid)
static SnmpValue[]
get(SnmpAgentConfig agentConfig, SnmpObjId[] oids)
static java.util.concurrent.CompletableFuture<SnmpValue[]>
getAsync(SnmpAgentConfig agentConfig, SnmpObjId[] oids)
static SnmpValue[]
getBulk(SnmpAgentConfig agentConfig, SnmpObjId[] oids)
static java.util.List<SnmpValue>
getColumns(SnmpAgentConfig agentConfig, java.lang.String name, SnmpObjId oid)
static java.util.Properties
getConfig()
static java.lang.String
getHexString(byte[] raw)
static java.lang.String
getLocalEngineID()
static SnmpValue
getNext(SnmpAgentConfig agentConfig, SnmpObjId oid)
static SnmpValue[]
getNext(SnmpAgentConfig agentConfig, SnmpObjId[] oids)
static java.util.Map<SnmpInstId,SnmpValue>
getOidValues(SnmpAgentConfig agentConfig, java.lang.String name, SnmpObjId oid)
static java.lang.Long
getProtoCounter63Value(byte[] valBytes)
Enable the SNMP code to digest OCTET STRING values acting as proto-Counter64 objects as seen in the FCMGMT-MIB with the following comment:static java.lang.Long
getProtoCounter63Value(SnmpValue value)
static SnmpStrategy
getStrategy()
static java.lang.String
getStrategyClassName()
static StrategyResolver
getStrategyResolver()
static SnmpV1TrapBuilder
getV1TrapBuilder()
static SnmpV2TrapBuilder
getV2InformBuilder()
static SnmpTrapBuilder
getV2TrapBuilder()
static SnmpV3TrapBuilder
getV3InformBuilder()
static SnmpV3TrapBuilder
getV3TrapBuilder()
static SnmpValueFactory
getValueFactory()
static boolean
isClassBasedStrategyInstantiable()
static void
registerForTraps(TrapNotificationListener listener, java.net.InetAddress address, int snmpTrapPort)
static void
registerForTraps(TrapNotificationListener listener, java.net.InetAddress address, int snmpTrapPort, java.util.List<SnmpV3User> snmpUsers)
static SnmpValue[]
set(SnmpAgentConfig agentConfig, SnmpObjId[] oids, SnmpValue[] values)
static SnmpValue
set(SnmpAgentConfig agentConfig, SnmpObjId oid, SnmpValue value)
static void
setConfig(java.util.Properties config)
static void
setStrategyResolver(StrategyResolver strategyResolver)
static void
unregisterForTraps(TrapNotificationListener listener, java.net.InetAddress address, int snmpTrapPort)
static void
unsetStrategyResolver()
-
-
-
Method Detail
-
createWalker
public static SnmpWalker createWalker(SnmpAgentConfig agentConfig, java.lang.String name, CollectionTracker... trackers)
-
createWalker
public static SnmpWalker createWalker(SnmpAgentConfig agentConfig, java.lang.String name, CollectionTracker tracker)
-
get
public static SnmpValue get(SnmpAgentConfig agentConfig, SnmpObjId oid)
-
get
public static SnmpValue[] get(SnmpAgentConfig agentConfig, SnmpObjId[] oids)
-
getAsync
public static java.util.concurrent.CompletableFuture<SnmpValue[]> getAsync(SnmpAgentConfig agentConfig, SnmpObjId[] oids)
-
getNext
public static SnmpValue getNext(SnmpAgentConfig agentConfig, SnmpObjId oid)
-
getNext
public static SnmpValue[] getNext(SnmpAgentConfig agentConfig, SnmpObjId[] oids)
-
getBulk
public static SnmpValue[] getBulk(SnmpAgentConfig agentConfig, SnmpObjId[] oids)
-
set
public static SnmpValue set(SnmpAgentConfig agentConfig, SnmpObjId oid, SnmpValue value)
-
set
public static SnmpValue[] set(SnmpAgentConfig agentConfig, SnmpObjId[] oids, SnmpValue[] values)
-
getConfig
public static java.util.Properties getConfig()
-
getColumns
public static java.util.List<SnmpValue> getColumns(SnmpAgentConfig agentConfig, java.lang.String name, SnmpObjId oid) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
getOidValues
public static java.util.Map<SnmpInstId,SnmpValue> getOidValues(SnmpAgentConfig agentConfig, java.lang.String name, SnmpObjId oid) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
setConfig
public static void setConfig(java.util.Properties config)
-
getStrategy
public static SnmpStrategy getStrategy()
-
isClassBasedStrategyInstantiable
public static boolean isClassBasedStrategyInstantiable()
-
getStrategyResolver
public static StrategyResolver getStrategyResolver()
-
setStrategyResolver
public static void setStrategyResolver(StrategyResolver strategyResolver)
-
unsetStrategyResolver
public static void unsetStrategyResolver()
-
getStrategyClassName
public static java.lang.String getStrategyClassName()
-
registerForTraps
public static void registerForTraps(TrapNotificationListener listener, java.net.InetAddress address, int snmpTrapPort, java.util.List<SnmpV3User> snmpUsers) throws java.io.IOException
- Throws:
java.io.IOException
-
registerForTraps
public static void registerForTraps(TrapNotificationListener listener, java.net.InetAddress address, int snmpTrapPort) throws java.io.IOException
- Throws:
java.io.IOException
-
unregisterForTraps
public static void unregisterForTraps(TrapNotificationListener listener, java.net.InetAddress address, int snmpTrapPort) throws java.io.IOException
- Throws:
java.io.IOException
-
getValueFactory
public static SnmpValueFactory getValueFactory()
-
getV1TrapBuilder
public static SnmpV1TrapBuilder getV1TrapBuilder()
-
getV2TrapBuilder
public static SnmpTrapBuilder getV2TrapBuilder()
-
getV3TrapBuilder
public static SnmpV3TrapBuilder getV3TrapBuilder()
-
getV2InformBuilder
public static SnmpV2TrapBuilder getV2InformBuilder()
-
getV3InformBuilder
public static SnmpV3TrapBuilder getV3InformBuilder()
-
getLocalEngineID
public static java.lang.String getLocalEngineID()
-
getHexString
public static java.lang.String getHexString(byte[] raw)
-
getProtoCounter63Value
public static java.lang.Long getProtoCounter63Value(SnmpValue value)
-
getProtoCounter63Value
public static java.lang.Long getProtoCounter63Value(byte[] valBytes)
Enable the SNMP code to digest OCTET STRING values acting as proto-Counter64 objects as seen in the FCMGMT-MIB with the following comment:
There is one and only one statistics table for each individual port. For all objects in statistics table, if the object is not supported by the conn unit then the high order bit is set to 1 with all other bits set to zero. The high order bit is reserved to indicate if the object if supported or not. All objects start at a value of zero at hardware initialization and continue incrementing till end of 63 bits and then wrap to zero.
- See Also:
- NMS-5423
-
-