Package com.santaba.agent.groovyapi.snmp
Class Snmp
- java.lang.Object
-
- com.santaba.agent.groovyapi.snmp.Snmp
-
public class Snmp extends java.lang.Object
This classSnmp
is provided for SNMP related operations.
The most common operations are:
- get an oid value
- walk an oid
Sometimes, the host related hostProps will be used automatically to extract snmp related properties:property name property note snmp.version indicate the snmp version for this host. support v1/v2c/v3 snmp.community indicate the snmp community for this host snmp.security indicate the snmp security for this host. This is only working when snmp.version is v3 snmp.auth indicate the authentication protocol for this host. support MD5/SHA256. This is only working when snmp.version is v3 snmp.authToken indicate the authentication phrase/token for this host. This is only working when snmp.version is v3 snmp.priv indicate the privacy protocol for this host. support ""/aes/3des/des/aes128/aes192/aes256. This is only working when snmp.version is v3 snmp.privToken indicate the privacy phrase/token for this host. This is only working when snmp.version is v3 snmp.port indicate the snmp port number for this host. default is 161. snmp.contextName indicate the context name for this host. This is only working when snmp.version is v3 snmp.contextEngineId indicate the context engine id for this host. This is only working when snmp.version is v3
Example in groovy:
1. get the system description by get operation:import com.santaba.agent.groovyapi.snmp.Snmp println Snmp.get("192.168.170.149", "1.3.6.1.2.1.1.1.0"); // Output: // Linux centosvm64 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64
2. get the network interfaces list by walk operation (return a string):import com.santaba.agent.groovyapi.snmp.Snmp println Snmp.walk("192.168.170.149", "1.3.6.1.2.1.2.2.1.2"); // Output: // The output of the walk operation will be multiple lines and each line like fullOid = oidValue. // 1.3.6.1.2.1.2.2.1.2.1 = lo // 1.3.6.1.2.1.2.2.1.2.2 = eth0 // 1.3.6.1.2.1.2.2.1.2.3 = pan0
3. get the network interfaces list by walk operation (return a map):import com.santaba.agent.groovyapi.snmp.Snmp Map<String, String> result = Snmp.walkAsMap("192.168.170.149", "1.3.6.1.2.1.2.2.1.2", null) result.forEach({index,value->println(index + " = " + value)}) // Output: // The output of the walk operation will be multiple lines and each line like oidIndex = oidValue. // 1 = lo // 2 = eth0 // 3 = pan0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
get(java.lang.String host, java.lang.String oid)
get an OID from a host by v1/v2c/v3.
the snmp related authentication information will be extracted from hostProps.
This will auto extract the snmp version from hostProps.static java.lang.String
get(java.lang.String host, java.lang.String oid, int pduTimeoutInMs)
get an OID from a host by v1/v2c/v3.
the snmp related authentication information will be extracted from hostProps.
This will auto extract the snmp version from hostProps.static java.lang.String
get(java.lang.String host, java.lang.String community, java.lang.String version, java.lang.String oid)
get an OID from a host by v1/v2c.
This api CAN'T be used to snmp v3 requests.static java.lang.String
get(java.lang.String host, java.lang.String community, java.lang.String version, java.lang.String oid, int timeoutInMillis)
get an OID from a host by v1/v2c.static java.lang.String
get(java.lang.String host, java.lang.String community, java.lang.String version, java.lang.String oid, int timeoutInMillis, int port)
get an OID from a host by v1/v2c.static java.lang.String
get(java.lang.String host, java.lang.String oid, java.util.Map<java.lang.String,java.lang.String> params)
get an OID from a host by v1/v2c/v3.
This provides another argument params to override the properties in the hostProps.
We will try to extract related informations from params first, if not found, try from hostProps.
This should be used only when the hostProps of the host is wrong.static java.lang.String
get(java.lang.String host, java.lang.String oid, java.util.Map<java.lang.String,java.lang.String> params, int timeoutInMs)
get an OID from a host by v1/v2c/v3.
This provides another argument params to override the properties in the hostProps.
We will try to extract related informations from params first, if not found, try from hostProps
This should be used only when the hostProps of the host is wrong.static java.lang.String
getV3(java.lang.String host, java.lang.String securityName, java.lang.String oid)
get an OID from a host by v3.static java.lang.String
getV3(java.lang.String host, java.lang.String securityName, java.lang.String oid, int timeoutInMs)
get an OID from a host by v3.static java.lang.String
getV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String oid)
get an OID from a host by v3.static java.lang.String
getV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String oid, int timeoutInMs)
get an OID from a host by v3.static java.lang.String
getV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid)
get an OID from a host by v3.static java.lang.String
getV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid, int timeoutInMs)
get an OID from a host by v3.static java.lang.String
getV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid, int timeoutInMs, int port)
get an OID from a host by v3.static java.lang.String
getV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid, int timeoutInMs, int port, java.lang.String contextName, java.lang.String contextEngineId)
get an OID from a host by v3.static java.lang.String
walk(java.lang.String host, java.lang.String oid)
walk an OID from a host by v1/v2c/v3.
the snmp related authentication information will be extracted from hostProps.
This will auto extract the snmp version from hostProps.static java.lang.String
walk(java.lang.String host, java.lang.String oid, int walkTimeoutInMs)
walk an OID from a host by v1/v2c/v3.
the snmp related authentication information will be extracted from hostProps.
This will auto extract the snmp version from hostProps.static java.lang.String
walk(java.lang.String host, java.lang.String community, java.lang.String version, java.lang.String oid)
walk an OID from a host by v1/v2c.
This api CAN'T be used to snmp v3 requests.static java.lang.String
walk(java.lang.String host, java.lang.String community, java.lang.String version, java.lang.String oid, int walkTimeoutInMs)
walk an OID from a host by v1/v2c.
This api CAN'T be used to snmp v3 requests.static java.lang.String
walk(java.lang.String host, java.lang.String community, java.lang.String version, java.lang.String oid, int walkTimeoutInMs, int port)
walk an OID from a host by v1/v2c.
This api CAN'T be used to snmp v3 requests.static java.lang.String
walk(java.lang.String host, java.lang.String oid, java.util.Map<java.lang.String,java.lang.String> params)
walk an OID from a host by v1/v2c/v3.
This provides another argument params to override the properties in the hostProps.
We will try to extract related informations from params first, if not found, try from hostProps.
This should be used only when the hostProps of the host is wrong.static java.lang.String
walk(java.lang.String host, java.lang.String oid, java.util.Map<java.lang.String,java.lang.String> params, int timeoutInMs)
walk an OID from a host by v1/v2c/v3.
This provides another argument params to override the properties in the hostProps.
We will try to extract related informations from params first, if not found, try from hostProps.
This should be used only when the hostProps of the host is wrong.static java.util.Map<java.lang.String,java.lang.String>
walkAsMap(java.lang.String host, java.lang.String oid, java.util.Map<java.lang.String,java.lang.String> params)
walk an OID from a host by v1/v2c/v3.
This provides another argument params to override the properties in the hostProps.
We will try to extract related informations from params first, if not found, try from hostProps.
This should be used only when the hostProps of the host is wrong.static java.util.Map<java.lang.String,java.lang.String>
walkAsMap(java.lang.String host, java.lang.String oid, java.util.Map<java.lang.String,java.lang.String> params, int timeoutInMs)
walk an OID from a host by v1/v2c/v3.
This provides another argument params to override the properties in the hostProps.
We will try to extract related informations from params first, if not found, try from hostProps.
This should be used only when the hostProps of the host is wrong.static java.lang.String
walkV3(java.lang.String host, java.lang.String securityName, java.lang.String oid)
walk an OID from a host by v3.
The hostProps will NOT be used.static java.lang.String
walkV3(java.lang.String host, java.lang.String securityName, java.lang.String oid, int walkTimeoutInMs)
walk an OID from a host by v3.
The hostProps will NOT be used.static java.lang.String
walkV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String oid)
walk an OID from a host by v3.
The hostProps will NOT be used.static java.lang.String
walkV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String oid, int timeoutInMs)
walk an OID from a host by v3.
The hostProps will NOT be used.static java.lang.String
walkV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid)
walk an OID from a host by v3.
The hostProps will NOT be used.static java.lang.String
walkV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid, int walkTimeoutInMs)
walk an OID from a host by v3.
The hostProps will NOT be used.static java.lang.String
walkV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid, int walkTimeoutInMs, int port)
walk an OID from a host by v3.
The hostProps will NOT be used.static java.lang.String
walkV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid, int walkTimeoutInMs, int port, java.lang.String contextName, java.lang.String contextEngineId)
walk an OID from a host by v3.
The hostProps will NOT be used.
-
-
-
Method Detail
-
get
public static java.lang.String get(java.lang.String host, java.lang.String oid) throws java.io.IOException
get an OID from a host by v1/v2c/v3.
the snmp related authentication information will be extracted from hostProps.
This will auto extract the snmp version from hostProps.- Parameters:
host
- the hostoid
- the oid- Returns:
- the value of this oid
- Throws:
java.io.IOException
- failed to get this oid
-
get
public static java.lang.String get(java.lang.String host, java.lang.String oid, int pduTimeoutInMs) throws java.io.IOException
get an OID from a host by v1/v2c/v3.
the snmp related authentication information will be extracted from hostProps.
This will auto extract the snmp version from hostProps.- Parameters:
host
- the hostoid
- the oidpduTimeoutInMs
- the timeout in mill seconds for pdu timeout, this is the PDU timeout- Returns:
- the value of this oid
- Throws:
java.io.IOException
- failed to get this oid
-
get
public static java.lang.String get(java.lang.String host, java.lang.String oid, java.util.Map<java.lang.String,java.lang.String> params) throws java.io.IOException
get an OID from a host by v1/v2c/v3.
This provides another argument params to override the properties in the hostProps.
We will try to extract related informations from params first, if not found, try from hostProps.
This should be used only when the hostProps of the host is wrong.- Parameters:
host
- the hostoid
- the oidparams
- the params. those params with high priority will overrides the properties in the hostProps- Returns:
- the value of this oid
- Throws:
java.io.IOException
- failed to get this oid- See Also:
get(String, String)
-
get
public static java.lang.String get(java.lang.String host, java.lang.String oid, java.util.Map<java.lang.String,java.lang.String> params, int timeoutInMs) throws java.io.IOException
get an OID from a host by v1/v2c/v3.
This provides another argument params to override the properties in the hostProps.
We will try to extract related informations from params first, if not found, try from hostProps
This should be used only when the hostProps of the host is wrong.- Parameters:
host
- the hostoid
- the oidparams
- the params. those params with high priority will overrides the properties in the hostPropstimeoutInMs
- the timeout in mill seconds (this is the PDU timeout)- Returns:
- the value of this oid
- Throws:
java.io.IOException
- failed to get this oid- See Also:
get(String, String, int)
-
get
public static java.lang.String get(java.lang.String host, java.lang.String community, java.lang.String version, java.lang.String oid) throws java.io.IOException
get an OID from a host by v1/v2c.
This api CAN'T be used to snmp v3 requests.- Parameters:
host
- the hostcommunity
- the communityversion
- the version. v1/v2coid
- the oid- Returns:
- the value of the oid
- Throws:
java.io.IOException
- failed to get this oid
-
get
public static java.lang.String get(java.lang.String host, java.lang.String community, java.lang.String version, java.lang.String oid, int timeoutInMillis) throws java.io.IOException
get an OID from a host by v1/v2c.
This api CAN'T be used to snmp v3 requests.- Parameters:
host
- the hostcommunity
- the communityversion
- the version. v1/v2coid
- the oidtimeoutInMillis
- the timeout in mill seconds- Returns:
- the value of the oid
- Throws:
java.io.IOException
- failed to get this oid
-
get
public static java.lang.String get(java.lang.String host, java.lang.String community, java.lang.String version, java.lang.String oid, int timeoutInMillis, int port) throws java.io.IOException
get an OID from a host by v1/v2c.
This api CAN'T be used to snmp v3 requests.- Parameters:
host
- the hostcommunity
- the communityversion
- the version. v1/v2coid
- the oidtimeoutInMillis
- the timeout in mill seconds- Returns:
- the value of the oid
- Throws:
java.io.IOException
- failed to get this oid
-
getV3
public static java.lang.String getV3(java.lang.String host, java.lang.String securityName, java.lang.String oid) throws java.io.IOException
get an OID from a host by v3. The hostProps will NOT be used. No authentication protocol and token will be set. No privacy protocol and token will be set.- Parameters:
host
- the hostsecurityName
- the security for the hostoid
- the oid- Returns:
- the value of the oid
- Throws:
java.io.IOException
- failed to get this oid
-
getV3
public static java.lang.String getV3(java.lang.String host, java.lang.String securityName, java.lang.String oid, int timeoutInMs) throws java.io.IOException
get an OID from a host by v3. The hostProps will NOT be used. No authentication protocol and token will be set. No privacy protocol and token will be set.- Parameters:
host
- the hostsecurityName
- the security for the hostoid
- the oidtimeoutInMs
- the timeout in mill seconds- Returns:
- the value of the oid
- Throws:
java.io.IOException
- failed to get this oid
-
getV3
public static java.lang.String getV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String oid) throws java.io.IOException
get an OID from a host by v3. The hostProps will NOT be used. No privacy protocol and token will be set.- Parameters:
host
- the hostsecurityName
- the security for the hostauthProto
- the authentication protocol for the hostauthPhrase
- the authentication token for the hostoid
- the oid- Returns:
- the value of the oid
- Throws:
java.io.IOException
- failed to get this oid
-
getV3
public static java.lang.String getV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String oid, int timeoutInMs) throws java.io.IOException
get an OID from a host by v3. The hostProps will NOT be used. No privacy protocol and token will be set.- Parameters:
host
- the hostsecurityName
- the security for the hostauthProto
- the authentication protocol for the hostauthPhrase
- the authentication token for the hostoid
- the oidtimeoutInMs
- the timeout in mill seconds- Returns:
- the value of the oid
- Throws:
java.io.IOException
- failed to get this oid
-
getV3
public static java.lang.String getV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid) throws java.io.IOException
get an OID from a host by v3. The hostProps will NOT be used.- Parameters:
host
- the hostsecurityName
- the security for the hostauthProto
- the authentication protocol for the hostauthPhrase
- the authentication token for the hostprivProto
- the privacy protocol for the hostprivPhrase
- the privacy token for the hostoid
- the oid- Returns:
- the value of the oid
- Throws:
java.io.IOException
- failed to get this oid
-
getV3
public static java.lang.String getV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid, int timeoutInMs) throws java.io.IOException
get an OID from a host by v3. The hostProps will NOT be used. No privacy protocol and token will be set.- Parameters:
host
- the hostsecurityName
- the security for the hostauthProto
- the authentication protocol for the hostauthPhrase
- the authentication token for the hostprivProto
- the privacy protocol for the hostprivPhrase
- the privacy token for the hostoid
- the oidtimeoutInMs
- the timeout in mill seconds- Returns:
- the value of the oid
- Throws:
java.io.IOException
- failed to get this oid
-
getV3
public static java.lang.String getV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid, int timeoutInMs, int port) throws java.io.IOException
get an OID from a host by v3. The hostProps will NOT be used. No privacy protocol and token will be set.- Parameters:
host
- the hostsecurityName
- the security for the hostauthProto
- the authentication protocol for the hostauthPhrase
- the authentication token for the hostprivProto
- the privacy protocol for the hostprivPhrase
- the privacy token for the hostoid
- the oidtimeoutInMs
- the timeout in mill seconds for pdu timeoutport
- the snmp port- Returns:
- the value of the oid
- Throws:
java.io.IOException
- failed to get this oid
-
getV3
public static java.lang.String getV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid, int timeoutInMs, int port, java.lang.String contextName, java.lang.String contextEngineId) throws java.io.IOException
get an OID from a host by v3. The hostProps will NOT be used. No privacy protocol and token will be set.- Parameters:
host
- the hostsecurityName
- the security for the hostauthProto
- the authentication protocol for the hostauthPhrase
- the authentication token for the hostprivProto
- the privacy protocol for the hostprivPhrase
- the privacy token for the hostoid
- the oidtimeoutInMs
- the timeout in mill seconds for pdu timeoutport
- the snmp portcontextName
-contextEngineId
-- Returns:
- the value of the oid
- Throws:
java.io.IOException
- failed to get this oid
-
walk
public static java.lang.String walk(java.lang.String host, java.lang.String oid) throws java.io.IOException
walk an OID from a host by v1/v2c/v3.
the snmp related authentication information will be extracted from hostProps.
This will auto extract the snmp version from hostProps.- Parameters:
host
- the hostoid
- the oid- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walk
public static java.lang.String walk(java.lang.String host, java.lang.String oid, int walkTimeoutInMs) throws java.io.IOException
walk an OID from a host by v1/v2c/v3.
the snmp related authentication information will be extracted from hostProps.
This will auto extract the snmp version from hostProps.- Parameters:
host
- the hostoid
- the oidwalkTimeoutInMs
- the timeout in mill seconds- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walk
public static java.lang.String walk(java.lang.String host, java.lang.String oid, java.util.Map<java.lang.String,java.lang.String> params) throws java.io.IOException
walk an OID from a host by v1/v2c/v3.
This provides another argument params to override the properties in the hostProps.
We will try to extract related informations from params first, if not found, try from hostProps.
This should be used only when the hostProps of the host is wrong.- Parameters:
host
- the hostoid
- the oidparams
- the params. those params with high priority will overrides the properties in the hostProps- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walk
public static java.lang.String walk(java.lang.String host, java.lang.String oid, java.util.Map<java.lang.String,java.lang.String> params, int timeoutInMs) throws java.io.IOException
walk an OID from a host by v1/v2c/v3.
This provides another argument params to override the properties in the hostProps.
We will try to extract related informations from params first, if not found, try from hostProps.
This should be used only when the hostProps of the host is wrong.- Parameters:
host
- the hostoid
- the oidparams
- the params. those params with high priority will overrides the properties in the hostPropstimeoutInMs
- the timeout in mill seconds- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walkAsMap
public static java.util.Map<java.lang.String,java.lang.String> walkAsMap(java.lang.String host, java.lang.String oid, java.util.Map<java.lang.String,java.lang.String> params) throws java.io.IOException
walk an OID from a host by v1/v2c/v3.
This provides another argument params to override the properties in the hostProps.
We will try to extract related informations from params first, if not found, try from hostProps.
This should be used only when the hostProps of the host is wrong.- Parameters:
host
- the hostoid
- the oidparams
- the params. those params with high priority will overrides the properties in the hostProps- Returns:
- the output of walk result. the output is a map.
- Throws:
java.io.IOException
- failed to walk this oid
-
walkAsMap
public static java.util.Map<java.lang.String,java.lang.String> walkAsMap(java.lang.String host, java.lang.String oid, java.util.Map<java.lang.String,java.lang.String> params, int timeoutInMs) throws java.io.IOException
walk an OID from a host by v1/v2c/v3.
This provides another argument params to override the properties in the hostProps.
We will try to extract related informations from params first, if not found, try from hostProps.
This should be used only when the hostProps of the host is wrong.- Parameters:
host
- the hostoid
- the oidparams
- the params. those params with high priority will overrides the properties in the hostPropstimeoutInMs
- the timeout in mill seconds- Returns:
- the output of walk result. the output is a map
- Throws:
java.io.IOException
- failed to walk this oid
-
walk
public static java.lang.String walk(java.lang.String host, java.lang.String community, java.lang.String version, java.lang.String oid) throws java.io.IOException
walk an OID from a host by v1/v2c.
This api CAN'T be used to snmp v3 requests.- Parameters:
host
- the hostcommunity
- the communityversion
- the version. v1/v2coid
- the oid- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walk
public static java.lang.String walk(java.lang.String host, java.lang.String community, java.lang.String version, java.lang.String oid, int walkTimeoutInMs) throws java.io.IOException
walk an OID from a host by v1/v2c.
This api CAN'T be used to snmp v3 requests.- Parameters:
host
- the hostcommunity
- the communityversion
- the version. v1/v2coid
- the oidwalkTimeoutInMs
- the timeout in mill seconds- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walk
public static java.lang.String walk(java.lang.String host, java.lang.String community, java.lang.String version, java.lang.String oid, int walkTimeoutInMs, int port) throws java.io.IOException
walk an OID from a host by v1/v2c.
This api CAN'T be used to snmp v3 requests.- Parameters:
host
- the hostcommunity
- the communityversion
- the version. v1/v2coid
- the oidwalkTimeoutInMs
- the timeout in mill secondsport
- the port- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walkV3
public static java.lang.String walkV3(java.lang.String host, java.lang.String securityName, java.lang.String oid) throws java.io.IOException
walk an OID from a host by v3.
The hostProps will NOT be used. No authentication protocol and token will be set. No privacy protocol and token will be set.- Parameters:
host
- the hostsecurityName
- the security for the hostoid
- the oid- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walkV3
public static java.lang.String walkV3(java.lang.String host, java.lang.String securityName, java.lang.String oid, int walkTimeoutInMs) throws java.io.IOException
walk an OID from a host by v3.
The hostProps will NOT be used. No authentication protocol and token will be set. No privacy protocol and token will be set.- Parameters:
host
- the hostsecurityName
- the security for the hostoid
- the oidwalkTimeoutInMs
- the timeout in mill seconds- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walkV3
public static java.lang.String walkV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String oid) throws java.io.IOException
walk an OID from a host by v3.
The hostProps will NOT be used. No privacy protocol and token will be set.- Parameters:
host
- the hostsecurityName
- the security for the hosauthProto
- the authentication protocol for the hostauthPhrase
- the authentication token for the hostoid
- the oid- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walkV3
public static java.lang.String walkV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String oid, int timeoutInMs) throws java.io.IOException
walk an OID from a host by v3.
The hostProps will NOT be used. No privacy protocol and token will be set.- Parameters:
host
- the hostsecurityName
- the security for the hostauthProto
- the authentication protocol for the hostauthPhrase
- the authentication token for the hostoid
- the oidtimeoutInMs
- the timeout in mill seconds- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walkV3
public static java.lang.String walkV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid) throws java.io.IOException
walk an OID from a host by v3.
The hostProps will NOT be used.- Parameters:
host
- the hostsecurityName
- the security for the hostauthProto
- the authentication protocol for the hostauthPhrase
- the authentication token for the hostprivProto
- the privacy protocol for the hostprivPhrase
- the privacy token for the hostoid
- the oid- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walkV3
public static java.lang.String walkV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid, int walkTimeoutInMs) throws java.io.IOException
walk an OID from a host by v3.
The hostProps will NOT be used.- Parameters:
host
- the hostsecurityName
- the security for the hostauthProto
- the authentication protocol for the hostauthPhrase
- the authentication token for the hostprivProto
- the privacy protocol for the hostprivPhrase
- the privacy token for the hostoid
- the oidwalkTimeoutInMs
- the timeout in mill seconds- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walkV3
public static java.lang.String walkV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid, int walkTimeoutInMs, int port) throws java.io.IOException
walk an OID from a host by v3.
The hostProps will NOT be used.- Parameters:
host
- the hostsecurityName
- the security for the hostauthProto
- the authentication protocol for the hostauthPhrase
- the authentication token for the hostprivProto
- the privacy protocol for the hostprivPhrase
- the privacy token for the hostoid
- the oidwalkTimeoutInMs
- the timeout in mill seconds for snmp walk operationsport
- the snmp port- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
walkV3
public static java.lang.String walkV3(java.lang.String host, java.lang.String securityName, java.lang.String authProto, java.lang.String authPhrase, java.lang.String privProto, java.lang.String privPhrase, java.lang.String oid, int walkTimeoutInMs, int port, java.lang.String contextName, java.lang.String contextEngineId) throws java.io.IOException
walk an OID from a host by v3.
The hostProps will NOT be used.- Parameters:
host
- the hostsecurityName
- the security for the hostauthProto
- the authentication protocol for the hostauthPhrase
- the authentication token for the hostprivProto
- the privacy protocol for the hostprivPhrase
- the privacy token for the hostoid
- the oidwalkTimeoutInMs
- the timeout in mill seconds for snmp walk operationsport
- the snmp portcontextName
- the context name for this host. default is emptycontextEngineId
- the context engine id for this host. default is empty- Returns:
- the output of walk result
- Throws:
java.io.IOException
- failed to walk this oid
-
-