Ad Widget

Collapse

Tomcat Monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gvatreya
    Junior Member
    • Jul 2014
    • 3

    #1

    Tomcat Monitoring

    Hi.

    I have been trying to setup Zabbix to monitor my 2 tomcat servers on 2 different Amazon EC2 machines, but in vain. The Z on the host is green, however te JMX is red with these errors
    - ZBX_TCP_READ() failed: [4] Interrupted system call
    - Someother erro [111] connection refused
    and many such errors, one after another, in the sense I resolve an error to see one more new error popping up.

    These are some assumptions
    All the machines run Ubuntu 12.10 and later
    Server's IP address: 66.xx.xx.120 (Runs Zabbix server v2.2.4 (revision 46772) (23 June 2014) )
    Agent's IP address: 87.xx.xx.198 ( Runs Zabbix agent v2.2.2 (revision 42525) (12 February 2014) )
    My local machine's IP address: 76.xx.xx.111

    Here is what I've done so far.

    On Server Side:
    * Installed Zabbix_server using sudo apt-get install zabbix-server-mysql.
    * The GUI, mysql database all have been installed and configured.
    * The following are the only 3 changes that I've made in the file
    /etc/zabbix/zabbix_server.conf
    ...
    JavaGateway=localhost
    JavaGatewayPort=10052
    StartJavaPollers=5
    ...
    * The Zabbix Java gateway was installed using sudo apt-get install zabbix-java-gateway.
    * The following are the only 3 changes that I've made in the file
    /etc/zabbix/zabbix_java_gateway.conf
    ...
    LISTEN_IP="127.0.0.1"
    LISTEN_PORT=10052
    START_POLLERS=5
    ...
    On Client Side:
    * Installed Zabbix Client using sudo apt-get install zabbix-agent
    * The following are the only 3 changes that I've made in the file
    /etc/zabbix/zabbix_agentd.conf
    ...
    Server=66.xx.xx.120
    StartAgents=5
    ServerActive=66.xx.xx.120:10051
    Hostname=Security-test-JMX-EC2
    ...
    * The Hostname is the same as the one that is mentioned while creating the Host on the GUI.

    I believe that there are some issues with the IP and ports. So, here are the outbound rules for both the machines as obtained from Amazon EC2 Security Groups for the machines
    Code:
    OUTBOUND RULES for SERVER SECURITY GROUP:
    Type      Protocol  Port   Source           Reasoning
    Custom-	  TCP	    8080   0.0.0.0/0
    TCP Rule	
    All ICMP  All	    N/A	   0.0.0.0/0	
    Custom-	  TCP	    10052  27.xx.xx.128/32   For access from Agent
    TCP Rule
    Custom-   TCP	    8081   76.xx.xx.130/32  To access Zabbix GUI from-
    TCP Rule				     -my local machine's web browser
    Custom-	  TCP	    10051  27.xx.xx.128/32   As the agent responds to- 
    TCP Rule				     -the server on Port 10051TCP Rule-
    					     -Must allow inbound communications-
    					     - from the agent.
    Custom-	  TCP	    11000  27.xx.xx.128/32   The agent's JMX reporting-
    TCP Rule				     -happens on port 11000(not on 12345).
    
    OUTBOUND RULES for CLIENT SECURITY GROUP:
    Type    Protocol Port   Source
    HTTPS	  TCP	443	0.0.0.0/0
    Custom-	  TCP	10050	66.xx.xx.120/32
    TCP Rule
    Custom-   TCP	10052	66.xx.xx.120/32
    TCP Rule
    Custom-   TCP	11000	66.xx.xx.120/32
    TCP Rule
    HTTP	  TCP	80	76.xx.xx.111/32
    Custom-   TCP	8080	76.xx.xx.111/32
    TCP Rule
    Custom-   TCP	8443	76.xx.xx.111/32
    TCP Rule
    What am I missing? Please guide me.
    Any help is appreciated.

    Thanks
    Goutham
  • jvalenzani
    Member
    Zabbix Certified Specialist
    • Sep 2010
    • 53

    #2
    Is JMX enabled on the tomcat server? Did you test it using Jconsole or any other tool?

    Comment

    • gvatreya
      Junior Member
      • Jul 2014
      • 3

      #3
      Yes, the JMX is enabled. I've added these under /usr/share/tomcat7/bin/setenv.sh

      JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote"
      JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=11000"
      JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
      JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false"

      It works on jconsole
      Last edited by gvatreya; 22-07-2014, 11:34. Reason: setenv.sh path was wrong

      Comment

      • jvalenzani
        Member
        Zabbix Certified Specialist
        • Sep 2010
        • 53

        #4
        Try to conect to the server using Jconsole and test if works.

        Comment

        • gvatreya
          Junior Member
          • Jul 2014
          • 3

          #5
          Yes, it does. I used VisualVM to connect to the JMX port on Tomcat Server. And it worked.

          I suspect it has something to do with the communication between Zabbix to JavaGateway or JavaGateway to JMX Tomcat Port.

          Comment

          Working...