Ad Widget

Collapse

Zapcat 1.3 released, adds templates for Java, Hibernate and Tomcat servlet containers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kees Jan Koster
    Member
    • Oct 2007
    • 83

    #1

    Zapcat 1.3 released, adds templates for Java, Hibernate and Tomcat servlet containers

    Hi, I just released version 1.2 of Zapcat. My site has a lot of information on how to monitor Java apps, troubleshoot memory issues and thread limits. http://www.kjkoster.org/zapcat/

    If you are using an older version of Zapcat, this is a must-upgrade version. It saves you tons of work configuring hosts.
    Last edited by Kees Jan Koster; 31-12-2007, 01:20.
  • Kees Jan Koster
    Member
    • Oct 2007
    • 83

    #2
    On the Zapcat documentation site, two more tutorials have been added, one for the Oracle IAS/OC4J container and one for Jetty.

    http://www.kjkoster.org/zapcat/Jetty_How_To.html for Jetty and
    http://www.kjkoster.org/zapcat/Oracl...4J_How_To.html for Oracle IAS/OC4J

    Comment

    • standist
      Junior Member
      • Jan 2008
      • 11

      #3
      Can I monitor a jdbcconnectionpool is available or not throug jmx.

      Can I monitor a jdbcconnectionpool is available or not throug jmx.
      there is some situation like the network connection between tomcat and oracle is broken,so I want to check if the jdbcconnectionpool is available?
      If it is possible, how can I do this.

      Comment

      • Kees Jan Koster
        Member
        • Oct 2007
        • 83

        #4
        Perhaps. :-)

        Dear Standist,

        This is something that cannot be statically monitored. I advise you to write a really simple JMX MBean, with a single property named "getAlive()". In that property, perform a trivial SQL query of some kind, like "SELECT 1" or maybe "SELECT COUNT(*) FROM someReallySmallTable".

        You can then poll that bean from Zabbix via Zapcat.

        Kees Jan

        Comment

        • standist
          Junior Member
          • Jan 2008
          • 11

          #5
          thanks

          does zapcat document mentioned how to invoke a customer's bean?

          Comment

          • standist
            Junior Member
            • Jan 2008
            • 11

            #6
            zabbix_get

            I test zapcat with zabbix server it works fine
            but I test witch zabbix_get,it repsonse with "ZBX_NOTSUPPORT"

            Comment

            • Kees Jan Koster
              Member
              • Oct 2007
              • 83

              #7
              Dear Standist,

              There is a tutorial on invoking mbeans in the Zapcat documentation: http://www.kjkoster.org/zapcat/Exploring_JMX.html

              Note that zabbix_get does not work, because the Zapcat agent is not a regular Zabbix agent. You can use telnet instead, like so:

              $ telnet localhost 10052
              Connected to localhost.
              Escape character is '^]'.
              jmx[java.lang:type=Runtime][VmVersion]
              ZBXD
              1.5.0_13-119Connection closed by foreign host.
              $ _

              Comment

              • standist
                Junior Member
                • Jan 2008
                • 11

                #8
                Thanks for sharing

                Thanks for sharing

                Comment

                • OneLoveAmaru
                  Member
                  • Jan 2008
                  • 41

                  #9
                  The title of this thread says 1.3 but on your site it's 1.2? That's not my biggest issue though.

                  The biggest issue is that for all of the zapcat items to monitor tomcat are saying "Not supported by ZABBIX agent". Zabbix agent is 1.4.4 and server is 1.4.5. Ideas? I can get to the zapcat page just fine on the server. I used the tomcat template that was supplied with 1.2. Tomcat version is 5.5, java is 1.5.

                  I am running debian etch 4.0 on the host system, Ubuntu 8.04 for the zabbix server. In /etc/init.d/tomcat55 I have:

                  # Look for the right JVM to use
                  for jdir in $JDK_DIRS; do
                  if [ -r "$jdir/bin/java -Dcom.sun.management.jmxremote" -a -z "${JAVA_HOME}" ]; then
                  JAVA_HOME_TMP="$jdir"
                  # checks for a real JDK like environment, needed to check if
                  # really the java-gcj-compat-dev package is installed
                  if [ -r "$jdir/bin/jdb" ]; then
                  JAVA_HOME="$JAVA_HOME_TMP"
                  fi
                  fi
                  done

                  Maybe I have it in the wrong spot...? Anyone good with debian and have zapcat and tomcat working great with your zabbix server?? Any help is appreciated. Below this is what my catalina log says. Thanks a lot!

                  1.5.0.10/jre/lib/i386:/usr/lib/jvm/java-1.5.0-sun-1.5.0.10/jre/../lib/i386
                  Jul 2, 2008 11:17:20 AM org.apache.coyote.http11.Http11BaseProtocol init
                  INFO: Initializing Coyote HTTP/1.1 on http-8180
                  Jul 2, 2008 11:17:20 AM org.apache.catalina.startup.Catalina load
                  INFO: Initialization processed in 1250 ms
                  Jul 2, 2008 11:17:21 AM org.apache.catalina.core.StandardService start
                  INFO: Starting service Catalina
                  Jul 2, 2008 11:17:21 AM org.apache.catalina.core.StandardEngine start
                  INFO: Starting Servlet Engine: Apache Tomcat/5.5
                  Jul 2, 2008 11:17:21 AM org.apache.catalina.core.StandardHost start
                  INFO: XML validation disabled
                  Jul 2, 2008 11:17:22 AM org.apache.catalina.startup.HostConfig deployWAR
                  INFO: Deploying web application archive tomcat.war
                  Jul 2, 2008 11:17:22 AM org.apache.coyote.http11.Http11BaseProtocol start
                  INFO: Starting Coyote HTTP/1.1 on http-8180
                  Jul 2, 2008 11:17:22 AM org.apache.jk.common.ChannelSocket init
                  INFO: JK: ajp13 listening on /0.0.0.0:8009
                  Jul 2, 2008 11:17:22 AM org.apache.jk.server.JkMain start
                  INFO: Jk running ID=0 time=0/42 config=null
                  Jul 2, 2008 11:17:23 AM org.apache.catalina.storeconfig.StoreLoader load
                  INFO: Find registry server-registry.xml at classpath resource
                  Jul 2, 2008 11:17:23 AM org.apache.catalina.startup.Catalina start
                  INFO: Server startup in 2319 ms

                  Comment

                  • OneLoveAmaru
                    Member
                    • Jan 2008
                    • 41

                    #10
                    Yeah i'm pretty positive I have that line in the wrong spot in /etc/init.d/tomcat55..... but I can't figure out where it goes... Any help would be awesome!

                    Comment

                    • Kees Jan Koster
                      Member
                      • Oct 2007
                      • 83

                      #11
                      Dear OneLoveAmaru,
                      1. Use jconsole to test that JMX is enabled and working on your Tomcat server. If jconsole cannot connect locally, neither can Zapcat. Remote JMX is another ballgame altogether. If you cannot run jconsole on the machine locally (perhaps because it is headless) you have to trust it to work instead. :-/
                      2. You placed the test in the wrong place. This is in an if statement. Note that the line starts with "if". I have no Linux machines, so I cannot help you find the right spot.
                      3. In your catalina.out I am missing something along the lines of the following.
                        INFO: Deploying web application archive zapcat-1.3-beta.war
                        In your case that should be 1.2, maybe. Are you sure that Zapcat is in your webapps dir?

                      Comment

                      • OneLoveAmaru
                        Member
                        • Jan 2008
                        • 41

                        #12
                        I actually have auto deploy disable in tomcat. I deployed the war file manually and I can access it's web page, so I know tomcat picked it up or else there wouldn't be a webpage.

                        Well, since I have that line in the wrong spot, then zapcat can't connect and of course the zabbix server won't be able to read anything.

                        I guess I'm in uncharted territory, I did some searches and can't find anyone who got zapcat and zabbix working with Debian linux. I guess when I figure it out I'll post back here to help the other Debian peeps who want the same setup.

                        Unless someone out there can do it but never posted.... I am always down for some help.
                        Last edited by OneLoveAmaru; 05-07-2008, 00:26.

                        Comment

                        • Kees Jan Koster
                          Member
                          • Oct 2007
                          • 83

                          #13
                          Good to hear that the zapcat pages are visible in your Tomcat server. Do you get any error messages when you access the front page, or the mbeans list page?

                          Also, try telnetting to the zapcat port to see what happens.

                          Uhm... have you checked your firewalls between the Zapcat and Zabbix machines.

                          Are you able to connect to the machine using jconsole?

                          Kees Jan

                          Comment

                          • OneLoveAmaru
                            Member
                            • Jan 2008
                            • 41

                            #14
                            I played around a whole bunch last night and I got it so that I can get in with JConsole now. I do have the server behind a firewall with NAT and couldn't get in that way but as soon as I jumped on the VPN, then Jconsole would connect. I can see everything about tomcat. For debian / ubuntu users the trick is to add these lines to /etc/default/tomcat5.5 and not /etc/init.d/tomcat5.5.

                            CATALINA_OPTS="-Djava.awt.headless=true -Xmx512M -server
                            -Dcom.sun.management.jmxremote \
                            -Dcom.sun.management.jmxremote.port=8889 \
                            -Dcom.sun.management.jmxremote.ssl=false \
                            -Dcom.sun.management.jmxremote.authenticate=false"

                            The first line there about Xmx512 is something custom the Database admin put there, I added the rest. After I added those I did a /etc/init.d/tomcat5.5 restart. Then I checked to see if it was listening on port 8889 with a "netstat -a" and sure enough, it was listening on 8889.

                            So now I'm able to connect with jsonsole after all of this as long as I'm local with no firewall/nat between us. I tried just opening port 8889 to that server but jconsole would take 5 minutes and then say error connecting. I think it has to do with jmx opening a 2nd data port that is not open on the firewall.



                            That is where I got a lot of good information from. I found that link on some other forum. Unfortunately it doesn't have high page rank so I couldn't find it when searching in google.

                            OK, so now I have all of that, the next step is to get a zabbix agent running on port 10052. I already have a zabbix agent running on 10050 for the unix template to monitor system services and snmp is also on there, but using default port of 161 for that.



                            As you can see, I do have something listening on port 10052 but on your page it says I need to get a zabbix agent running on port 10052... so that's where I am stuck now. You put some code there I need to include when compiling the agent but I have never needed to compile the agent. Do I need to download the source of a zabbix agent and then compile it?? I've made it this far so I can be far off from getting it all right.

                            Oh and I know the screenshot says port 8443, I was messing around with the port #'s and I made the screenshot when it was on port 8443. It's back on port 8889. With your tomcat template I see you have a lot of different lines trying to connect on different ports. Is there a port for jconsole that you specified?? If I run this in port 8889, do I need to change anything in your template to connect on that port? Or is the zabbix agent I compile supposed to connect on those ports locally? Thanks a lot for your help!
                            Last edited by OneLoveAmaru; 05-07-2008, 18:26.

                            Comment

                            • OneLoveAmaru
                              Member
                              • Jan 2008
                              • 41

                              #15
                              Oh and there is no firewall/nat between my zabbix server and the test server I have zapcat on. I did try to add the tomcat template to the host again and i just got all errors saying zabbix agent not supported. So obviously I do need another zabbix agent with that code in there from your page. I'll play some more with that. In the meantime, any advice you have I would love to hear it! Thanks.

                              Comment

                              Working...