Class Snmp


  • public class Snmp
    extends java.lang.Object
    This class Snmp is provided for SNMP related operations.
    The most common operations are:
    • get an oid value
    • walk an oid
    The default time out for the snmp related oprerations is snmp.pdu.timeout from agent.conf
    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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 host
        oid - 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 host
        oid - the oid
        pduTimeoutInMs - 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 host
        oid - the oid
        params - 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 host
        oid - the oid
        params - the params. those params with high priority will overrides the properties in the hostProps
        timeoutInMs - 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 host
        community - the community
        version - the version. v1/v2c
        oid - 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 host
        community - the community
        version - the version. v1/v2c
        oid - the oid
        timeoutInMillis - 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 host
        community - the community
        version - the version. v1/v2c
        oid - the oid
        timeoutInMillis - 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 host
        securityName - the security for the host
        oid - 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 host
        securityName - the security for the host
        oid - the oid
        timeoutInMs - 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 host
        securityName - the security for the host
        authProto - the authentication protocol for the host
        authPhrase - the authentication token for the host
        oid - 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 host
        securityName - the security for the host
        authProto - the authentication protocol for the host
        authPhrase - the authentication token for the host
        oid - the oid
        timeoutInMs - 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 host
        securityName - the security for the host
        authProto - the authentication protocol for the host
        authPhrase - the authentication token for the host
        privProto - the privacy protocol for the host
        privPhrase - the privacy token for the host
        oid - 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 host
        securityName - the security for the host
        authProto - the authentication protocol for the host
        authPhrase - the authentication token for the host
        privProto - the privacy protocol for the host
        privPhrase - the privacy token for the host
        oid - the oid
        timeoutInMs - 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 host
        securityName - the security for the host
        authProto - the authentication protocol for the host
        authPhrase - the authentication token for the host
        privProto - the privacy protocol for the host
        privPhrase - the privacy token for the host
        oid - the oid
        timeoutInMs - the timeout in mill seconds for pdu timeout
        port - 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 host
        securityName - the security for the host
        authProto - the authentication protocol for the host
        authPhrase - the authentication token for the host
        privProto - the privacy protocol for the host
        privPhrase - the privacy token for the host
        oid - the oid
        timeoutInMs - the timeout in mill seconds for pdu timeout
        port - the snmp port
        contextName -
        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 host
        oid - 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 host
        oid - the oid
        walkTimeoutInMs - 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 host
        oid - the oid
        params - 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 host
        oid - the oid
        params - the params. those params with high priority will overrides the properties in the hostProps
        timeoutInMs - 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 host
        oid - the oid
        params - 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 host
        oid - the oid
        params - the params. those params with high priority will overrides the properties in the hostProps
        timeoutInMs - 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 host
        community - the community
        version - the version. v1/v2c
        oid - 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 host
        community - the community
        version - the version. v1/v2c
        oid - the oid
        walkTimeoutInMs - 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 host
        community - the community
        version - the version. v1/v2c
        oid - the oid
        walkTimeoutInMs - the timeout in mill seconds
        port - 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 host
        securityName - the security for the host
        oid - 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 host
        securityName - the security for the host
        oid - the oid
        walkTimeoutInMs - 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 host
        securityName - the security for the hos
        authProto - the authentication protocol for the host
        authPhrase - the authentication token for the host
        oid - 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 host
        securityName - the security for the host
        authProto - the authentication protocol for the host
        authPhrase - the authentication token for the host
        oid - the oid
        timeoutInMs - 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 host
        securityName - the security for the host
        authProto - the authentication protocol for the host
        authPhrase - the authentication token for the host
        privProto - the privacy protocol for the host
        privPhrase - the privacy token for the host
        oid - 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 host
        securityName - the security for the host
        authProto - the authentication protocol for the host
        authPhrase - the authentication token for the host
        privProto - the privacy protocol for the host
        privPhrase - the privacy token for the host
        oid - the oid
        walkTimeoutInMs - 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 host
        securityName - the security for the host
        authProto - the authentication protocol for the host
        authPhrase - the authentication token for the host
        privProto - the privacy protocol for the host
        privPhrase - the privacy token for the host
        oid - the oid
        walkTimeoutInMs - the timeout in mill seconds for snmp walk operations
        port - 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 host
        securityName - the security for the host
        authProto - the authentication protocol for the host
        authPhrase - the authentication token for the host
        privProto - the privacy protocol for the host
        privPhrase - the privacy token for the host
        oid - the oid
        walkTimeoutInMs - the timeout in mill seconds for snmp walk operations
        port - the snmp port
        contextName - the context name for this host. default is empty
        contextEngineId - 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