views:

39

answers:

1

I want to monitor (via SNMP) some attributes of several JBoss MBeans that are running on my system:

I have configured my attributes.xml unders snmp-adaptor.sar to include:

<mbean name="jboss.ha:service=HASingletonDeployer">    
      <attribute name="MasterNode"    oid=".1.2.3.4.1.22"/>
      <attribute name="PartitionName" oid=".1.2.3.4.1.23"/>
      <attribute name="TargetStopMethodArgument" oid=".1.2.3.4.1.24"/>
      <attribute name="TargetName" oid=".1.2.3.4.1.25"/>
      <attribute name="State" oid=".1.2.3.4.1.26"/>
      <attribute name="StateString" oid=".1.2.3.4.1.27"/>
      <attribute name="ClusterPartition" oid=".1.2.3.4.1.28"/>
</mbean>

But with my MIB browser I can only successfully do a get() on String or Int attributes. Boolean or objects will return an SNMP error. So, the adaptor is not even "publishing" the OID for those cases.

For my above list, MasterNode, TargetName, and ClusterPartition fail on SNMP get(), the rest are successful.

Any workaround for this?

More information: from the JMX console for org.jboss.ha.singleton.HASingletonController:

(Name / Type)

  • TargetName javax.management.ObjectName
  • StateString java.lang.String
  • MasterNode boolean
  • ClusterPartition org.jboss.ha.framework.server.ClusterPartitionMBean
  • TargetStartMethod java.lang.String
  • TargetStartMethodArgument java.lang.String
  • State int
  • TargetStopMethodArgument java.lang.String
  • PartitionName java.lang.String

(among others)

+1  A: 

The JBoss SNMP adapter has very primitive logic for mapping java types to SNMP types. It can handle String, Integer, Long, and that's pretty much it. This is partly because SNMP has a very narrow range of available types (e.g. it has no boolean), and partly because the SNMP adapter just hasn't been well developed.

There is an issue filed with RedHat about this, but in the meantime your option is either to rewrite the SNMP adapter (it's open-source, after all), or to write MBeans which re-expose the required information as String/Long/Integer (e.g. expose booleans as 1 or 0).

skaffman