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
Thanks! I'll give it a shot.
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?
There is actually such an MBean:
(look in deploy/monitoring-service.xml)
<mbean code="org.jboss.monitor.services.MemoryMonitor" name="jboss.monitor:service=MemoryMonitor"> <attribute name="FreeMemoryWarningThreshold">17m</attribute> <attribute name="FreeMemoryCriticalThreshold">16m</attribute> </mbean>
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.