apache/tomcat monitoring

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

FooMan
Posts: 2
Joined: Thu Sep 10, 2009 6:51 am

Post by FooMan »

Thanks for the great templates.

I am having problems with the heap statistics graph on a machine with 6GB of memory allocated to Tomcat. The graph exists but is blank and the totals show as nan. The data appears to be in the RRA.

The heap statistics work fine on another machine where Tomcat has 2GB of memory allocated.

I assume its to do with the size of the numbers but I can't work out how to fix it.
FooMan
Posts: 2
Joined: Thu Sep 10, 2009 6:51 am

Post by FooMan »

I have fixed my problem. It was nothing to do with the values. The jvm_memory_free RAA had the wrong permissions.
yugi
Posts: 6
Joined: Tue Sep 29, 2009 11:53 am

Post by yugi »

Hi,

I'd like to pass port, username, password and tomcat port as an arguments.
I tried to modify data input method to include those parameters as an arguments, and then filled respective fileds in data template (Custom data), but for some reason it doesn't work. Cacti log file states that:
WARNING: Result from CMD not valid. Partial Result: U

What am I doing wrong?
I'd like to be able to add multiple tomcat instances on the same machine, as well as use different ports on different machines. How should I do that? Create a multiple data input methods?
trevorj
Posts: 10
Joined: Thu May 14, 2009 1:19 pm

Post by trevorj »

Anyone have this working with tomcat 6?
lgpzll
Posts: 3
Joined: Thu Apr 29, 2010 3:21 am

why no data

Post by lgpzll »

when i use perl /var/www/cacti/scripts/tomcatstats.pl 192.168.3.11:8080/manager/status admin admin http-8080 has data
and use realtime see the data
but there is no data in cacti
why?
Attachments
real time has data
real time has data
dd.jpg (42.2 KiB) Viewed 6248 times
cacti no data
cacti no data
aa.jpg (46.73 KiB) Viewed 6248 times
quadiacau
Posts: 2
Joined: Mon Oct 24, 2011 12:44 am

Re: apache/tomcat monitoring

Post by quadiacau »

My graph for heap statistic , it run ok but don't have any data on gaph please help !

C:/cacti/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start=-86400 \
--end=-60 \
--title="tomcat - Heap Statistics" \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Megabytes" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="C\:/cacti/Apache2/htdocs/cacti/rra/27/229.rrd":jvm_memory_free:AVERAGE \
DEF:b="C\:/cacti/Apache2/htdocs/cacti/rra/27/229.rrd":jvm_memory_total:AVERAGE \
DEF:c="C\:/cacti/Apache2/htdocs/cacti/rra/27/229.rrd":jvm_memory_max:AVERAGE \
CDEF:cdefa=b,a,- \
CDEF:cdefbc=c,0,* \
AREA:cdefa#FAFD9EFF:"Used" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" \
AREA:a#2175D9FF:"Free":STACK \
GPRINT:a:LAST:" Current\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:b#002A8FFF:"Total\:" \
GPRINT:b:LAST:"Current\:%8.2lf %s" \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:cdefbc#ED7600FF:"Max\:" \
GPRINT:c:LAST:" Current\:%8.2lf %s" \
GPRINT:c:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:c:MAX:"Maximum\:%8.2lf %s\n" \
COMMENT:"TomcatStats v0.1 - Timothy Denike"
RRDTool Says:
OK
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: apache/tomcat monitoring

Post by gandalf »

Please see 2nd link of my sig to debug that. E.g. please verify, that correct data is returned and stored into rrd files
R.
Khue
Posts: 45
Joined: Fri Jun 29, 2012 3:43 pm

Re: apache/tomcat monitoring

Post by Khue »

Hey guys,

I am getting a similar issue to jehan.procaccia where my heap and connection rate graphs are not being rendered (broken link icons). I am trying to help myself as best as I can, but I am afraid my *Nix knowledge and my overall Cacti knowledge aren't high enough yet. I reviewed some of the stuff in Gandalf's second link and I did what I could without avail. I'm running Ubuntu 10.04. and I've checked the script and it seems to be returning valid data:

