Ad Widget

Collapse

how to configure JMX monitoring?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wifi75
    Member
    • Apr 2018
    • 45

    #16
    Originally posted by Dmitryb
    Hello!

    Here is a step by step how to set up zabbix-java-gateway and monitor tomcat using built in template
    Or alternatively just watch a HowTo video about it https://www.youtube.com/watch?v=h6MlF4ztekg&t=9s

    Note that i am doing it on Zabbix 3.0.2 With Centos7

    Frontend
    1) Configuration->Hosts
    You can create a dummy host or just add JMX interface to existing.



    2) Add a template click on Templates tab -> Find "Template JMX Generic" click add and update.

    That's all we need to do in frontend. Now lets continue in backend. In my situation it is VM with Zabbix Server 3.0.2. installed from packages.

    Backend
    1) yum install zabbix-java-gateway
    2) yum install tomcat
    3) edit Tomcat config file /etc/tomcat/tomcat.conf

    Be carefull - one extra space can make lots of problems.
    Code:
    # Run tomcat under the Java Security Manager
    SECURITY_MANAGER="false"
    JAVA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false "
    4) edit zabbix server config /etc/zabbix/zabbix_server.conf
    Count of JavaPollers on server/proxy side should be atliest same as in zabbix_java_gateway.conf
    Code:
    ### Option: JavaGateway
    # IP address (or hostname) of Zabbix Java gateway.
    # Only required if Java pollers are started.
    #
    # Mandatory: no
    # Default:
    # JavaGateway=
    
    JavaGateway=127.0.0.1
    
    ### Option: JavaGatewayPort
    # Port that Zabbix Java gateway listens on.
    #
    # Mandatory: no
    # Range: 1024-32767
    # Default:
    # JavaGatewayPort=10052
    
    
    ### Option: StartJavaPollers
    # Number of pre-forked instances of Java pollers.
    #
    # Mandatory: no
    # Range: 0-1000
    # Default:
    # StartJavaPollers=0
    
    StartJavaPollers=5
    SERVICES
    Lets add Tomcat and zabbix-java-gateway to autostart, and start them now.

    systemctl enable tomcat
    systemctl enable zabbix-java-gateway
    systemctl start tomcat
    systemctl start zabbix-java-gateway

    We need to restart zabbix-server, because we changed the config file
    systemctl restart zabbix-server

    Now we should see Some Latest Data in frontend under host with Java template!


    Hello Sir,
    I try to ask, my situation it is below;

    I have one public server zabbix with many pubblic host with tomcat service to monitor.
    please confirm this below:

    Like your post I need install all and configure on my server zabbix correct not on tomcat server ?
    I need open port jmx traffic to my server zabbix (12345) it is correct?
    Tomcat host server side I have to do anything else?



    Comment

    • emil@hirestorm.com
      Junior Member
      • Sep 2019
      • 6

      #17
      Hello Dmitry,

      I need to monitor apache solr , which is on a different instance than zabbix server.

      I followed the document for installation of java-gateway
      Installing zabbix-java-gateway on Centos 6.5 How does zabbix-java-gateway work? First we configure system which needs to be monito...


      Could you please guide me through, how to get my jmx enabled for monitoring.

      I downloaded the solr template from
      The Zabbix Team has collected all official Zabbix monitoring templates and integrations.


      Kindly help, I am lost in the middle.

      Thanks

      Comment

      Working...