Ad Widget

Collapse

Tomcat Monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bharathu
    Member
    • Dec 2005
    • 56

    #1

    Tomcat Monitoring

    Hi,

    I need help in TomCat monitoring. I have referred the Zabbix Manual for JMX thing. But i have a basic question as I am very new to Java and tomacat andd stuff. My questions are

    1) Can anyone tell me where exactly we need to type these commands given below? What is meant by the so called TomCat environment?? Forgive me for this basic questions!!

    Also can any port number be used?

    In my tomcat environment, I enable it by setting the following options for the jvm:

    -Dcom.sun.management.jmxremote \
    -Dcom.sun.management.jmxremote.port=xxxxx \
    -Dcom.sun.management.jmxremote.ssl=false \
    -Dcom.sun.management.jmxremote.authenticate=true \
    -Dcom.sun.management.jmxremote.password.file=/path/java/jre/lib/management/jmxremote. password"
    2) The next question is where can I type the following command?
    With tomcat, I can do the following:

    curl -s -u<jmxusername>:<jmxpassword> 'http://<tomcat_hostname>/manager/jmxproxy/?qry=java.lang:type=Threading'

    The Zabbix Manual/Post on this topic was very extensive. But for a novice like me, if the above 2 questions can be answered it will be great.

    I am also working on a detailed documentation on Zabbix installation. Hope to share with you all once I try all features. My manual is aimed for novice users like me to appreciate this wonderful tool. Please help me with the above 2 doubts
  • Bharathu
    Member
    • Dec 2005
    • 56

    #2
    plz help

    Can anyone give me some idea on the above 2 questions I posted?

    Comment

    • Bharathu
      Member
      • Dec 2005
      • 56

      #3
      Some Progress

      Greetings!!

      I made some changes to the Catalina.bat file of Tomcat. these are the following changes

      set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=C:/Program Files/Java/jdk1.5.0_06/jre/lib/management/jmxremote.password
      Please guide me if i am going in the right direction.

      I need some help on the usage of CURL. Any advise from anyone??

      Comment

      • Kees Jan Koster
        Member
        • Oct 2007
        • 83

        #4
        Dear Bharathu,

        I'm not sure if you still have these questions, but I have written a precise howto for Tomcat monitoring with Zabbix and Zapcat on my web site.



        Kees Jan

        Comment

        • consultorpc
          Junior Member
          • Apr 2008
          • 16

          #5
          We are trying to install this agent to interact a Zabbix 1.6 server without luck.

          Have you installed on a 1.6 ?

          TIA.

          Comment

          • Kees Jan Koster
            Member
            • Oct 2007
            • 83

            #6
            What error are you seeing?

            Comment

            • consultorpc
              Junior Member
              • Apr 2008
              • 16

              #7
              We have managed to get the Tomcat part working and it's generating the .xml file, but when trying to import to zabbix server doen't seems to be working, it just show nothing.

              Comment

              • Kees Jan Koster
                Member
                • Oct 2007
                • 83

                #8
                I haven't tried the XML upload in 1.6. Check the http error logs, make sure you have PHP's XML support module installed.

                You can try exporting a host and seeing if the format of the import/export files has changed.

                Comment

                • consultorpc
                  Junior Member
                  • Apr 2008
                  • 16

                  #9
                  I have checked the httpd error logs and it shows :

                  [error] [client x.x.x.x] PHP Parse error: syntax error, unexpected ')' in /home/html/zabbix/include/import.inc.php on line 510, referer: http://localhost/monitoring/exp_imp....3fb420un090fw2

                  Also when I checked the item fields between the generated zapcat generated xml and the exported 1.6.3 host xml, there are a lot of new fields in items. Is that stopping the import, because of not having all fields in the importing xml file?

                  Comment

                  • consultorpc
                    Junior Member
                    • Apr 2008
                    • 16

                    #10
                    php has xml support, because we had imported some templates in past without any issues. The phpinfo shows :

                    XML Support active
                    XML Namespace Support active

                    I have created the host with the available information on the xml and exported it. Here are the difference of xml files:

                    exported from zapcat:

                    ####################START#########################

                    <zabbix_export version="1.0" date="08.04.09" time="04.07">

                    <hosts>

                    <host name="tomcat_localhost">
                    <dns>tomcat_localhost</dns>
                    <ip>x.x.x.x</ip>
                    <port>10052</port>
                    <groups>
                    </groups>

                    <items>

                    <item type="0" key="jmx[Catalina:type=Server][serverInfo]" value_type="1">
                    <description>tomcat version</description>
                    <delay>3600</delay>
                    <history>90</history>
                    <trends>365</trends>
                    <formula>1</formula>
                    <snmp_community>public</snmp_community>
                    <snmp_oid>interfaces.ifTable.ifEntry.ifInOctets. 1</snmp_oid>
                    <snmp_port>161</snmp_port>
                    </item>
                    </items>
                    <triggers>
                    </triggers>
                    <graphs>
                    </graphs>
                    </host>
                    </hosts>
                    </zabbix_export>

                    ######################END########################

                    Exported from zabbix 1.6.3

                    #####################START########################

                    <?xml version="1.0" ?>
                    - <zabbix_export version="1.0" date="08.04.09" time="04.02">
                    - <hosts>
                    - <host name="tomcat_localhost">
                    <useip>1</useip>
                    <dns>tomcat_localhost</dns>
                    <ip>x.x.x.x</ip>
                    <port>10052</port>
                    <status>0</status>
                    <groups />
                    - <items>
                    - <item type="0" key="jmx[Catalina:type=Server][serverInfo]" value_type="3">
                    <description>tomcat version</description>
                    <ipmi_sensor />
                    <delay>30</delay>
                    <history>90</history>
                    <trends>365</trends>
                    <status>3</status>
                    <units />
                    <multiplier>0</multiplier>
                    <delta>0</delta>
                    <formula>1</formula>
                    <lastlogsize>0</lastlogsize>
                    <logtimefmt />
                    <delay_flex />
                    <params>DSN=<database source name>\nuser=<user name>\npassword=<password>\nsql=<query></params>
                    <trapper_hosts />
                    <snmp_community>public</snmp_community>
                    <snmp_oid>interfaces.ifTable.ifEntry.ifInOctets. 1</snmp_oid>
                    <snmp_port>161</snmp_port>
                    <snmpv3_securityname />
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authpassphrase />
                    <snmpv3_privpassphrase />
                    </item>
                    </items>
                    </host>
                    </hosts>
                    </zabbix_export>

                    ###############END##########################

                    The sad part is that, I have removed the added host, when I tried to import the exported xml file from zabbix, it shows the same error on httpd error log also there are nothing on zabbix Host list.

                    Also I did a zabbix_get from the zabbix server :

                    # zabbix_get -s x.x.x.x -p 10052 -k jmx[Catalina:type=Server][serverInfo]
                    ZBX_NOTSUPPORTED

                    The Type of this items are Zabbix_agent right ?

                    Comment

                    • consultorpc
                      Junior Member
                      • Apr 2008
                      • 16

                      #11
                      Hi,

                      The import issue was a minor bug in Zabbix 1.6.3 and it is cleare with the patch.

                      Join the friendly and open Zabbix community on our forums and social media platforms.


                      After the import, now the items shows Error: Not supported by ZABBIX agent for Item : jmx[Catalina:type=Server][serverInfo] .

                      Is there any other configuration needed on zapcat? I just copied the zapcat.war to webapps folder, added -Dcom.sun.management.jmxremote to the tomcat startup script options and it starts listening on port 10052. Please help me to solve this problem.

                      Thanks

                      consultorpc

                      Comment

                      • consultorpc
                        Junior Member
                        • Apr 2008
                        • 16

                        #12
                        FYI. I have imported the templates coming with zapcat-1.2 (Template_Hibernate.xml, Template_Java.xml and Template_Tomcat.xml)

                        Now some of the keys are with status active, like jmx[java.lang:type=ClassLoading][TotalLoadedClassCount] and most of the keys are with status not supported.

                        Comment

                        • mlange
                          Member
                          • Sep 2008
                          • 78

                          #13
                          You should go and create your own templates, maybe the provided ones are not up-to-date.

                          Comment

                          Working...