Ad Widget

Collapse

JMX monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • allexpetrov
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2017
    • 361

    #16
    Originally posted by Jayshankar
    Hi,

    I have installed tomcat on linux machine. The port 8080 is currently working. What is the next step i have to do to get java gateway working.

    Thanks,
    Jayshankar
    Have you managed to edit config file ? I mean, if you will run netstat -tulpn you'll find there open port with nr. 12345 ? Have you managed to add new host with JMX port ?


    vim/nano /etc/tomcat/tomcat.conf

    JAVA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

    Comment

    • Jayshankar
      Member
      • Apr 2017
      • 31

      #17
      I have to edit which config file??. netstat -tulpn is not showing port 12345. The host has been configured on the frontend side with JMX Interface. The tomcat is also configured(etc/tomcat/tomcat.conf).

      Comment

      • Jayshankar
        Member
        • Apr 2017
        • 31

        #18
        JMX monitoring

        netstat -tulpn | grep 12345
        tcp6 0 0 :::12345 :::* LISTEN 20804/java

        Comment

        • Jayshankar
          Member
          • Apr 2017
          • 31

          #19
          JMX monitoring

          I need futher help in setting up JMX monitoring. Any help would be appreciated.

          Comment

          • allexpetrov
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • May 2017
            • 361

            #20
            Originally posted by Jayshankar
            I need futher help in setting up JMX monitoring. Any help would be appreciated.
            Ok, once again..

            1. Have you configured the JavaGateway and Poler count in zabbix_server.conf ? In my example i have server and javagateway installed on one host.

            Code:
            JavaGateway=127.0.0.1
            StartJavaPollers=5
            2. Have you created a new Host with JMX interface ?

            3. In case everything is done - output of tail -f /var/log/zabbix/zabbix_server.log would be great!

            Because as I see in your output of netstat - the port is up and listening.

            Regards,
            Alexey!

            Comment

            • Jayshankar
              Member
              • Apr 2017
              • 31

              #21
              JMX monitoring

              zabbix_server.conf configured with JavaGateway and JavaPollers.

              A new host for JMX item created with jmx template. JMX service enabled successfuly for the new host.

              Logs messages in zabbix_server.log are as follows:

              26317:20170821:101700.511 In evaluate_function() function:'zealapp1:jmx["java.l
              ang:type=Runtime",Uptime].nodata(5m)'
              26317:20170821:101700.512 End of evaluate() error:'Cannot evaluate expression:
              "Cannot evaluate function "zealapp1:jmx["java.lang:type=Runtime",Uptime].nodata(
              5m)": item does not have enough data after server start or item creation.".'

              26317:20170821:101700.512 evaluate_expressions():expression [(ZBX_UNKNOWN0)=1]
              cannot be evaluated: Cannot evaluate expression: "Cannot evaluate function "zeal
              app1:jmx["java.lang:type=Runtime",Uptime].nodata(5m)": item does not have enough
              data after server start or item creation.".

              26317:20170821:101700.513 query [txnlev:1] [update triggers set state=1,error='
              Cannot evaluate expression: "Cannot evaluate function "zealapp1:jmx["java.lang:t
              ype=Runtime",Uptime].nodata(5m)": item does not ' where triggerid=14224;

              26330:20170821:101718.373 In substitute_key_macros() data:'jmx["Catalina:type=G
              lobalRequestProcessor,name=http-8080",bytesReceived]'
              26330:20170821:101718.373 End of substitute_key_macros():SUCCEED data:'jmx["Cat
              alina:type=GlobalRequestProcessor,name=http-8080",bytesReceived]'

              26330:20170821:101718.373 In substitute_key_macros() data:'jmx["java.lang:type=
              Threading",TotalStartedThreadCount]'

              26330:20170821:101718.375 End of substitute_key_macros():SUCCEED data:'jmx["jav
              a.lang:type=MemoryPool,name=CMS Old Gen",Usage.committed]'
              26330:20170821:101718.376 JSON before sending [{"request":"java gateway jmx","c
              onn":"127.0.0.1","port":12345,"keys":["jmx[\"Catalina:type=GlobalRequestProcesso
              r,name=http-8080\",bytesReceived]","jmx[\"java.lang:type=Threading\",TotalStarte
              dThreadCount]","jmx[\"java.lang:type=Threading\",ThreadCount]","jmx[\"java.lang:
              type=Threading\",PeakThreadCount]","jmx[\"Catalina:type=GlobalRequestProcessor,n
              ame=http-8080\",bytesSent]","jmx[\"Catalina:type=GlobalRequestProcessor,name=htt
              p-8080\",processingTime]","jmx[\"Catalina:type=GlobalRequestProcessor,name=htt p-
              8443\",errorCount]","jmx[\"java.lang:type=Runtime\",Uptime]","jmx[\"java.lang:ty
              pe=OperatingSystem\",ProcessCpuLoad]","jmx[\"java.lang:type=OperatingSystem\",Op
              enFileDescriptorCount]","jmx[\"Catalina:type=Manager,path=/,host=localhost\",act

              26329:20170821:101719.596 query [txnlev:1] [update hosts set jmx_available=1 wh
              ere hostid=10125]
              26329:20170821:101719.672 enabling JMX agent checks on host "zealapp1": host be
              came available
              26323:20170821:101719.783 item "zealapp1:jmx["java.lang:type=GarbageCollector,n
              ame=ConcurrentMarkSweep",CollectionCount]" became not supported: java.lang:type=
              GarbageCollector,name=ConcurrentMarkSweep

              Comment

              • Jayshankar
                Member
                • Apr 2017
                • 31

                #22
                JMX monitoring

                Is the above output right??.

                Comment

                Working...