Ad Widget

Collapse

How to enable Java Gateway on a running 2.0.4 server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • highjo
    Junior Member
    • Feb 2013
    • 10

    #1

    How to enable Java Gateway on a running 2.0.4 server

    Hello Everyone,

    Please excuse how trivial my question is. I am a complete newbie in a world of monitoring and zabbix especially. So far so good, I followed the manual and got zabbix 2.0.4 server installed on ubuntu 12.04 server and managed to get the agents installed on 4 linux boxes and one windows box.

    I needed to check how much memory an application is using on tomcat 6 and how much memory any jvm is consuming on the box it's installed. Based on zabbix documentation those details can be done via the zabbix java gateway.

    Now my approach to get it installed if from method documented here

    Following are the steps i would like to use:
    1. ps aux | grep zabbix_server
    2. kill -9 all pid of zabbix_server
    3. cd to /home/zabbix
    4. ./configure --enable-java --prefix=/opt/zabbix_java_gateway
    5. make install
    6. edit /usr/local/etc/zabbix_server.conf for the JavaGateway=127.0.0.1 JavaGatewayPort=10052
    7. zabbix_server


    Please advise me if i stray from the correct way of doing it thanks
  • highjo
    Junior Member
    • Feb 2013
    • 10

    #2
    Please anyone? thanks

    Comment

    • Alex_SYB
      Senior Member
      • Feb 2012
      • 133

      #3
      I would suggest finding the prebuilt deb for ubuntu.

      I use the prebuild rpm for rhel6 and it worked out of the box ..


      not sure on the build process

      Comment

      • highjo
        Junior Member
        • Feb 2013
        • 10

        #4
        Hi thanks for your response. But i've done quite some amount of configuration already and zabbix is working fine. If having Java Gateway enabled would mean to reinstalled what is being used and working so fine so far, then there is a problem.

        Thank you. Any other suggestions?

        Comment

        • tchjts1
          Senior Member
          • May 2008
          • 1605

          #5
          if you plan to compile the gateway, I think there is a little more to it than the few steps you have listed above.

          On Zabbix server, you need to have jdk installed.
          You'll also probably need to export paths just prior to the compile. I do that this way: (Your version/path may vary from mine)

          export JAVA_HOME=/opt/jdk1.7.0_07
          export PATH=$JAVA_HOME/bin:$PATH

          Then after you compile and move the zabbix_java directory into place, you may also need to edit the settings.sh file that is in the zabbix_java directory. In that file, I modified LISTEN_PORT and LISTEN_IP
          (For LISTEN_PORT, I run it on a port other than the default 10052)

          And you will also need to edit the StartJavaPollers= parameter in the zabbix_server.conf file.

          Note that I have never compiled Java gateway by itself. I have always done it along with --enable-server and all the other options I normally use when compiling.

          Comment

          • highjo
            Junior Member
            • Feb 2013
            • 10

            #6
            Hello
            thanks for your input. with the --prefix=/opt/zabbix_java_gateway do i need to move anything?

            thanks

            Comment

            • anjiytwok
              Member
              • Dec 2012
              • 44

              #7
              Based on my experience best way is followed the manual in zabbix

              given clearly. how to enable to java gateway

              Comment

              • tchjts1
                Senior Member
                • May 2008
                • 1605

                #8
                That will be fine if you want it to go to /opt/zabbix_java_gateway/zabbix_java

                And the binaries will actually go into /opt/zabbix_java_gateway/zabbix_java/sbin

                Comment

                • anjiytwok
                  Member
                  • Dec 2012
                  • 44

                  #9
                  Exactly incase if we need to configure and start the gateway.

                  in my case- /usr/local/sbin/zabbix_java

                  Comment

                  • highjo
                    Junior Member
                    • Feb 2013
                    • 10

                    #10
                    Thanks fellas, will try and revert.
                    thanks so much for your time

                    Comment

                    • highjo
                      Junior Member
                      • Feb 2013
                      • 10

                      #11
                      Hi Guys, Thanks for your help i got it installed and it's running. Just that when i added a JMX interface to listen to port 9090 on my server at 192.168.0.12. JMX buttong turned red with:
                      java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.Con
                      with some info found on this forum , i ended up on these 2 pages https://support.zabbix.com/browse/ZB...#comment-62570 and http://gabenell.blogspot.de/2010/04/...6-through.html

                      I fairly understood the whole concept but one thing that is throwing me out is this part :
                      PHP Code:
                      <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="10001" rmiServerPortPlatform="10002"/> 
                      question is which one should i change to 9090 and which one to change to 10052 ?

                      Obviously i am not understanding somethings .since zabbix_java_gateway is installed on the same box as the zabbix_server does zabbix_server talks to the zabbix_java_gateway through port 10052 or is it the case that zabbix_java_gateway uses port 10052 from its box(where it's installed) in order to talk to JMX on my host machine(monitored box) on port 9090 as i configured on the configuration page of zabbix_server?

                      am tempted to do this
                      PHP Code:
                       <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
                                
                      rmiRegistryPortPlatform="9090" rmiServerPortPlatform="10052" /> 
                      what if i have another tomcat instance running on the same machine and i want to use port 9091 for the second one, should my configuration be:
                      PHP Code:
                       <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
                                
                      rmiRegistryPortPlatform="9091" rmiServerPortPlatform="10052" /> 
                      now what happens to rmiServerPortPlatform="10052 which is repeted?

                      How do i get this done? thanks am getting close to my goal, and i would be grateful if you can help me achieve it

                      Thanks
                      Last edited by highjo; 07-05-2013, 14:52.

                      Comment

                      • highjo
                        Junior Member
                        • Feb 2013
                        • 10

                        #12
                        nobody to the rescue?

                        Comment

                        • token
                          Junior Member
                          • May 2013
                          • 8

                          #13
                          The Zabbix Java gateway is a TCP "port number stabilizer". JMX listens on a "random" port number which it negotiates somehow. Zabbix doesn't like that. The java gateway presents a stable port number.

                          Unless you are running the Zabbix server on the same system as the Java use:

                          Zabbix server <-eth--> Java gateway <-lo--> Java.

                          Where <-eth--> denotes traffic over a ethernet network interface and <-lo--> is traffic over the loopback interface.

                          Comment

                          Working...