<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blog.mirko-pluhar.de &#187; Debian</title>
	<atom:link href="http://blog.mirko-pluhar.de/category/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mirko-pluhar.de</link>
	<description>Aus Neuseeland. Ohne Umlaute.</description>
	<lastBuildDate>Wed, 28 Dec 2011 02:27:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Hyperic: Configure Tomcat 5.0 for Monitoring in Ubuntu</title>
		<link>http://blog.mirko-pluhar.de/2007/05/31/hyperic-configure-tomcat-50-for-monitoring-in-ubuntu/</link>
		<comments>http://blog.mirko-pluhar.de/2007/05/31/hyperic-configure-tomcat-50-for-monitoring-in-ubuntu/#comments</comments>
		<pubDate>Thu, 31 May 2007 06:03:05 +0000</pubDate>
		<dc:creator>mirko</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://duennes.wordpress.com/2007/05/31/hyperic-configure-tomcat-50-for-monitoring-in-ubuntu/</guid>
		<description><![CDATA[Update: Setting up Tomcat Monitoring for Ubuntu is exactly how it&#8217;s decribed in the official documentation. I was a little bit confused by the symbolic links in the filesystem and thought myself to be wiser than the Hypericans Sorry about that. There ist one little difference is in the configuration of the Apache-Tomcat connector. But [...]]]></description>
			<content:encoded><![CDATA[<p>Update: Setting up Tomcat Monitoring for Ubuntu is exactly how it&#8217;s decribed in the official documentation. I was a little bit confused by the symbolic links in the filesystem and thought myself to be wiser than the Hypericans <img src='http://blog.mirko-pluhar.de/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  Sorry about that. There ist one little difference is in the configuration of the Apache-Tomcat connector. But maybe its worth reading because I wrote something about howto protect the webapp if you&#8217;re using Apache.</p>
<p>Setting up Tomcat Monitoring  in Hyperic is easy by reading the <a href="http://support.hyperic.com/confluence/display/DOCSHQ30/Tomcat+5.0+server" target="_blank">documentation.</a><br />
<del datetime="2007-05-31T19:29:11+00:00">If you&#8217;re going to do that in Debian-based Distributions it&#8217;s a little bit different to the original documentation.</del>  I set up tomcat monitoring on <a href="http://www.gnusolaris.org/gswiki" target="_blank">Nexenta GNU/OpenSolaris</a> and <a href="http://www.ubuntu.com/" target="_blank">Ubunbtu 6.06 LTS</a> Here  it ist:</p>
<p>At first download an install an Hyperic Agent on your Tomcat-Machine. For Ubuntu use <code>hyperic-hq-agent-n.n.n-nnn-x86-linux.tgz</code> oder for 64-Bit AMD Systems <code>hyperic-hq-agent-n.n.n-nnn-amd64-linux.tgz</code>.<br />
My Nexenta installation is in Virtual Machine  on a x86-System, so I got <code> 	hyperic-hq-agent-3.0.4-389-noJRE.tgz</code> and installed a Java Runtime Environement for myself.</p>
<p>To enable monitoring of Tomcat servers and services the Tomcat server must be instrumented using a filter to collect metrics and a webapp to deliver the metric data into HQ. The web application, filter and any additional jars are packaged in the HQ agent directory under <code>product_connectors/servlet-3.0.4</code> for HQ Agent 3.0.4. All commands below should be issued from this directory.</p>
<p>If you are using Apache/JK to front your Tomcat installation you will need to setup a mount point. This can be done by adding the following to your Apache configuration <code>/etc/apache2/conf.d/jk</code> file.<br />
You can find an example in <code>/usr/share/doc/libapache2-mod-jk/httpd_example_apache2.conf</code></p>
<p><code>JkMount /hyperic-hq/* ajp13_worker</code></p>
<p>Keep in mind that depending on how you configured your Apache the whole world can access the hyperic webapp ! I would advise you to use secure it by set up up the following Apache directive:<br />
<code>&lt;Location&gt;<br />
Order Deny,Allow<br />
Deny from all<br />
Allow from localhost<br />
#or<br />
Allow from iphyperichq<br />
&lt;/Location&gt;</code></p>
<p>The first step to making Tomcat monitorable is to install the filter, JMX jars and webapp. These are used to collect internal Tomcat metrics.</p>
<p><code>cp libs/hq-filter.jar /usr/lib/tomcat5/common/lib<br />
cp libs/mx4j-jmx.jar /usr/lib/tomcat5/common/lib<br />
cp -R hyperic-hq /usr/lib/tomcat5/webapps</code></p>
<p>In fact you can copy your files also to <code>/usr/share/tomcat5/</code> which is a symbolic link to <code>/usr/lib/tomcat5/</code>.</p>
<p>Finally, the filter must be enabled. The following must be added to <code>/etc/tomcat5/web.xml</code>. Keep in mind that each tag type must be grouped together.</p>
<p>&lt;filter&gt;<br />
&lt;filter-name&gt;JMXFilter&lt;/filter-name&gt;<br />
&lt;filter-class&gt;org.hyperic.hq.product.servlet.filter.JMXFilter&lt;/filter-class&gt;</p>
<p>&lt;!&#8211; Uncomment the following line to enable response time logging.<br />
The directory you specify as the param can include properties<br />
referenced from the System.properties of the vm.</p>
<p>The ResponseTime log file will by default store the last 1 hour&#8217;s<br />
worth of response time data. This file gets truncated as soon as<br />
data is succesfully sent into the server. The file is named uniquely<br />
for each webapp in the form: yourContextName_HQResponseTime.log</p>
<p>If this fragment is included in the global web.xml for the container,<br />
all webapps in it will generate response time data, and have logs<br />
following the format described above. You can enable it individually<br />
on each webapp as well if you dont want every webapp to generate<br />
response time data</p>
<p>&#8211;&gt;<br />
&lt;!&#8211;<br />
&lt;init-param&gt;<br />
&lt;param-name&gt;responseTimeLogDir&lt;/param-name&gt;<br />
&lt;param-value&gt;/var/lib/tomcat5/logs&lt;/param-value&gt;<br />
&lt;/init-param&gt;<br />
&#8211;&gt;</p>
<p>&lt;!&#8211; these are optional parameters which you can override to optimize logging &#8211;&gt;<br />
&lt;!&#8211;<br />
&lt;init-param&gt;<br />
&lt;param-name&gt;bufferSize&lt;/param-name&gt;<br />
&lt;param-value&gt;8k&lt;/param-value&gt;<br />
&lt;/init-param&gt;</p>
<p>&lt;init-param&gt;<br />
&lt;param-name&gt;bufferTime&lt;/param-name&gt;<br />
&lt;param-value&gt;1h&lt;/param-value&gt;<br />
&lt;/init-param&gt;<br />
&#8211;&gt;<br />
&lt;/filter&gt;</p>
<p>&lt;filter-mapping&gt;<br />
&lt;filter-name&gt;JMXFilter&lt;/filter-name&gt;<br />
&lt;url-pattern&gt;/*&lt;/url-pattern&gt;<br />
&lt;/filter-mapping&gt;</p>
<p>&lt;listener&gt;<br />
&lt;listener-class&gt;org.hyperic.hq.product.servlet.filter.JMXSessionListener&lt;/listener-class&gt;<br />
&lt;/listener&gt;</p>
<p>&lt;servlet&gt;<br />
&lt;servlet-name&gt;JMXWebappMetricServlet&lt;/servlet-name&gt;<br />
&lt;servlet-class&gt;org.hyperic.hq.product.servlet.filter.JMXFilterInitServlet&lt;/servlet-class&gt;<br />
&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br />
&lt;/servlet&gt;</p>
<p>This can be tested by verifying your webapps show up correctly in the <a href="http://localhost:8180/hyperic-hq/jmx-attributes?dmp=hyperic-hq:*" target="_blank">JMX Servlet</a>. You may need to modify the hostname in the URL if your jmxUrl is configured relative to the agent host or if you use Apache in front of your Tomcat-Installation as described above.</p>
<p><strong>Configure Tomcat 5.0 for Log Tracking</strong></p>
<p>To enable Log Tracking in HQ, Tomcat must be configured with <code>log4j</code>. These steps are based on the standard Tomcat documentation.</p>
<p>On a blank Ubuntu-Installation /usr/lib/tomcat5/common/classes/log4j.properties does not exist,  so create one with the following example contents:</p>
<p><code>#These properties can be modified.  The only requirement is that the<br />
#ConversionPattern includes the priority (%p)<br />
log4j.rootLogger=INFO, R<br />
log4j.appender.R.File=${catalina.home}/logs/tomcat.log<br />
log4j.appender.R.MaxBackupIndex=1<br />
log4j.appender.R.MaxFileSize=5000KB<br />
log4j.appender.R.layout.ConversionPattern=%d %-5p [%c{1}] %m%n<br />
log4j.appender.R.layout=org.apache.log4j.PatternLayout<br />
log4j.appender.R=org.apache.log4j.RollingFileAppender</code></p>
<p>Next, copy the following jars unless they have already been installed:</p>
<p><code>cp pdk/lib/log4j.jar /usr/lib/tomcat5/common/lib<br />
cp pdk/lib/commons-logging.jar /usr/lib/tomcat5/common/lib</code></p>
<p>Restart Tomcat for the changes to take effect: <code>/etc/init.d/tomcat5 restart</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mirko-pluhar.de/2007/05/31/hyperic-configure-tomcat-50-for-monitoring-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

