TelScale SNMP and JMX Management Mobicents 2011 Summit
Agenda <ul><ul><li>MSS Achievements </li></ul></ul><ul><ul><li>Community </li></ul></ul><ul><ul><li>Introducing TelScale <...
JMX Management Mobicents 2011 Summit
JMX Console Hands on confidential <ul><ul><li>MSS Core Beans </li></ul></ul><ul><ul><li>Connector Beans </li></ul></ul><ul...
Sip Servlets Management  Console Hands on confidential <ul><ul><li>Manage DAR configuration and the DAR extensions </li></...
Jopr/JON Management  Console Hands on confidential <ul><ul><li>Manage and Monitor  </li></ul></ul><ul><ul><li>Deploy/Undep...
Twiddle confidential <ul><ul><li>For command line management and shell scripting </li></ul></ul><ul><ul><li>Access JMX inf...
SNMP Management Mobicents 2011 Summit
SNMP Description confidential <ul><ul><li>Simple Network Management Protocol (SNMP)  is the most popular network managemen...
SNMP Protocol Data Units confidential <ul><ul><li>SNMPv1 specified five core protocol data units (PDUs). Two other PDUs,  ...
SNMP Adaptor  confidential <ul><ul><li>Mobicents now features a revamped (from the old one present in JBoss AS) SNMP Adapt...
SNMP Adaptor JBoss Service confidential <ul><ul><li>The SNMP Adaptor JBoss Service is located in $JBOSS_HOME/server/<profi...
SNMP Adaptor JBoss Service Configuration File confidential <ul><ul><li>The SNMP Adaptor JBoss Service configuration file i...
SNMP Adaptor JBoss Service Managers File confidential <ul><ul><li>The SNMP Adaptor JBoss Service configuration file is loc...
SNMP Adaptor JBoss Service Users File confidential <ul><ul><li>The SNMP Adaptor JBoss Service configuration file is locate...
SNMP Adaptor JBoss Service Attributes Configuration File confidential <ul><ul><li>The SNMP Adaptor JBoss Service configura...
SNMP Adaptor JBoss Service Attributes Scalar/Tabular confidential <ul><ul><li>Scalar object  A Scalar Object defines a sin...
SNMP Adaptor JBoss Service Notifications Configuration File confidential <ul><ul><li>The SNMP Adaptor JBoss Service config...
SNMP Adaptor JBoss Service Notifications Configuration File confidential Tag Description n:message  javax.management.Notif...
SNMP Adaptor Deployer confidential <ul><ul><li>The SNMP Adaptor JBoss Service is located in $JBOSS_HOME/server/<profile>/d...
SNMP Adaptor MIB Generator confidential <ul><ul><li>A way for a user to generate an SNMP MIB file based on already defined...
SNMP Adaptor WalkThrough Accessing JMX Scalar Attrs confidential <ul><ul><li>MSS SNMP Adaptor is exposing out of the box a...
Application showcasing SNMP/JMX Mapping confidential <ul><ul><li>Deploy snmp-servlet-5.1.0.GA.war to default profile. </li...
SNMP Adaptor WalkThrough Accessing JMX Tabular Attrs (Index Based) confidential <ul><ul><li>MessageHistory Attribute is of...
SNMP Adaptor WalkThrough Iterating JMX Tabular Attrs (Index Based) confidential <ul><ul><li>Iterating through a Tabular Ob...
SNMP Adaptor WalkThrough Accessing JMX Tabular Attrs (Key Based) confidential <ul><ul><li>MessageCountHistory Attribute is...
SNMP Adaptor WalkThrough Accessing JMX Tabular Attrs (Key Based) confidential <ul><ul><li>The GetBulkRequest was introduce...
SNMP Adaptor WalkThrough Accessing JMX Wilcard as a Table confidential <ul><ul><li>The SNMP Adaptor allows for the  mss-at...
Sending SNMP Traps confidential <ul><ul><li>When started the SNMP Adaptor sends a JMX Notification that is converted into ...
confidential Thank you ! http://telestax.com/
Upcoming SlideShare
Loading in …5
×

