Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by DarylBeattie: http://wiki.apache.org/solr/SolrSnmp The comment on the change is: Removed leading whitespace from some of the code examples. ------------------------------------------------------------------------------ Using your OID (let's say it's 12345678 for XYZ Corp.), you'll want to edit the attributes.xml included in the snmp-adapter.sar to add something like the following: {{{ - <mbean name="com.xyz:name=SolrStats" oid-prefix=".1.3.6.1.4.1.12345678.1"> + <mbean name="com.xyz:name=SolrStats" oid-prefix=".1.3.6.1.4.1.12345678.1"> - <attribute name="QueryHandler_Standard_Requests" oid=".1"/> + <attribute name="QueryHandler_Standard_Requests" oid=".1"/> - </mbean> + </mbean> }}} === Creating the MBean === You'll want to create an MBean interface that looks something like this: {{{ - public interface SolrStatsMBean { + public interface SolrStatsMBean { - public long getQueryHandler_Standard_Requests(); + public long getQueryHandler_Standard_Requests(); - } + } }}} And for the implementation, I have chosen to make most of the accessor methods static because in my implementation other pieces of code access the stats as well. The implementation looks like this:
