<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Ask the German</title>
	
	<link>http://www.askthegerman.com</link>
	<description>"the owl of Minerva spreads its wings only with the falling of the dusk"</description>
	<lastBuildDate>Thu, 30 Apr 2009 10:26:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AskTheGerman" /><feedburner:info uri="askthegerman" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Monitor your Tomcat Servlet on a regular basis</title>
		<link>http://feedproxy.google.com/~r/AskTheGerman/~3/2bzLUCHUAQQ/274</link>
		<comments>http://www.askthegerman.com/archives/274#comments</comments>
		<pubDate>Thu, 30 Apr 2009 08:30:55 +0000</pubDate>
		<dc:creator>Volker</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[TomCat]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[Webserver]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=274</guid>
		<description><![CDATA[Lets assume you have enabled the monitoring capabilities of your tomcat. If you do not know how to achieve this see my earlier posting here about. Now it is cool to monitor your application on a regular basis. Because I&#8217;m used to shell scripting in LINUX I present you here a scripting solution within a [...]]]></description>
			<content:encoded><![CDATA[<p>Lets assume you have enabled the monitoring capabilities of your tomcat.<br />                   If you do not know how to achieve this see my earlier <a href="/archives/252" title="Enabling tomcat monitoring capabilities">posting</a> here about.</p>
<p>Now it is cool to monitor your application on a regular basis. <br />                   Because I&#8217;m used to shell scripting in LINUX I present you here a scripting solution within a bash shell. But I&#8217;m sure you can do the same in Windows. <br />                   The idea is to set up a cron job ( for windows use the scheduler) and get the statuspage from your tomcat every &#8211; lets say &#8211; five minutes.<br />                   Get some of the interesting values out of this page and save them in a csv &#8211; File.<br />                   Create a new file every day. Perhaps you want to use this files as input for a spreadsheet program to create some nice charts.</p>
<p>But to be honest &#8211; this is a very special script &#8211; you have to adopt it to your needs.<br />                   This are the basic prerequisites:</p>
<ul>
<li>you need linux to run it (this script is developed on a SUSE &#8211; Distribution)</li>
<li>eventually you need to install some tools (I think the w3m tool is not bundled with every linux distribution)</li>
<li>this script only! works correct with a tomcat 6.0 version</li>
</ul>
<p><font face="Courier" size="1"><span style="color: #006600">#!/bin/bash<br />                   # -configure below-</span><br />                   HTTPPORT=&quot;8080&quot; &nbsp;&nbsp; <span style="color: #0066ff"># The http Port of your tomcat</span><br />                   JKPORT=&quot;8709&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0066ff"># The Modjk Port of your tomcat (if your tomcat should be reachable from a apache webserver)</span><br />                   SERVER=&quot;localhost:$HTTPPORT&quot; <span style="color: #0066ff"># you can even monitor a tomcat on another server!</span><br />                   USER=&quot;tomcat-oper&quot; <span style="color: #0066ff"># the account and</span><br />                   PW=&quot;IwantItAll&quot;&nbsp;&nbsp;&nbsp; <span style="color: #0066ff"># password you have defined in tomcat-users.xml</span><br />                   APPL=&quot;CoolAppl&quot; &nbsp;&nbsp; <span style="color: #0066ff"># The name of your application</span><br />     <span style="color: #006600"># -configure above-</span><br />                   TODAY=`date &#8216;+%m-%d-%y&#8217;`<br />                   TIME=`date &#8216;+%H:%M:%S&#8217;`<br />                   OUTFILE=&quot;tomcat-stats-${TODAY}.csv&quot;<br />     <span style="color: #006600">#</span><br />     <span style="color: #006600">#set -x</span>&nbsp;&nbsp; <span style="color: #0066ff"># uncomment if you want to improve the script or if you are searching for a bug</span><br />     <span style="color: #006600">#</span><br />     <span style="color: #006600">#</span> <span style="color: #0066ff"># If there is no csv-file create one and put a headerline in</span><br />                   if !(test -e $OUTFILE) then<br />          &nbsp; echo &quot;Time,FreeMemory,UsedMemory,MaxMemory,HttpThreadsMax,<br />      &nbsp; HttpThreadsBusy,ModJKThreads,ModJKThreadsBusy,Sessions&quot; &gt; $OUTFILE<br />                   fi<br />     <span style="color: #006600">#</span> <span style="color: #0066ff"># get the statuspage from tomcat &#8211; filter it for the wanted informations &#8211; and create a temporary file</span><br />                   &nbsp;  w3m -dump http://${USER}:${PW}@${SERVER}/manager/status/all| \<br />                   &nbsp;  egrep &quot;(memory|thread|Active sessions|<br />        &nbsp; ^JVM|$HTTPPORT|$JKPORT|${APPL})&quot; &gt;/tmp/tomcat-status<br />     <span style="color: #006600">#<br />                   #</span> <span style="color: #0066ff"># put the values in variables / uncomment to get a better understanding of the process</span><br />     <span style="color: #006600">#</span><br />                   while read line<br />                   &nbsp;&nbsp;    do<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;      case $line in<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;           JVM)   read line<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  JVM_VALUE=`echo $line | awk &#8216;{print($3 &quot;,&quot; $7 &quot;,&quot; $11)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment </span></font><font face="Courier" size="1"><span style="color: #0066ff">below </span></font><font face="Courier" size="1"><span style="color: #0066ff">if you want to debug</span></font><font face="Courier" size="1"><span style="color: #006600"><br />            #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;JVM_VALUE: &lt;$JVM_VALUE&gt;&quot;</span><span style="color: #0066ff"></span><br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;            *${HTTPPORT}) read line<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HTTP_MAX_THREADS=`echo $line |awk &#8216;{print(&quot;,&quot; $3)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #006600"></span> <span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment if you want to debug<br />     </span></font><font face="Courier" size="1"><span style="color: #006600">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;HTTP_MAX_THREADS: &lt;$HTTP_MAX_THREADS&gt;&quot;</span><span style="color: #0066ff"></span><br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  HTTP_BSY_THREADS=`echo $line |awk &#8216;{print(&quot;,&quot; $11)}&#8217;`<br />     <span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment </span></font><font face="Courier" size="1"><span style="color: #0066ff">below </span></font><font face="Courier" size="1"><span style="color: #0066ff">if you want to debug</span><br />     <span style="color: #006600">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                echo &quot;HTTP_BSY_THREADS: &lt;$HTTP_BSY_THREADS&gt;&quot;</span><br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;           *${JKPORT}) read line<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  MODJK_MAX_THREADS=`echo $line |awk &#8216;{print(&quot;,&quot; $3)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment </span></font><font face="Courier" size="1"><span style="color: #0066ff">below </span></font><font face="Courier" size="1"><span style="color: #0066ff">if you want to debug<br />     </span></font><font face="Courier" size="1"><span style="color: #006600">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;MODJK_MAX_THREADS: &lt;$MODJK_MAX_THREADS&gt;&quot;</span><br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  MODJK_BSY_THREADS=`echo $line |awk &#8216;{print(&quot;,&quot; $11)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment </span></font><font face="Courier" size="1"><span style="color: #0066ff">below </span></font><font face="Courier" size="1"><span style="color: #0066ff">if you want to debug<br />     </span></font><font face="Courier" size="1"><span style="color: #006600">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                echo &quot;MODJK_BSY_THREADS: &lt;$MODJK_BSY_THREADS&gt;&quot;</span><span style="color: #0066ff"></span><br />            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;           *${APPL}) read line<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  SESSION_CNT=`echo $line |awk &#8216;{print(&quot;,&quot; $3)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment below if you want to debug<br />     </span></font><font face="Courier" size="1"><span style="color: #006600"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;               echo &quot;SESSION_CNT: &lt;$SESSION_CNT&gt;&quot;</span><span style="color: #0066ff"></span><br />            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                         ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *) ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;      esac<br />                   &nbsp;&nbsp;&nbsp;    done &lt; /tmp/tomcat-status<br />     <span style="color: #006600">#</span> <span style="color: #0066ff"># Now is the time to write the data to the csv-file</span><br />           &nbsp; echo &quot;${TIME},${JVM_VALUE}${HTTP_MAX_THREADS}${HTTP_BSY_THREADS}<br />      &nbsp; ${MODJK_MAX_THREADS}${MODJK_BSY_THREADS}${SESSION_CNT}&quot; &gt;&gt;$OUTFILE<br />                   exit</font></p>
<p><em>*) be aware that based on word wrapping this script might not work instantly</em> </p>
<p>Create a scriptfile (e.g. tomcat-check.sh) and apply the script to your tomcat. Then edit your crontab.                </p>
<p>There should be a line like:<br />     <strong>&quot;*/5 * * * * cd ~/statistics; ./tomcat-check.sh  1&gt;tomcat-check.log 2&gt;&amp;1&quot;</strong></p>
<p>And then the script should create the csv-files. I&#8217;m not used to excel &#8211; but even I managed to create a more or less interesting diagram from this data. Note how regular the memory behaves while there is no user session.</p>
<p><img alt="Tomcat Monitoring Graphic" title="Tomcat Monitoring Graphic" src="/wp-content/uploads/tomcat/tomcat-graphic-small.jpg" />&nbsp;</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F274';
  addthis_title  = 'Monitor+your+Tomcat+Servlet+on+a+regular+basis';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<img src="http://feeds.feedburner.com/~r/AskTheGerman/~4/2bzLUCHUAQQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/274/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.askthegerman.com/archives/274</feedburner:origLink></item>
		<item>
		<title>Moving a Domain &amp; Time to live</title>
		<link>http://feedproxy.google.com/~r/AskTheGerman/~3/Hp3e_5U63qw/269</link>
		<comments>http://www.askthegerman.com/archives/269#comments</comments>
		<pubDate>Tue, 07 Apr 2009 09:58:26 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[disruption]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[DNS record]]></category>
		<category><![CDATA[Domain Name System]]></category>
		<category><![CDATA[Domainname]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[MX record]]></category>
		<category><![CDATA[Nameserver]]></category>
		<category><![CDATA[Panel]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[Registrar]]></category>
		<category><![CDATA[Time to live]]></category>
		<category><![CDATA[TTL]]></category>
		<category><![CDATA[World Wide Web]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=269</guid>
		<description><![CDATA[The Time to live (TTL)s occuring&#160; in the Domain Name System (DNS), where they are set by an authoritative nameserver for a particular resource record can help us speeding up domain transfers rfom one server to another. When a caching (recursive) nameserver queries the authoritative nameserver for a resource record, it will cache that record [...]]]></description>
			<content:encoded><![CDATA[<p>The Time to live (TTL)s occuring&nbsp; in the <a href="http://en.wikipedia.org/wiki/Domain_Name_System" title="Domain Name System">Domain Name System</a> (DNS), where they are set by an authoritative <a href="http://en.wikipedia.org/wiki/Name_server" title="Name server">nameserver</a> for a particular resource record can help us speeding up domain transfers rfom one server to another.</p>
<p>When a caching (recursive) nameserver queries the authoritative nameserver for a resource record, it will cache that record for the time (in seconds) specified by the TTL. If a stub resolver queries the caching nameserver for the same record before the TTL has expired, the caching server will simply reply with the already cached resource record rather than retrieve it from the authoritative nameserver again.</p>
<p>This is a service intended to speed up DNS queries and to prevent load issues on authoritative nameservers. Therefore shorter TTLs can cause heavier loads on an authoritative nameserver, but can be useful when changing the address of critical services like web servers or <a href="http://en.wikipedia.org/wiki/MX_record" title="MX record">MX records</a>, and therefore are often lowered by the DNS administrator prior to a service being moved, in order to minimize disruptions.</p>
<p>And this is exactly what we can use to speed up the transfer time of our domain to move. At least a day before the big bang to happens we enter our <a href="http://en.wikipedia.org/wiki/Web_hosting_service" title="Hosting Service">Hosting</a> <a href="http://en.wikipedia.org/wiki/Admin_Panel" title="Admin Panel">Panel</a> trilling down to the DNS section within and lower the TTL for each relevant definition within the definitions of the domain in question. </p>
<p>The units used are seconds. A common TTL value for DNS is 86400 seconds, which is 24 hours. A TTL value of 86400 would mean that if a DNS record was changed, DNS servers around the world could still be showing the old value from their cache for up to 24 hours after the change.</p>
<p>Lowering it should be done with some respect about the idea behind and therefore the new value does not really should be close to 1 or so, but going with 600 for a day will for sure not harm.</p>
<p>When we now change the nameserver entry within our <a href="http://en.wikipedia.org/wiki/Domain_name_registrar" title="Registrar">Registrar&#8217;s Service</a>, all old values will get invalidated within 10 minutes and the new authoritative nameserver will get asked instead.</p>
<p>So all the traffic should then get routed over to the new server in a blink and the higher value there for the TTL will propagate again through the World Wide Web. </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F269';
  addthis_title  = 'Moving+a+Domain+%26%23038%3B+Time+to+live';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<img src="http://feeds.feedburner.com/~r/AskTheGerman/~4/Hp3e_5U63qw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/269/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.askthegerman.com/archives/269</feedburner:origLink></item>
		<item>
		<title>Tomcat Monitoring</title>
		<link>http://feedproxy.google.com/~r/AskTheGerman/~3/dyn4b7Mozxo/252</link>
		<comments>http://www.askthegerman.com/archives/252#comments</comments>
		<pubDate>Mon, 02 Feb 2009 09:51:02 +0000</pubDate>
		<dc:creator>Volker</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[8080]]></category>
		<category><![CDATA[Apache Tomcat]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[java-servlet]]></category>
		<category><![CDATA[java-X]]></category>
		<category><![CDATA[manager]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[protocol]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[server.conf]]></category>
		<category><![CDATA[Status]]></category>
		<category><![CDATA[tomcat-users.xml]]></category>
		<category><![CDATA[userid]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=252</guid>
		<description><![CDATA[So you have a wonderful java-servlet and you have a stable and reasonable fast application server like tomcat? But sometimes you have performance breakdowns. Sometimes the application seems to be frozen. Sometimes you just want to know what the hell is going on with your application. So the best way is to say: ÑPlease my [...]]]></description>
			<content:encoded><![CDATA[<p>So you have a wonderful java-servlet and you have a stable and reasonable fast application server like tomcat? But sometimes you have performance breakdowns.</p>
<ul>
<li>Sometimes the application seems to be frozen.</li>
<li>Sometimes you just want to know what the hell<br />       is going on with your application.</li>
</ul>
<p>So the best way is to say:<br />   <strong><em>ÑPlease my little tomcat, tell me ñ how do you feel right now?ì</em></strong></p>
<p>And if you choose the right method you will get some answers.<br />           The good news ahead ñ it isn&#8217;t very difficult to get the information.</p>
<p> You just have to enable the tomcat console. And furthermore you should enable the printout of the garbage collects.<br />   <em>(type &quot;java -X&quot; to get the right gc options for your java-version &#8211; normally something like verbose:gc. I will show you in detail in another article)</em></p>
<p>Just edit the tomcat-users.xml File.</p>
<p>You have to add the roles: manager and admin and add a user and a password that meets your needs. Invent your own username and password and keep it secret. Because userid and password are not encrypted (if you do not explicitly configure https as protocol) you should keep in mind that this is no high sophisticated security.</p>
<p><img alt="Tomcat Monitoring" title="Tomcat Monitoring" src="http://www.askthegerman.com/wp-content/uploads/tomcat/tomcat-monitoring.jpg" height="157" width="429" /></p>
<p>Nevertheless &#8211; save your tomcat-users.xml file and restart tomcat. If your tomcat listens on the standard port (8080) give the manager console a try:</p>
<p><em>http://yourserver-adress:8080/manager/html</em></p>
<p>You will be prompted for a username and password &#8211; if you can remember the values you had put in the tomcat-user.xml file &#8211; go on and put them in. So you can see the console &#8211; not very exciting &#8211; thats true. Here you can just see how many sessions are currently active in an application . And if you want to have fun and you are !not the responsible person for this service you can easily stop an application within the tomcat.</p>
<p>But to be more serious ñ now choose the link in the upper right corner (Server Status) and again the link in the upper right corner (Complete Server Status).<br />           Or just enter:</p>
<p><em>http://yourserver-adress:8080/manager/status/all</em></p>
<p>Take some time to explore the page. Reload the page several times ñ look at how the connections fall and rise. Don&#8217;t forget to check the Memory ñ is enough free memory left ? What is the state of the connections ñ are there any connections left. How many threads are busy? How many spare threads do you have? Perhaps you have to adjust the values in the server.conf file.</p>
<p>Can you imagine that it is very easy to get this values extracted and in a &quot;cvs&quot;-file on a regular basis ? So you can get historical values &#8211; But that is subject for an own article. </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F252';
  addthis_title  = 'Tomcat+Monitoring';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<img src="http://feeds.feedburner.com/~r/AskTheGerman/~4/dyn4b7Mozxo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/252/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.askthegerman.com/archives/252</feedburner:origLink></item>
		<item>
		<title>Extracting MySQL Data</title>
		<link>http://feedproxy.google.com/~r/AskTheGerman/~3/T7LQDbrSzp0/241</link>
		<comments>http://www.askthegerman.com/archives/241#comments</comments>
		<pubDate>Mon, 22 Dec 2008 12:50:59 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[address book]]></category>
		<category><![CDATA[desc table]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Gui]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[outfile]]></category>
		<category><![CDATA[statement]]></category>
		<category><![CDATA[use database]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=241</guid>
		<description><![CDATA[Living in a world of GUIs (Graphical User Interface) many people are no longer aware about what SQL can do. Recently a friend asked me about, is it possible to extract the email adresses of my registered user out of my Joomla? Sure it is! It is not even difficult and the idea behind was [...]]]></description>
			<content:encoded><![CDATA[<p>Living in a world of GUIs (Graphical User Interface) many people are no longer aware about what SQL can do. Recently a friend asked me about, is it possible to extract the email adresses of my registered user out of my Joomla? Sure it is!</p>
<p>It is not even difficult and the idea behind was to load them into some email list to send out season greeting to all subscribers. To keep it simple here I will explain it by using a more common wordpress example, but in principle it can be done for any data the same way. </p>
<p>Most email clients are able to import a CSV (Comma separated List of Values) File by default, as also Excel or Access will &#8216;eat&#8217; them without problems.</p>
<p>Now we have to invoke the MySQL Command Line Client or any other tool which enables us to execute a&nbsp; SQL Statement hopefully we will ending up with such a prompt:</p>
<p><em>mysql&gt; </em></p>
<p>There we first tell MySQL&nbsp; to work with the specific database in question.</p>
<p><em>mysql&gt; use DATABASE</em> &nbsp; &nbsp; (e.q &nbsp; use wordpress)</p>
<p>With the command <em>desc</em> we can get a field description of our table.</p>
<p><em>mysql&gt; desc TABLENAME</em>&nbsp;&nbsp; (e.q.&nbsp; desc wp_users)</p>
<p>Knowing about the table structure now, with <em>select</em> we can extract the data wished:</p>
<p><em>mysql&gt; select user_nicename as Name,user_email as Email from wp_users;<br />        +&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />        | Name&nbsp; | Email&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br />        +&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />        | admin | admin@localhost.com |<br />        +&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />        1 row in set (0.00 sec)</em></p>
<p>Seeing the output and being sure about the result will match our needs we are now finally going to spool the query result into a file:</p>
<p><em>mysql&gt; select user_nicename,user_email into outfile &#8216;c:/temp/u_emails.csv&#8217; fields terminated by &#8216;;&#8217; from wp_users;<br />        Query OK, 1 row affected (0.01 sec)</em> </p>
<p>Content of &quot;c:/temp/u_email.csv&quot;:</p>
<p><em>admin;admin@localhost.com</em></p>
<p>or as variation:</p>
<p>mysql&gt; select user_nicename,user_email into outfile &#8216;c:/temp/u_emails.txt&#8217; fields enclosed by &#8216;&quot;&#8217; terminated by &#8216;;&#8217; from wp_users;<br />        Query OK, 1 row affected (0.01 sec) </p>
<p>Content of &quot;c:/temp/u_email.csv&quot;:</p>
<p><em>&quot;admin&quot;;&quot;admin@localhost.com&quot;</em></p>
<p>And now it should be easy for you to import all emails addresses within your email client&#8217;s address book.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F241';
  addthis_title  = 'Extracting+MySQL+Data';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<img src="http://feeds.feedburner.com/~r/AskTheGerman/~4/T7LQDbrSzp0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/241/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.askthegerman.com/archives/241</feedburner:origLink></item>
		<item>
		<title>Red Wine Cake</title>
		<link>http://feedproxy.google.com/~r/AskTheGerman/~3/flCPx5zqjxw/235</link>
		<comments>http://www.askthegerman.com/archives/235#comments</comments>
		<pubDate>Fri, 19 Dec 2008 08:11:29 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[cake]]></category>
		<category><![CDATA[christmas]]></category>
		<category><![CDATA[recipe]]></category>
		<category><![CDATA[red]]></category>
		<category><![CDATA[Season]]></category>
		<category><![CDATA[wine]]></category>
		<category><![CDATA[xmas]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=235</guid>
		<description><![CDATA[Fitting into seasons time I thought about sharing a red wine cake recipe with you. Ingredients: 4 eggs 250gr butter 1 vanilla flavoring 250gr sugar 1/8 &#8211; 1/4 litre red wine 250gr flour 1 backing soda 100gr crumbled chocolate 1 tea spoon cinnamon 2 tea spoon cacao Preparation In a bowl, mix the eggs, sugar, [...]]]></description>
			<content:encoded><![CDATA[<p>Fitting into seasons time I thought about sharing a red wine cake recipe with you. <img src='http://www.askthegerman.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Ingredients:</p>
<ul>
<li>4 eggs</li>
<li>250gr butter</li>
<li>1 vanilla flavoring</li>
<li>250gr sugar</li>
<li>1/8 &#8211; 1/4 litre red wine</li>
<li>250gr flour</li>
<li>1 backing soda</li>
<li>100gr crumbled chocolate</li>
<li>1 tea spoon cinnamon</li>
<li> 2 tea spoon cacao </li>
</ul>
<p>Preparation</p>
<ul>
<li>In a bowl, mix the eggs, sugar, vanilla flavoring and butter</li>
<li>Sieving flour, backing soda, cacao and cinnamon together and spread it into the bowl</li>
<li>Finally add red wine and crumbled chocolate</li>
<li>
<p>Bake at 200∞C for a duration of 60-70 minutes</p>
</li>
</ul>
<p> Enjoy <img src='http://www.askthegerman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F235';
  addthis_title  = 'Red+Wine+Cake';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<img src="http://feeds.feedburner.com/~r/AskTheGerman/~4/flCPx5zqjxw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/235/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.askthegerman.com/archives/235</feedburner:origLink></item>
	</channel>
</rss>
