Ad Widget

Collapse

jmx java.lang.Double bug?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pturrr
    Junior Member
    • Oct 2011
    • 5

    #1

    jmx java.lang.Double bug?

    Guys, hi. I am moving forward on zabbix 2.0 and really enjoy jmx monitoring embedded however there is one problem. It works great for type string, float, integer, but when i am trying to monitor my custom jmx values which have type java.lang.Double it throws me error:

    9186:20120531:031400.299 item [xxxxl.com:jmx["xxxx:name=Metrics","xxxx.count.min"]] became not supported: unsupported attribute type along the path: class java.lang.Double

    Why java.lang.Double is unsupported? Is this a bug?? Can you please respond, that's pretty urgent issue
  • neiromc
    Member
    • Sep 2010
    • 58

    #2
    Hi all!

    I have this problem too.

    22351:20120622:123317.844 item [my_channel_1:jmx["{$CHANNEL_OBJECT}",MeanSendRate]] became not supported: Received value [1.1717649181785851E-4] is not suitable for value type [Numeric (float)]

    Comment

    • neiromc
      Member
      • Sep 2010
      • 58

      #3
      fixed!

      Edit this file src/zabbix_java/src/com/zabbix/gateway/JMXItemChecker.java

      Diff between original and edited file:
      __________________________________________________

      34a35,36
      > import java.math.BigDecimal;
      >
      191,192c193,201
      < if (isPrimitiveAttributeType(attribute.getClass()))
      < return attribute.toString();
      ---
      > if (isPrimitiveAttributeType(attribute.getClass())) {
      > logger.trace("-------->>>> found attribute value of a primitive type: {}", attribute.toString());
      > try {
      > return new BigDecimal(attribute.toString()).toPlainString();
      > } catch(Exception e) {
      > logger.trace("found attribute value of a primitive type: {}", attribute.toString());
      > return attribute.toString();
      > }
      > }
      225c234,240
      < counter.put("{#JMXVALUE}", attribute.toString());
      ---
      > logger.trace("-------->>>> found attribute value of a primitive type: {}", attribute.toString());
      > try {
      > counter.put("{#JMXVALUE}", new BigDecimal(attribute.toString()).toPlainString());
      > } catch(Exception e) {
      > counter.put("{#JMXVALUE}", attribute.toString());
      > }
      > logger.trace("-------->>>> put attribute value: {}", counter.get("{#JMXVALUE}"));

      Comment

      Working...