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 SnmpWalkercreateWalker(SnmpAgentConfig agentConfig, java.lang.String name, CollectionTracker tracker)static SnmpWalkercreateWalker(SnmpAgentConfig agentConfig, java.lang.String name, CollectionTracker... trackers)static SnmpValueget(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.PropertiesgetConfig()static java.lang.StringgetHexString(byte[] raw)static java.lang.StringgetLocalEngineID()static SnmpValuegetNext(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.LonggetProtoCounter63Value(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.LonggetProtoCounter63Value(SnmpValue value)static SnmpStrategygetStrategy()static java.lang.StringgetStrategyClassName()static StrategyResolvergetStrategyResolver()static SnmpV1TrapBuildergetV1TrapBuilder()static SnmpV2TrapBuildergetV2InformBuilder()static SnmpTrapBuildergetV2TrapBuilder()static SnmpV3TrapBuildergetV3InformBuilder()static SnmpV3TrapBuildergetV3TrapBuilder()static SnmpValueFactorygetValueFactory()static booleanisClassBasedStrategyInstantiable()static voidregisterForTraps(TrapNotificationListener listener, java.net.InetAddress address, int snmpTrapPort)static voidregisterForTraps(TrapNotificationListener listener, java.net.InetAddress address, int snmpTrapPort, java.util.List<SnmpV3User> snmpUsers)static SnmpValue[]set(SnmpAgentConfig agentConfig, SnmpObjId[] oids, SnmpValue[] values)static SnmpValueset(SnmpAgentConfig agentConfig, SnmpObjId oid, SnmpValue value)static voidsetConfig(java.util.Properties config)static voidsetStrategyResolver(StrategyResolver strategyResolver)static voidunregisterForTraps(TrapNotificationListener listener, java.net.InetAddress address, int snmpTrapPort)static voidunsetStrategyResolver()
-
-
-
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
-
-