Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-14571

Multiple jmx items on one host

    XMLWordPrintable

Details

    • Problem report
    • Status: Closed
    • Trivial
    • Resolution: Duplicate
    • 3.4.10, 3.4.11
    • None
    • None
    • None

    Description

      Hi,
      Before (ver 3.0) we used this patch

      --- ./src/zabbix_java/src/com/zabbix/gateway/JMXItemChecker.java.orig   2012-12-08 12:09:15.000000000 +0100
      +++ ./src/zabbix_java/src/com/zabbix/gateway/JMXItemChecker.java        2013-02-15 12:20:55.000000000 +0100
      @@ -117,8 +117,8 @@
      
              if (item.getKeyId().equals("jmx"))
              {
      -                       if (2 != item.getArgumentCount())
      -                               throw new ZabbixException("required key format: jmx[<object name>,<attribute name>]");
      +                       if (2 != item.getArgumentCount() && 3 != item.getArgumentCount())
      +                               throw new ZabbixException("required key format: jmx[<object name>,<attribute name>[,<id>]]");
      
                  ObjectName objectName = new ObjectName(item.getArgument(1));
                  String attributeName = item.getArgument(2);
      --- ./frontends/php/include/defines.inc.php.orig        2013-02-15 12:23:03.000000000 +0100
      +++ ./frontends/php/include/defines.inc.php     2013-02-15 12:23:50.000000000 +0100
      @@ -344,7 +344,7 @@
       define('ZBX_DEFAULT_KEY_DB_MONITOR',   'db.odbc.select[<unique short description>]');
       define('ZBX_DEFAULT_KEY_SSH',                  'ssh.run[<unique short description>,<ip>,<port>,<encoding>]');
       define('ZBX_DEFAULT_KEY_TELNET',               'telnet.run[<unique short description>,<ip>,<port>,<encoding>]');
      -define('ZBX_DEFAULT_KEY_JMX',                  'jmx[<object name>,<attribute name>]');
      +define('ZBX_DEFAULT_KEY_JMX',                  'jmx[<object name>,<attribute name>,<optional id>]');
      
       define('SYSMAP_ELEMENT_USE_ICONMAP_ON',                1);
       define('SYSMAP_ELEMENT_USE_ICONMAP_OFF',       0);
      

      in order to be able to separate different items (on different ports listened to different java applications) on one host.
      In this case, the field "key_" was of the form

      jmx["XXX:name=Monitor","MessagesPerSecond","Port=44444"
      

      this "key_" contains three parameters and the third parameter makes each "key_" unique within this host. After the upgrade to version 3.4, the "key_" field does not support the third parameter and now we have to add whitespaces so that these keys are unique:
      https://stackoverflow.com/questions/11609932/monitor-two-java-processes-on-the-same-machine-using-zabbix
      At the moment it looks like a dirty fix, maybe it makes sense in the next release to return the third parameter in the "key_" field?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Z Maxim
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: