Cacti monitoring Tomcat server implementation process

Source: Internet
Author: User
Tags install perl

1. First download the common monitoring template from the official website.

Generally, the tomcatstats-0.1.zip template is mostly used ,:

Http://forums.cacti.net/download/file.php? Id = 1, 12310,

Use wget download on a linux server, wget http://forums.cacti.net/download/file.php? Id = 12310, the following error is reported:

Connecting forums.cacti.net | 173.225.179.10 |: 80... already connected.

An HTTP request has been sent and is waiting for response... 301 Moved Permanently

Location: http://forums.cacti.net/[following to new URL]

You have redirected more than 20 times.

Can I enter a http://forums.cacti.net/download/file.php in Windows 7's google browser? Id = 12310 click "enter" to download, and then use the SecureFX client tool scp to connect to the linux server.

Then, the three files cacti_host_template_tomcat_server.xml,install.txt and tomcatstats. pl are decompressed.

2. Import the template on the website of the cacti master server

Open the website of the cacti Server:

Go to http://10.xx.1.xx/cacti/index.php-> Console-> Templates-> Import Templates, select the File Import (cacti_host_template_tomcat_server.xml) file, and select the Import button to load the tomcat template.
3 cacti server load atatstats. pl statistics script

Place the tomcatstats. pl obtained from tomcatstats-0.1.zip in the/var/www/html/cacti/scritps directory and grant the execution permission. <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> Environment + PHA + Environment/JxNyz9s/Wyv2 + Environment/Y1sbMqLTys/Environment + cq + o7ogICA8L3A + PHA + Environment/Environment + PHA + Environment + o6zI58/Co7o8L3A + PHA + tomcat ''9ssspw' http-9444

Http: // tomcat: tomcat0401@10.xx.3.xx: 9444/manager/status? XML = true connections: 2925944104 connections: 3892314112 connections: 3892314112 oror_max_time: 131 connector_error_count: 4464 connections: 19559190 connector_processing_time: 11552 connector_request_count: 8931 connections: 0 connections: 4 connections: connector_max_threads: 150 connections: connector_current_threads_busy: 1

?
You can also enter the above URL in the google browser of Windows 7, and many tomcat statistics will also appear, as shown below:

4. Modify the url of tomcat data retrieval in cacti.

Go to cacti ---> console ---> Data Input Methods ---> Tomcat Status

Modify fields in Input String

To: perl <path_cacti>/scripts/tomcatstats. pl

Note: replace the above username and password with the actual tomcat Administrator account and password.

The attachment of the manager account for which tomcat is to be enabled contains the description of Enable the Tomcat manager application, for example:

5. Configuration Adjustment of the web-side tomcat server

Add the following in tomcat/conf/server. xml:

<Service name = "Admin">

<Connector port = "9444" maxHttpHeaderSize = "8192"

MaxThreads = "150" minSpareThreads = "25" maxSpareThreads = "75"

EnableLookups = "false" disableUploadTimeout = "true"

AcceptCount = "100" scheme = "https" secure = "true"

ClientAuth = "false" sslProtocol = "TLS"/>

<Engine name = "Admin" defaultHost = "localhost">

<Realm className = "org. apache. catalina. realm. UserDatabaseRealm"

ResourceName = "UserDatabase"/>

<Host name = "localhost" appBase = "webapps"

UnpackWARs = "false" autoDeploy = "false"

XmlValidation = "false" xmlNamespaceAware = "false">

<Valve className = "org. apache. catalina. valves. FastCommonAccessLogValve"

Directory = "logs" prefix = "admin_access_log." suffix = ". txt"

Pattern = "combined" resolveHosts = "false"

FileDateFormat = "yyy-MM-dd"/>

<Context path = "/manager" cookies = "false"

DocBase = "server/webapps/manager" debug = "0"

Privileged = "true" reloadable = "false"/>

</Host>

</Engine>

</Service>

Then add in tomcat/conf/tomcat-users.xml

<Role rolename = "manager-gui"/>

<User username = "tomcat" password = "9 ssspw" roles = "manager-gui"/>

You can change the connection password for passwords and restart the tomcat service.

Go to the cacti server side and execute perl tomcatstats. pl 10. xx.3.xx: 9444 "tomcat ''9ssspw' http-9444 check statistics script to check whether tomcat data can be obtained, data is normal, as shown below:

[Root @ squid-2 scripts] #/usr/bin/perl tomcatstats. pl 10. xx.3.xx: 9444 'tomcat 'xxx' http-9444

Http: // tomcat: tomcat0401@10.254.3.29: 9444/manager/status? XML = true connections: 3409129096 connections: 3892314112 connections: 3892314112 connector_max_time: 131 connector_error_count: 2 connections: 20241 connector_processing_time: 168 connector_request_count: 5 connections: 0 connections: 4 connections: connector_max_threads: 150 connections: connector_current_threads_busy: 1

[Root @ squid-2 scripts] #

The following error message is recorded during debug:

[Root @ squid-2 scripts] # perl tomcatstats. pl 10. xx.3.xx: 9300 admin 9 ssspw http-9300

Can't locate XML/Simple. pm in @ INC (@ INC contains: /usr/local/lib64/perl5/usr/local/share/perl5/usr/lib64/perl5/vendor_perl/usr/share/perl5/vendor_perl/usr/lib64/perl5/usr /share/perl5 .) at tomcatstats. pl line 7.

BEGIN failed -- compilation aborted at tomcatstats. pl line 7.

You need to install XML: Simple

[Root @ squid-2 ~] # Find/-name cpan

/Usr/bin/cpan

[Root @ squid-2 ~] #/Usr/bin/cpan XML: Simple

......

Prepending/root/. cpan/build/XML-Simple-2.20-7zpaOY/blib/arch/root/. cpan/build/XML-Simple-2.20-7zpaOY/blib/lib to PERL5LIB for 'install'

Installing/usr/local/share/perl5/XML/Simple. pm

Installing/usr/local/share/perl5/XML/Simple/FAQ. pod

Installing/usr/local/share/man/man3/XML: Simple.3pm

Installing/usr/local/share/man/man3/XML: Simple: FAQ.3pm

Appending installation info to/usr/lib64/perl5/perllocal. pod

GRANTM/XML-Simple-2.20.tar.gz

/Usr/bin/make install -- OK

Warning (usually harmless): 'yaml' not installed, will not store persistent state

Continue to report the error File does not exist: at tomcatstats. pl line 20

[Root @ squid-2 scripts] #/usr/bin/perl tomcatstats. pl 10.254.3.29: 9300 tomcat xxx http-9300

File does not exist: at tomcatstats. pl line 20

Install the following components:

[Root @ squid-2 scripts] # yum install perl-HTML-Parser.i386 perl-HTML-Tagset.noarch perl-libwww-perl.noarch perl-URI.noarch

After tomcat is started, the following error is reported:

[Tomcat @ web-9 logs] $ cat catalina. out

2014-6-6 15:11:15 org. apache. catalina. core. AprLifecycleListener init

Information: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java. library. path:/usr/java/jdk1.6.0 _ 45/jre/lib/amd64/server:/usr/java/jdk1.6.0 _ 45/jre/lib/amd64: /usr/java/jdk1.6.0 _ 45/jre /.. /lib/amd64:/usr/local/lib:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

2014-6-6 15:11:16 org. apache. tomcat. util. digester. SetPropertiesRule begin

Warning: [SetPropertiesRule] {Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.

The connection pool configuration problem is found after tracking:

<Context path = "/n" docBase = "server/webapps/manager" debug = "0" reloadable = "true" crossContext = "false">

Remove debug = "0.

Analysis: the debug function may be replaced by other attributes in tomcat 6.0.37.

6 Cacti tomcat monitoring options

Graph templates has four options in total, as shown below:

Click the monitoring item to connect to the system. The ERROR message "RRDTool Says: ERROR: invalid y-grid format" is displayed,

Solution:

Connect to * Edit Graph Template --> Tomcat-Connection Rate --> Unit Grid Value (-- unit/-- y-grid) in the upper-right corner. The default Value is 1, remove and change it to 0.

Similarly, you can leave the 1048576 value blank when Tomcat-Heap Statistics does not output a graph.

If the figure cannot be displayed within 10 minutes, you can continue to wait. It takes a long time to figure out the tomcat monitoring template. After three hours, the figure is shown as follows:

1) Tomcat-Connection Rate: Connection Efficiency

2) Tomcat-Heap Statistics: JVM Heap usage


3) Tomcat-Thread Statistics: Thread status

4) Tomcat-Throughput: Tomcat Throughput

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.