Code: Select all

admin@cacti:/var/data/cacti/scripts$ perl ./tomcatstats.pl server.domain.com:8444 admin passwords http-8080

jvm_memory_free:15388408 jvm_memory_max:518979584 jvm_memory_total:32571392 connector_max_time:2730 connector_error_count:0 connector_bytes_sent:915480 connector_processing_time:10217 connector_request_count:8 connector_bytes_received:0 connector_current_thread_count:2 connector_min_spare_threads: connector_max_threads:200 connector_max_spare_threads: connector_current_threads_busy:0

admin@cacti:/var/data/cacti/scripts$
Any suggestions on where I can go from here? Thanks in advance!
sharifu
Posts: 13
Joined: Mon Apr 16, 2012 10:08 am

Re: apache/tomcat monitoring

Post by sharifu »

I am getting error once following the readme in the zipfile.

Code: Select all

Jul 17, 2013 10:46:08 AM org.apache.catalina.startup.Catalina load
WARNING: Catalina.start using conf/server.xml: Error at (163, 44) : org.apache.catalina.valves.FastCommonAccessLogValve
Jul 17, 2013 10:46:08 AM org.apache.catalina.startup.Catalina start
SEVERE: Cannot start server. Server instance is not configured.

It relates to:

Code: Select all

<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
               directory="logs"  prefix="admin_access_log." suffix=".txt"
               pattern="combined" resolveHosts="false"
               fileDateFormat="yyy-MM-dd"/>

I am also getting following error:

Code: Select all

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base /opt/alfresco-4.2.c/tomcat/server/webapps/server/webapps/manager does not exist or is not a readable directory
	at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:140)
	at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4906)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5086)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)
I am using alfresco version 4.2c on centos 5 64bit.

I have changed the bit to add to sever.xml to:

Code: Select all

	<Service name="Admin">
		<Connector port="8444" 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">
	
				<Context path="/manager" cookies="false" docBase="manager"
					debug="0" privileged="true" reloadable="false" />
			</Host>
		</Engine>
	</Service>
sharifu
Posts: 13
Joined: Mon Apr 16, 2012 10:08 am

Re: apache/tomcat monitoring

Post by sharifu »

the script does not run on the server where cacti is set up. when i run it on the same server where tomcat is set up

Code: Select all

perl tomcatstats.pl tanaga:8080 admin specalfr http-8080
jvm_memory_free:5405460688 jvm_memory_max:16428302336 jvm_memory_total:16428302336 connector_max_time: connector_error_count: connector_bytes_sent: connector_processing_time: connector_request_count: connector_bytes_received: connector_current_thread_count: connector_min_spare_threads: connector_max_threads: connector_max_spare_threads: connector_current_threads_busy:
when i run it on cacti server i get

Code: Select all

perl tomcatstats.pl tanaga:8080 admin specalfr http-8080
Could not find tomcatstats.xml in ./ at tomcatstats.pl line 21
In browser http://admin:specalfr@tanaga:8080/manager/status?XML=true works fine
adduser3
Posts: 2
Joined: Wed Jan 14, 2015 11:25 am

Re: apache/tomcat monitoring

Post by adduser3 »

Hi guys,

I'm trying to configure Tomcat Heap Statistics Graph using TomcatStats-0.1 templates.
I am running latest Cacti version on windows machine.

I cannot manage to populate the data on the graph. Please, help.
Attached cacti log and graph view.

Thank you in advance.
Last edited by adduser3 on Mon Feb 02, 2015 10:46 am, edited 1 time in total.
adduser3
Posts: 2
Joined: Wed Jan 14, 2015 11:25 am

Re: apache/tomcat monitoring

Post by adduser3 »

Solved.
prtshd
Posts: 1
Joined: Thu Feb 18, 2016 2:58 am

Re: apache/tomcat monitoring

Post by prtshd »

@adduser Please list the steps you did to get this working. After adding entry to server.xml in Tomcat as listed in the steps I am unable to start Tomcat. I am using tomcat 8.0
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests