4 Replies Latest reply on Jun 9, 2005 4:23 PM by Dimitris Andreadis

    JMX/SNMP newbie question

    Joseph Yi Newbie

      Environment: jboss-4.0.1sp1

      According the the JBoss 4.0 Official Guide, the snmp-adaptor service "can be used to intercept JMX notifications emitted by MBeans, convert them to traps, and send them to SNMP managers."

      In the snmp-adaptor's notifications.xml file, there are a couple of notification types defined: heartbeat, coldstart, and jmx.change.attribute

      On the JMX side, I'm going through Sun's tutorial at http://java.sun.com/j2se/1.5.0/docs/guide/jmx/tutorial/tutorialTOC.html

      Is it reasonable to assume that if I make a MBean based on this tutorial's instructions on sending notifications, that I can simply add a new notification-type to notifications.xml? What notification-type do I use for a Timer MBean?

      I've read through the Wiki and the section about the SNMP adaptor and have SNMP traps being sent to my SNMP manager, so I was just wondering if anyone can direct me on having my own notification-type defined so that its notifications are trapped by the snmp-adaptor.


        • 1. Re: JMX/SNMP newbie question
          Dimitris Andreadis Master

          The notification types can be anything you like, just try to make it unique. It is common to use some package-like convention, e.g.


          The next step is to subscribe to receive your notification by configuring the SubscriptionList attribute of the adaptor. The provided mechanism allows you to register to receive any possible notification in the system from any mbean(s), see http://wiki.jboss.org/wiki/Wiki.jsp?page=SubscriptionList.

          The final step is to define a mapping in notifications.xml, from the type you specified to a trap, see http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossSNMPAdapterNotifications

          • 2. Re: JMX/SNMP newbie question
            Joseph Yi Newbie

            Thanks! I'll give it a shot.

            • 3. Re: JMX/SNMP newbie question
              Mark Lybarger Apprentice

              i'm also interested in using snmp for monitoring the jboss server's "health". one thing that has been mentioned as interesting to watch are free memory levels. if the free memory gets above say 90%, i'd like to send an snmp trap to the snmp manager.

              i haven't really worked much with snmp as of yet, so hopefully i've got the lingo down.

              does jboss already provide an mbean which sends this type of notification?

              • 4. Re: JMX/SNMP newbie question
                Dimitris Andreadis Master

                There is actually such an MBean:

                (look in deploy/monitoring-service.xml)

                 <mbean code="org.jboss.monitor.services.MemoryMonitor"
                 <attribute name="FreeMemoryWarningThreshold">17m</attribute>
                 <attribute name="FreeMemoryCriticalThreshold">16m</attribute>

                There is a problem with it, if you want to use it in conjuction with the snmp-adaptor, in that it produces the same notification type (jboss.alarm.memory.low) but with a different severity level to indicate the setting or the seizure of the alarm.
                 public static final int SEVERITY_NORMAL = 0;
                 public static final int SEVERITY_WARNING = 1;
                 public static final int SEVERITY_MINOR = 2;
                 public static final int SEVERITY_MAJOR = 3;
                 public static final int SEVERITY_CRITICAL = 4;
                 public static final int SEVERITY_UNKNOWN = 5;

                So you can't only rely on the notification type only to indicate the low-memory condition.

                This was the first effort of actually having a "stateful" alarm in jboss, something that would go into an active alarm table.