Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-3509

Patch to provide Java Gateway support for wildcard JMX discovery

XMLWordPrintable

      Hello,

      We required additional functionality within the the Java Gateway to allow JMX Discovery rules with wildcards which allows limiting of the data returned from the JMX request.

      This allows us to write Discovery rules as follows.
      jmx.discovery["org.mongodb.driver:clusterId=*,host=*,port=*,type=ConnectionPool"]

      With item prototypes
      jmx["{#JMXOBJ}",CheckedOutCount]
      jmx["{#JMXOBJ}",MaxSize]
      jmx["{#JMXOBJ}",Size]
      jmx["{#JMXOBJ}",WaitQueueSize]

      Which provide final host items of
      jmx["org.mongodb.driver:clusterId=580860194994c505434e9ed7,host=host04.gst-men,port=27017,type=ConnectionPool",CheckedOutCount]
      jmx["org.mongodb.driver:clusterId=580860194994c505434e9ed7,host=host04.gst-men,port=27017,type=ConnectionPool",MaxSize]
      jmx["org.mongodb.driver:clusterId=580860194994c505434e9ed7,host=host04.gst-men,port=27017,type=ConnectionPool",Size]
      jmx["org.mongodb.driver:clusterId=580860194994c505434e9ed7,host=host04.gst-men,port=27017,type=ConnectionPool",WaitQueueSize]
      jmx["org.mongodb.driver:clusterId=580860194994c505434e9ed7,host=host05.gst-men,port=27017,type=ConnectionPool",CheckedOutCount]
      jmx["org.mongodb.driver:clusterId=580860194994c505434e9ed7,host=host05.gst-men,port=27017,type=ConnectionPool",MaxSize]
      jmx["org.mongodb.driver:clusterId=580860194994c505434e9ed7,host=host06.gst-men,port=27017,type=ConnectionPool",CheckedOutCount]

      Additionally we have added the support for Java Maps in exposed JMX attributes.

      An example item would be as follows.
      jmx["com.gamesparks.jmx:name=AnalysisService",LogCounts.sendMessage]

      #JMX returned data
      "com.gamesparks.jmx:name=AnalysisService" LogCounts
      10/20/2016 12:51:10 +0000 org.archive.jmx.Client LogCounts:

      {auth=8895, buyInternalVirtualGood=6, verifyMock=10, .ScriptingService.findAndExecuteMessageScript=387, .ScheduledScriptExecutorImpl$1.run=1780, .PortalFormService.processFormRequest=5, verifyWindowsStore=4, .TwitterAuthenticationService.getTwitterProfileFromAuthToken=14, .XBOXLiveAuthenticationService.getProfileFromAuthToken=4, verifyAmazon=2, verifyGooglePlay=2, buyStoreCurrencyPack=2, .ScriptingService.findAndExecuteResponseScript=11197, connect=8811, .GameSparksWebSocketService.onSocketMessage=28711, .BulkJobProcessor.runCloudCode=6, verifySteam=2, .FacebookAuthenticationService.extendAccessToken=28, buyStoreVirtualGood=12, custom=4, batchUpdateQueue=0, sendMessage=1806, .ScriptingService.getFacebookProfileFromAuthToken=34, .ScriptExecutionService.execute=28773, .ScriptingService.getTwitchProfileFromAuthToken=4, .ScriptingService.getKongregateProfileFromAuthToken=6, newUser=25, verifyIos=2}

      We have been running this code on the Java gateway for over a year with no issues. Originally written for zabbix 2.2.9 and now ported to 2.2.15.

      We generated the attached patch file from the source code available http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.2.15/zabbix-2.2.15.tar.gz/download

      JMXItemChecker.java.orig - The original file.
      JMX.patch - The patch file
      JMXItemChecker.java - The patched version of the file from 2.2.15

      This maybe related to https://support.zabbix.com/browse/ZBXNEXT-1223

      In the future(next few months) we plan to upgrade to Zabbix 3.0LTS.

      Thank you for building the core of our monitoring platform. Keep up the good work!

      Cheers,
      Luke

        1. JMX.patch
          10 kB
          Luke Morfitt
        2. JMXItemChecker.java
          11 kB
          Luke Morfitt
        3. JMXItemChecker.java.orig
          9 kB
          Luke Morfitt

            Unassigned Unassigned
            lukemorfitt Luke Morfitt
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: