Hi Bill,
In deploy/snmp-adaptor.sar there are 3 configuration files:
managers.xml - to which SNMP managers to send traps
mbeans.xml - which mbeans/JMX Notification types to register for
notifications.xml - how to map specific JMX Notification types to SNMP traps
To get a simple example running you need to:
a) Produce one or more JMX notifications from an MBean of yours. You
probably need to define your own notification types. Those are basically
package-like strings (e.g. "JMX.mbean.registered") that are used to create
notification namespaces and identify notifications by type. The notification
itself is javax.management.Notification or a subclass of it.
For example, the always-there "JMImplementation:type=MBeanServerDelegate"
MBean throws a notification of type "JMX.mbean.registered" wrapped inside
class javax.management.MBeanServerNotification that extends
javax.management.Notification.
Another example is the SnmpAgentService itself. Because it extends
org.jboss.system.ServiceMBeanSupport it can easily emit a "coldstart"
notification upon startup, like this:
this.sendNotification(new Notification("coldstart", this,
getNextNotificationSequenceNumber()));
b) Configure mbeans.xml so that your MBean is monitored by the snmp-adaptor
for the particular JMX notifications types you emit, for example:
<monitored-obj>
<object-name>jboss.jmx:name=SnmpAgent,service=snmp,type=adaptor</object-name
>
<notification-type>coldstart</notification-type>
...
<notification-type>yet.another.type</notification-type>
</monitored-obj>
c) Map the notification type to a corresponding SNMP trap in
notifications.xml. For the above example this could be:
<mapping>
<notification-type>coldstart</notification-type>
<generic>0</generic>
<specific>0</specific>
<enterprise>1.2.3.4.5.6.7</enterprise>
<var-bind-list
wrapper-class="org.jboss.jmx.adaptor.snmp.agent.NotificationWrapperSupport">
<var-bind>
<tag>a:startTime</tag>
<oid>1.2.3.4.5.6.7.9</oid>
</var-bind>
<var-bind>
<tag>a:trapCount</tag>
<oid>1.2.3.4.5.6.7.6</oid>
</var-bind>
</var-bind-list>
</mapping>
The wrapper class is the one used to extract information from the emitted
notification. The default one shown above understands the following tags:
Source Tag Explanation
Notification n:message The JMX Notification message attribute
n:sequenceNumber The JMX Notification sequence number attribute
n:timeStamp The JMX Notification time stamp attribute
n:type The JMX Notification type attribute
n:all The JMX Notification in stringified form
n:class The JMX Notification class
Agent a:startTime The Agent instantiation time in stringified
form
a:uptime The Agent uptime in msec
a:trapCount The Agent trap count attribute
User data u:xxx Assuming the user defined notification payload
is
contained in a hash map, it will use xxx as the key to extract the value.
You can define your own extractor class, but then it gets complicated...
d) Finally, set the manager(s) to receive traps. By default snmp-adaptor
includes a simple manager that logs SNMP traps as log.info messages, so no
need to do something:
<manager>
<address>localhost</address>
<port>1162</port>
<local-port>0</local-port>
<version>1</version>
</manager>
e) Touch the snmp-adaptor/META-INF/jboss-service.xml to restart the adaptor
and activate the new configuration
Hope that helps! Tell me how it goes.
Best Regards
/Dimitris
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development