Class SNMPMonitor


  • public class SNMPMonitor
    extends Object
    The SNMPMonitor Class allows to get a singleton SNMPMonitor object allowing to access the JMX cn=monitor MBean.
    • Field Detail

      • pattern

        public static ObjectName pattern
        Pattern to use to query the cn=monitor MBeans.
    • Method Detail

      • getMonitor

        public static SNMPMonitor getMonitor​(MBeanServer server)
        Gets the singleton SNMPMonitor object.
        Parameters:
        server - The server
        Returns:
        the SNMPMonitor mapping object.
      • getConnectionHandlersStatistics

        public Set<ObjectName> getConnectionHandlersStatistics()
        Gets the Connection Handlers Statistics MBean.
        Returns:
        the Set of Connection Handlers Statistics. If Statistics do not exist then an empty Set is returned
      • getConnectionHandler

        public ObjectName getConnectionHandler​(ObjectName statistics)
        Return the ObjectName of the Connection Handler corresponding to the statistics name.
        Parameters:
        statistics - ObjectName
        Returns:
        the Connection Handler ObjectName, null otherwise
      • getConnectionHandlers

        public Set<ObjectName> getConnectionHandlers()
        Return a Set of Connection Handler ObjectNames.
        Returns:
        the Set of ObjectNames, an empty Set if no connection handlers
      • getConnectionHandlerStatistics

        public ObjectName getConnectionHandlerStatistics​(ObjectName connectionHandlerName)
        Returns the ObjectName of the Statistics Connection Handler name. corresponding to the Connection Handler name
        Parameters:
        connectionHandlerName - The connection handler name
        Returns:
        the ObjectName of the statistics ObjectName, null if the statistics could not be found
      • getAttribute

        public Object getAttribute​(String name,
                                   String attribute)
        Get the value of the attribute.
        Parameters:
        name - of Mbean as a String
        attribute - to look for
        Returns:
        the value of the attribute, null if the attribute could not be found
      • getAttribute

        public Object getAttribute​(ObjectName name,
                                   String attribute)
        Gets the value of an attribute.
        Parameters:
        name - of the Mbean
        attribute - to look for
        Returns:
        the value of the attribute, null if the attribute value could not be found
      • string2ByteArray

        public static Byte[] string2ByteArray​(String s)
        Wrapper for SNMP Byte[].
        Parameters:
        s - value string
        Returns:
        a Byte[]
      • counter32Value

        public static long counter32Value​(long v)
        Wrapper for SNMP Counter32.
        Parameters:
        v - value
        Returns:
        a counter32
      • counter32Value

        public static Long counter32Value​(Long V)
        Wrapper for SNMP Counter32.
        Parameters:
        V - Value
        Returns:
        a Counter32
      • gauge32Value

        public static long gauge32Value​(long v)
        Latcher for SNMP Gauge32.
        Parameters:
        v - value
        Returns:
        a gauge32
      • gauge32Value

        public static Long gauge32Value​(Long V)
        Latcher for SNMP Gauge32.
        Parameters:
        V - value
        Returns:
        a gauge32
      • integerValue

        public static Integer integerValue​(Long V)
                                    throws com.sun.management.snmp.SnmpStatusException
        Checker for SNMP INTEGER.
        Parameters:
        V - value
        Returns:
        an Integer
        Throws:
        com.sun.management.snmp.SnmpStatusException - If an error occurs