TelScale SNMP and JMX management - Mobicents Summit 2011

1,542 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,542
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
29
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

TelScale SNMP and JMX management - Mobicents Summit 2011

  1. 1. TelScale SNMP and JMX Management Mobicents 2011 Summit
  2. 2. Agenda <ul><ul><li>MSS Achievements </li></ul></ul><ul><ul><li>Community </li></ul></ul><ul><ul><li>Introducing TelScale </li></ul></ul><ul><ul><li>Roadmaps </li></ul></ul>
  3. 3. JMX Management Mobicents 2011 Summit
  4. 4. JMX Console Hands on confidential <ul><ul><li>MSS Core Beans </li></ul></ul><ul><ul><li>Connector Beans </li></ul></ul><ul><ul><li>Application Beans </li></ul></ul><ul><ul><li>JBoss Cache Beans </li></ul></ul>
  5. 5. Sip Servlets Management Console Hands on confidential <ul><ul><li>Manage DAR configuration and the DAR extensions </li></ul></ul><ul><ul><li>Manage the basic controls </li></ul></ul><ul><ul><li>Deploy examples </li></ul></ul><ul><ul><li>Not secure by default </li></ul></ul><ul><ul><li>Only for development environment </li></ul></ul><ul><ul><li>Only manages the local instance </li></ul></ul><ul><ul><li>It is not aware of the clustering and other instances </li></ul></ul><ul><ul><li>http://localhost:8080/sip-servlets-management/ </li></ul></ul>
  6. 6. Jopr/JON Management Console Hands on confidential <ul><ul><li>Manage and Monitor </li></ul></ul><ul><ul><li>Deploy/Undeploy </li></ul></ul><ul><ul><li>Can be secured </li></ul></ul><ul><ul><li>For development and production environment </li></ul></ul><ul><ul><li>manages the local instance </li></ul></ul><ul><ul><li>Can be aware of the clustering and other instances </li></ul></ul><ul><ul><li>http://localhost:8080/admin-console </li></ul></ul>
  7. 7. Twiddle confidential <ul><ul><li>For command line management and shell scripting </li></ul></ul><ul><ul><li>Access JMX information from command line </li></ul></ul><ul><li>./twiddle.sh -s jnp://localhost:1099 invoke &quot;jboss.web:host=localhost,path=/click2call,type=SipManager&quot; listSessionIds </li></ul>
  8. 8. SNMP Management Mobicents 2011 Summit
  9. 9. SNMP Description confidential <ul><ul><li>Simple Network Management Protocol (SNMP) is the most popular network management protocol in the TCP/IP protocol suite, using a simple request/response protocol that communicates management information about the configuration and status of nodes between two types of SNMP software entities: SNMP applications, also called SNMP managers and SNMP agents . </li></ul></ul><ul><ul><li>SNMP agents expose management data on the managed systems as variables. The variables accessible via SNMP are organized in hierarchies (tree-based). SNMP uses an extensible design, where the available information and other metadata (such as type and description of the variable) is described by Management Information Bases (MIBs) . MIBs describe the structure of the management data of a device subsystem </li></ul></ul><ul><ul><li>Objects in the MIB are defined using a subset of Abstract Syntax Notation One ( ASN.1 ) called &quot;Structure of Management Information Version 2 (SMIv2)&quot; </li></ul></ul><ul><ul><li>Object identifiers (OID) uniquely identifies managed objects in the MIB hierarchy </li></ul></ul>
  10. 10. SNMP Protocol Data Units confidential <ul><ul><li>SNMPv1 specified five core protocol data units (PDUs). Two other PDUs, GetBulkRequest and InformRequest were added in SNMPv2 and carried over to SNMPv3. </li></ul></ul><ul><ul><li>The seven SNMP protocol data units (PDUs) are as follows: </li></ul></ul><ul><ul><li>Response Returns variable bindings and acknowledgement from agent to manager for below GetRequest , SetRequest , GetNextRequest , GetBulkRequest and InformRequest . Error reporting is provided by error-status and error-index fields. Although it was used as a response to both gets and sets, this PDU was called GetResponse in SNMPv1. </li></ul></ul><ul><ul><li>GetRequest A manager-to-agent request to retrieve the value of a variable or list of variables. </li></ul></ul><ul><ul><li>SetRequest A manager-to-agent request to change the value of a variable or list of variables. </li></ul></ul><ul><ul><li>The 3 above PDUs are covered by Accessing JMX Beans Attributes (SNMP GET and SET) </li></ul></ul><ul><ul><li>GetNextRequest A manager-to-agent request to discover available variables and their values. Returns a Response with variable binding for the lexicographically next variable in the MIB. The entire MIB of an agent can be walked by iterative application of GetNextRequest starting at OID 0. Rows of a table can be read by specifying column OIDs in the variable bindings of the request. </li></ul></ul><ul><ul><li>GetBulkRequest Optimized version of GetNextRequest . A manager-to-agent request for multiple iterations of GetNextRequest . Returns a Response with multiple variable bindings walked from the variable binding or bindings in the request. PDU specific non-repeaters and max-repetitions fields are used to control response behavior. </li></ul></ul><ul><ul><li>The 2 above PDUs are covered by Accessing JMX wildcards or Beans Attributes as Tables (SNMP getnext, SNMP getbulk) </li></ul></ul><ul><ul><li>Trap Asynchronous notification from agent to manager. Includes current sysUpTime value, an OID identifying the type of trap and optional variable bindings. </li></ul></ul><ul><ul><li>InformRequest Acknowledged asynchronous notification from manager to manager. This PDU uses the same format as the SNMPv2 version of Trap . Manager-to-manager notifications were already possible in SNMPv1 (using a Trap ), but as SNMP commonly runs over UDP where delivery is not assured and dropped packets are not reported, delivery of a Trap was not guaranteed. InformRequest fixes this by sending back an acknowledgement on receipt. Receiver replies with Response parroting all information in the InformRequest . </li></ul></ul>
  11. 11. SNMP Adaptor confidential <ul><ul><li>Mobicents now features a revamped (from the old one present in JBoss AS) SNMP Adaptor, leveraging snmp4j as a Java implementation of SNMP, that wraps the JMX MBean and Notifications to allow monitoring and configuration of the Application Server and applications deployed on it through the SNMP protocol </li></ul></ul><ul><ul><li>The Adaptor now supports all versions of the protocol, v1, v2c and v3 including security for v2c and v3. It also has supports for tables and both traps and informs. </li></ul></ul><ul><ul><li>The Adaptor is broke down in 2 pieces : </li></ul></ul><ul><ul><ul><li>The SNMP Adaptor JBoss Service </li></ul></ul></ul><ul><ul><ul><li>The SNMP Adaptor JBoss Deployer </li></ul></ul></ul>
  12. 12. SNMP Adaptor JBoss Service confidential <ul><ul><li>The SNMP Adaptor JBoss Service is located in $JBOSS_HOME/server/<profile>/deploy/snmp-adaptor.sar </li></ul></ul><ul><ul><li>Contains the general configuration of the SNMP service and the JMX to SNMP mapping for Mobicents Sip Servlets, JBoss AS and its subcomponents </li></ul></ul><ul><ul><li>The SNMP Adaptor Service Agent listen on a given UDP port (default 1161). The manager may send requests from any available source port to port 1161 in the Agent. The Agent responses will be sent back to the source port of the manager sent requests. </li></ul></ul><ul><ul><li>The SNMP Adaptor Service also provides a manager that can receive notifications (Traps and Inform Requests) on port 1162. </li></ul></ul><ul><ul><li>The SNMP Adaptor Service Agent may generate notifications from any available port on behalf of the JBoss Application Server or its components and applications deployed within it. </li></ul></ul>
  13. 13. SNMP Adaptor JBoss Service Configuration File confidential <ul><ul><li>The SNMP Adaptor JBoss Service configuration file is located in $JBOSS_HOME/server/<profile>/deploy/snmp-adaptor.sar/META-INF/jboss-service.xml </li></ul></ul><ul><ul><li>Contains 3 MBeans : </li></ul></ul><ul><ul><ul><li>The SNMP Adaptor Manager org.jboss.jmx.adaptor.snmp.trapd.TrapdService </li></ul></ul></ul><ul><ul><ul><li>The SNMP Adaptor Agent org.jboss.jmx.adaptor.snmp.agent.SnmpAgentService : It defines a set of properties to override the default behavior of the Agent and the location of the other configuration files used by the agent. It also defines the list of Subscriptions to JMX notifications from the JBoss Application Server, its components and applications deployed within it that the agent filters and will map to SNMP Notifications. This subscriptionList attribute warrants a specific section as it is used in conjunction with the Notifications configuration file. It defines a list of JMX Notifications emitted by MBeans (the name can use wilcard to match multiple MBeans at the same time) to intercept that will be converted by the SNMP Adaptor as an SNMP Notification through the Notifications configuration file. The type of the notification will be used to find in the Notifications file how to map it, which OID to give it and which information will be sent. </li></ul></ul></ul><ul><ul><ul><li>System Information as specified in RFC 1213 org.jboss.jmx.adaptor.snmp.system.MIB2SystemGroupService </li></ul></ul></ul>
  14. 14. SNMP Adaptor JBoss Service Managers File confidential <ul><ul><li>The SNMP Adaptor JBoss Service configuration file is located in $JBOSS_HOME/server/<profile>/deploy/snmp-adaptor.sar/managers.xml </li></ul></ul><ul><ul><li>configure the SNMP managers to which the generated SNMP traps should be forwarded. </li></ul></ul><ul><ul><li>Each manager entry must specify: </li></ul></ul><ul><ul><ul><li>address : the manager's address (IP address or host name) </li></ul></ul></ul><ul><ul><ul><li>port : the listening port </li></ul></ul></ul><ul><ul><ul><li>local-address : the local binding address (optional) </li></ul></ul></ul><ul><ul><ul><li>local-port : the local binding port (optional) </li></ul></ul></ul><ul><ul><ul><li>version : the SNMP version to use (1 or 2 or 3) </li></ul></ul></ul><ul><ul><ul><li>community-string : If version is 1 or 2, the community string (public or private) </li></ul></ul></ul>
  15. 15. SNMP Adaptor JBoss Service Users File confidential <ul><ul><li>The SNMP Adaptor JBoss Service configuration file is located in $JBOSS_HOME/server/<profile>/deploy/snmp-adaptor.sar/users.xml </li></ul></ul><ul><ul><li>Configure the SNMP users when using version 3 of the protocol. </li></ul></ul><ul><ul><li>Each user entry must specify : </li></ul></ul><ul><ul><ul><li>securityName : the security name of the user (typically the user name). </li></ul></ul></ul><ul><ul><ul><li>authenticationProtocol : the authentication protcol to be associated with this user (MD5 or SHA). If not set, this user only supports unauthenticated messages. </li></ul></ul></ul><ul><ul><ul><li>authenticationPassphrase : If present, the authentication Protocol must also be present. RFC3414 §11.2 requires passphrases to have a minimum length of 8 bytes. If the length is less than 8 bytes an IllegalArgumentException will be thrown. </li></ul></ul></ul><ul><ul><ul><li>privacyProtocol : the privacy protcol ID to be associated with this user (DES, 3DES, AES128, AES192, AES256). If not set, this user only supports unencrypted messages. </li></ul></ul></ul><ul><ul><ul><li>privacyPassphrase : If present, the privacy Protocol must also be set. RFC3414 §11.2 requires passphrases to have a minimum length of 8 bytes. If the length is less than 8 bytes an IllegalArgumentException will be thrown. </li></ul></ul></ul>
  16. 16. SNMP Adaptor JBoss Service Attributes Configuration File confidential <ul><ul><li>The SNMP Adaptor JBoss Service configuration file is located in $JBOSS_HOME/server/<profile>/deploy/snmp-adaptor.sar/mss-attributes.xml </li></ul></ul><ul><ul><li>Controls the mapping of JMX mbean attributes to SNMP OIDs accessible through the SNMP Adaptor. It defines a list of MBean and their attributes to map to SNMP OID. </li></ul></ul><ul><ul><li>Each mbean entry must specify : </li></ul></ul><ul><ul><ul><li>name : The MBean name for which its attributes need to be exposed. The MBean name can be a wildcard, in which case the returned set will be exposed as an SNMP Table </li></ul></ul></ul><ul><ul><ul><li>oid-prefix (optional) : if set it will be prepended to the attributes oid. </li></ul></ul></ul><ul><ul><ul><li>a list of attribute that specifies : </li></ul></ul></ul><ul><ul><ul><ul><li>name it needs to match the one that has to be exposed from the MBean </li></ul></ul></ul></ul><ul><ul><ul><ul><li>oid identifier of the attribute. It can either be the full oid or only the last part of it if the oid-prefix was set above. All attributes are Scalar objects by default which means that to access them you will need to add a .0 to the attribute oid to access it </li></ul></ul></ul></ul><ul><ul><ul><ul><li>table if the attribute has to be exposed as a Tabular object ie a SNMP table (currently if set to true only array, List and Map are supported and within those only basic types (String, int, long, boolean, otherwise Object.toString will be called) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>mode if set to *rw*, it means that the attribute is writable (can be set) otherwise by default it is read-only </li></ul></ul></ul></ul>
  17. 17. SNMP Adaptor JBoss Service Attributes Scalar/Tabular confidential <ul><ul><li>Scalar object A Scalar Object defines a single object instance. A scalar object by definition has only one instance as opposed to a table. Therefore, an instance index of zero is always specified when retrieving the value of a scalar object. An instance index higher than 0 can only be used in the case of tabular objects, which can have multiple instances. </li></ul></ul><ul><ul><li>Tabular object A Tabular Object defines multiple related object instances that are grouped in MIB tables. The JBoss SNMP Adaptor uses two types of ways to access values in a table : </li></ul></ul><ul><ul><li>a separate index column for tabular objects that represents arrays and java.util.List since they are indexed, but to query the Java index that starts at 0 in an array or List, it will start at index .1 for SNMP as .0 is reserved for scalar objects </li></ul></ul><ul><ul><li>For tabular objects whose type is a java.util.Map or a wildcard used in a MBean, the index column will be named as per the key of the data in the row. </li></ul></ul>
  18. 18. SNMP Adaptor JBoss Service Notifications Configuration File confidential <ul><ul><li>The SNMP Adaptor JBoss Service configuration file is located in $JBOSS_HOME/server/<profile>/deploy/snmp-adaptor.sar/mss-notifications.xml </li></ul></ul><ul><ul><li>Controls the mapping of JMX notifications to SNMP Traps. The key for the mapping is considered to be the notification type as defined in the subscriptions list of the SNMP Adaptor JBoss Service configuration file </li></ul></ul><ul><ul><li>Each mapping entry must specify : </li></ul></ul><ul><ul><ul><li>notification-type : The type of JMX Notifications to wrap as a SNMP Notification. Please note that the notification has to be caught first by the subscription list filter defined in SNMP Adaptor JBoss Service configuration file </li></ul></ul></ul><ul><ul><ul><li>inform : if set to &quot;true&quot; , this trap will be send as an inform (acknowledged trap) </li></ul></ul></ul><ul><ul><ul><li>security-name : the user to associate with the sending of the trap (will be used for version 3 of the protocol only) </li></ul></ul></ul><ul><ul><ul><li>var-bind-list whose defines a wrapper-class that allows to to extract info from arbitrary notification subclasses. The generated trap may contain an arbitrary payload of variable bindings ( var-bind) with explicitly specified oid and values extracted from the emitted notification ( tag ). </li></ul></ul></ul>
  19. 19. SNMP Adaptor JBoss Service Notifications Configuration File confidential Tag Description n:message javax.management.Notification.getMessage() n:sequenceNumber javax.management.Notification.getSequenceNumber() n:timeStamp javax.management.Notification.getTimestamp() n:type javax.management.Notification.getType() n:all javax.management.Notification.toString() n:class javax.management.Notification.getClass().getName() a:startTime snmp agent/adaptor start time a:uptime snmp agent/adaptor up time a:trapCount snmp agent/adaptor trap count u:<user-defined-tag> looked-up in n.getUserData()
  20. 20. SNMP Adaptor Deployer confidential <ul><ul><li>The SNMP Adaptor JBoss Service is located in $JBOSS_HOME/server/<profile>/deployers/snmp.deployer </li></ul></ul><ul><ul><li>The SNMP Adaptor Deployer dynamically looks for snmp-attributes.xml and snmp-notifications.xml files in any applications deployed within JBoss Application Server and register the notifications, attributes and their JMX mapping with the SNMP Adaptor JBoss Service. </li></ul></ul>
  21. 21. SNMP Adaptor MIB Generator confidential <ul><ul><li>A way for a user to generate an SNMP MIB file based on already defined attributes.xml and notifications.xml. This MIB file allows an SNMP manager to display metrics in a much more human readable way than would otherwise be possible, and the generator allows the user to skip the arduous task of manually creating an MIB file. </li></ul></ul>
  22. 22. SNMP Adaptor WalkThrough Accessing JMX Scalar Attrs confidential <ul><ul><li>MSS SNMP Adaptor is exposing out of the box a certain number of MBean and their attributes in the mss-attributes.xml configuration file </li></ul></ul><ul><ul><li>Exposing a JMX Attribute as Scalar Object and reading its value through SNMP GetRequest : </li></ul></ul><ul><li>snmpget -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.2.1.1.1.0 </li></ul><ul><ul><li>Exposing a JMX Attribute as Scalar Object and setting its value through SNMP SetRequest </li></ul></ul><ul><li>snmpset -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.2.1.1.1.0 s &quot;Mobicents Sip Servlets rocks&quot; </li></ul><ul><ul><li>Discovering the next OID/JMX Attribute to query through SNMP GetNextRequest </li></ul></ul><ul><li>snmpgetnext -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.4.1.2312.100.1.1.20.1.1.0 </li></ul>
  23. 23. Application showcasing SNMP/JMX Mapping confidential <ul><ul><li>Deploy snmp-servlet-5.1.0.GA.war to default profile. </li></ul></ul><ul><ul><li>showcase a basic web application that provides a web page which displays a counter, each time the page is refreshed the counter is incremented. Alternatively, a message can be set through JMX that will display on the web page as well. The application also register a MBean providing the following set of monitoring information : </li></ul></ul><ul><ul><li>counter : the current value of the counter </li></ul></ul><ul><ul><li>message : allows to retrieve and set the value of the message that will be displayed on the page along with the counter </li></ul></ul><ul><ul><li>messageHistory : all the values that have been set since the application is running returned as a java.util.List<String> </li></ul></ul><ul><ul><li>messageHistoryAsArray : all the values that have been set since the application is running returned as a String array. </li></ul></ul><ul><ul><li>countHistory : all the values that have been displayed since the application is running returned as a primitive int array. </li></ul></ul><ul><ul><li>messageCountHistory : a Map which have as a key the message and as a value the corresponding counter value that was present when the message was set. </li></ul></ul><ul><ul><li>The application also send will make use of the SNMP Agent MBean Service to send a SNMP trap on when the application is deployed. </li></ul></ul><ul><ul><li>Set a message then refresh the pages 3 times, then set another message and refresh again 3 times. </li></ul></ul>
  24. 24. SNMP Adaptor WalkThrough Accessing JMX Tabular Attrs (Index Based) confidential <ul><ul><li>MessageHistory Attribute is of type java.util.List<String> so is a Tabular Object index based that will be used for the following sub sections as an example. </li></ul></ul><ul><ul><li>The query OID should be the concatenation of the oid prefix (.1.3.6.1.4.1.2312.100.10.11) + the MessageHistory OID (.3.1) + the value column (.2) + the index to retrieve the value from (.1) (remember that to access the index 0, .1 should be used because .0 are reserved for scalar objects </li></ul></ul><ul><ul><li>Exposing a JMX Attribute as Tabular Object (Index Based) and reading its value through SNMP GetRequest </li></ul></ul><ul><li>snmpget -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.4.1.2312.100.10.11.3.1.2. 1 </li></ul><ul><ul><li>To get the second message </li></ul></ul><ul><li>snmpget -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.4.1.2312.100.10.11.3.1.2. 2 </li></ul><ul><ul><li>Exposing a JMX Attribute as Tabular Object (Index Based) and setting its value through SNMP SetRequest </li></ul></ul><ul><li>snmpset -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.4.1.2312.100.10.11.3.1.2. 2 s &quot;overriding second message&quot; </li></ul>
  25. 25. SNMP Adaptor WalkThrough Iterating JMX Tabular Attrs (Index Based) confidential <ul><ul><li>Iterating through a Tabular Object (Index Based) through SNMP GetNextRequest </li></ul></ul><ul><li>snmpgetnext -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.4.1.2312.100.10.11.3.1snmpgetnext -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.4.1.2312.100.10.11.3. 2 </li></ul><ul><li>snmpgetnext -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.4.1.2312.100.10.11. 4 .1.2.1 </li></ul><ul><ul><li>Iterating through a Tabular Object (Index Based) through SNMP GetBulkRequest </li></ul></ul><ul><li>snmpbulkget -v 3 -Cr2 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.4.1.2312.100.10.11.3.1 </li></ul>
  26. 26. SNMP Adaptor WalkThrough Accessing JMX Tabular Attrs (Key Based) confidential <ul><ul><li>MessageCountHistory Attribute is of type java.util.Map<String, Integer> so is a Tabular Object key based that will be used for the following sub sections as an example. </li></ul></ul><ul><ul><li>As opposed to an index based Tabular Object, there is no index to iterate through for the rows of a table, so there is no way to issue a GetRequest PDU directly except if the table contents is already known to the querier. So as for index based tabular objects by specifying the table OID ie for MessageCountHistory table attribute the OID will be .1.3.6.1.4.1.2312.100.10.11.6.1, it is actually possible to iterate through the full table by issuing a set of GetNextRequest SNMP PDU. </li></ul></ul><ul><ul><li>Iterating through a Tabular Object (Key Based) through SNMP GetNextRequest </li></ul></ul><ul><li>snmpgetnext -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.4.1.2312.100.10.11.6.1 </li></ul><ul><li>which gives iso.3.6.1.4.1.2312.100.10.11.6.1.2.109.101.115.115.97.103.101.32.49 = INTEGER: 3 </li></ul><ul><li>The OID is a concatenation of the table entry OID (.1.3.6.1.4.1.2312.100.10.11.6.1) and of the ASN.1 representation of the first entry key of the java.util.Map MessageCountHistory attribute (ie &quot;message 1&quot;), to get the next key of the map, the OID of the response has to be used just like for regular index based tabular objects so to get the next entry OID and value the following command should be issue </li></ul><ul><li>snmpgetnext -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.4.1.2312.100.10.11.6.1.2.109.101.115.115.97.103.101.32.49 </li></ul><ul><li>which gives iso.3.6.1.4.1.2312.100.10.11.6.1.2.109.101.115.115.97.103.101.32.50 = INTEGER: 6 </li></ul>
  27. 27. SNMP Adaptor WalkThrough Accessing JMX Tabular Attrs (Key Based) confidential <ul><ul><li>The GetBulkRequest was introduced in SNMP version 2 because iterating through a table with GetNext proved to be tedious and inefficient. So GetBulkRequest was introduced to allow fetching a table completely with one request instead of multiple GetNext requests. So to iterate through the MessageHistory table the following command should be issued </li></ul></ul><ul><ul><li>Iterating through a Tabular Object (Key Based) through SNMP GetBulkRequest </li></ul></ul><ul><li>snmpbulkget -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.4.1.2312.100.10.11.6.1 which gives </li></ul><ul><li>iso.3.6.1.4.1.2312.100.10.11.6.1.2.109.101.115.115.97.103.101.32.49 = INTEGER: 3 </li></ul><ul><li>iso.3.6.1.4.1.2312.100.10.11.6.1.2.109.101.115.115.97.103.101.32.50 = INTEGER: 6 </li></ul><ul><ul><li>Exposing a JMX Attribute as Tabular Object (Key Based) and reading its value through SNMP GetRequest </li></ul></ul><ul><li>Query the OID that should be the concatenation of the oid prefix (.1.3.6.1.4.1.2312.100.10.11) + the MessageCountHistory OID (6.1) + the value column (.2) + the ASN.1 representation of the key of the table whose value wants to be retrieved (message 1) </li></ul><ul><li>snmpget -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 iso.3.6.1.4.1.2312.100.10.11.6.1.2.109.101.115.115.97.103.101.32.49 </li></ul><ul><ul><li>Exposing a JMX Attribute as Tabular Object (Key Based) and setting its value through SNMP SetRequest </li></ul></ul><ul><li>snmpset -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 iso.3.6.1.4.1.2312.100.10.11.6.1.2.109.101.115.115.97.103.101.32.49 i 69 </li></ul>
  28. 28. SNMP Adaptor WalkThrough Accessing JMX Wilcard as a Table confidential <ul><ul><li>The SNMP Adaptor allows for the mss-attributes.xml configuration file to specify in the MBean name a mbean query by using wildcards to get back a list of MBean which can be particularly useful for Sip Applications :<mbean name=&quot;jboss.web:host=localhost,path= /* ,type=SipManager&quot; oid-prefix=&quot;.1.3.6.1.4.1.2312.100.1.1.13.1&quot; definition-name=&quot;sipApplications&quot; table-name=&quot;sipMetrics&quot; description=&quot;Table containing standard metrics for any webapp deployed on JBossAS&quot; status=&quot;current&quot;> </li></ul></ul><ul><ul><li>Iterating through a Tabular Object (Key Based) through SNMP GetBulkRequest </li></ul></ul><ul><li>snmpgetnext -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.4.1.2312.100.1.1.13.1 which gives </li></ul><ul><li>iso.3.6.1.4.1.2312.100.1.1.13.1.2.106.98.111.115.115.46.119.101.98.58.116.121.112.101.61.83.105.112.77.97.110.97.103.101.114.44.112.97.116.104.61.47.99.108.105.99.107.50.99.97.108.108.44.104.111.115.116.61.108.111.99.97.108.104.111.115.116 = INTEGER: 0 </li></ul><ul><li>The OID is the concatenation of the OID prefix (.1.3.6.1.4.1.2312.100.1.1.13.1), first attribute ( distributable , .2) and the ASN.1 representation of the following web application ObjectName &quot;jboss.web:type=SipManager,path=click2call/,host=localhost&quot; </li></ul><ul><li>Important Note: SNMP don't iterate through a full row before moving to the next one, it rather do it by column so keeping on the same attribute until all rows have been iterated before moving to the next attribute, it means that querying with GetNextRequest PDU will give you the same attribute (distributable) but for the next application </li></ul><ul><ul><li>Iterating through a Tabular Object (Key Based) through SNMP walk </li></ul></ul><ul><li>snmpwalk -v 3 -u TEST -a MD5 -A &quot;maplesyrup&quot; -x DES -X &quot;maplesyrup&quot; -l authPriv 127.0.0.1:1161 .1.3.6.1.4.1.2312.100.1.1.13.1 </li></ul>
  29. 29. Sending SNMP Traps confidential <ul><ul><li>When started the SNMP Adaptor sends a JMX Notification that is converted into an SNMP Trap </li></ul></ul><ul><ul><li>When a JMX Notification is sent through JBoss Application Server, the SNMP Adaptor converts it with the SNMP Adaptor Notifications configuration File then the SNMP Trap (or INFORM if the inform attribute is set to &quot;true&quot; ) will be sent to each Manager defined in SNMP Adaptor Managers Configuration File </li></ul></ul>
  30. 30. confidential Thank you ! http://telestax.com/

×