<?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>Altentee » Performance &#38; Test Automation Experts &#187; weblogic</title>
	<atom:link href="http://altentee.com/blogs/tag/weblogic/feed/" rel="self" type="application/rss+xml" />
	<link>http://altentee.com</link>
	<description>Performance and Test Automation Experts</description>
	<lastBuildDate>Fri, 04 Nov 2011 03:17:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Monitoring Weblogic 9.2 with JMX and JRuby</title>
		<link>http://altentee.com/blogs/2008/monitoring-weblogic-92-with-jmx-and-jruby/</link>
		<comments>http://altentee.com/blogs/2008/monitoring-weblogic-92-with-jmx-and-jruby/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 00:23:53 +0000</pubDate>
		<dc:creator>Tim Koopmans</dc:creator>
				<category><![CDATA[Altentee]]></category>
		<category><![CDATA[JMX]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://90kts.com/blog/2008/monitoring-weblogic-92-with-jmx-and-jruby/</guid>
		<description><![CDATA[After getting nowhere with lack luster HP support, I turned to the power of the Open Source community and got a very simple script up and running to remotely monitor Weblogic JVM Performance and JMS queues using JMX and JRuby. Despite having some initial issues with the code, the author of the jmx4r module turned [...]]]></description>
			<content:encoded><![CDATA[<p>After getting nowhere with <a href="http://www.sqaforums.com/showthreaded.php?Number=468372">lack luster HP support</a>, I turned to the power of the Open Source community and got a very simple script up and running to remotely monitor Weblogic JVM Performance and JMS queues using JMX and <a href="http://jruby.codehaus.org/Getting+Started">JRuby</a>.</p>
<p>Despite having some initial issues with the code, the author of the <a href="http://jmesnil.net/weblog/2007/06/11/jmx4r-a-jmx-libary-for-jruby/">jmx4r module</a> turned around a fix inside 24 hours so that I could connect to a Weblogic 9.2 server and look at its <a href="http://edocs.bea.com/wls/docs92/wlsmbeanref/core/index.html">domainruntime MBean</a>s. SiteScope can&#8217;t handle domainruntimes of these size (short of being told to &#8216;add more memory&#8217; to a 3GB+ machine!). So exit stage left Mercury, enter stage right JRuby&#8230;<br />
<span id="more-133"></span></p>
<p>This script will enumerate JVM performance and also JMS queue depths in around 65 lines of code and spits those results into a MySQL database using the mysqlimport CLI.<br />
I&#8217;ve <a href="http://90kts.com/blog/2008/formatting-data-for-import-into-loadrunner-analysis/">formatted the output</a> so I can still input the data into LoadRunner Analysis.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'jmx4r'</span>
groupid = <span style="color:#996600;">&quot;mycluster&quot;</span>
<span style="color:#6666ff; font-weight:bold;">JMX::MBean</span>.<span style="color:#9900CC;">establish_connection</span> <span style="color:#ff3333; font-weight:bold;">:url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;service:jmx:rmi:///jndi/iiop://hostname:7001/weblogic.management.mbeanservers.domainruntime&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:username</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;username&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:password</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;password&quot;</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#996600;">'D:<span style="color:#000099;">\p</span>erf_jvm.csv'</span>, <span style="color:#996600;">'a'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
   runtime_mbeans = <span style="color:#6666ff; font-weight:bold;">JMX::MBean</span>.<span style="color:#9900CC;">find_all_by_name</span> <span style="color:#996600;">&quot;com.bea:Type=JRockitRuntime,*&quot;</span>
   runtime_mbeans.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span> mbean <span style="color:#006600; font-weight:bold;">|</span>
		now  = <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>
		date = <span style="color:#996600;">&quot;#{now.year}-#{now.month}-#{now.day}&quot;</span>
		time = <span style="color:#996600;">&quot;#{now.hour}:#{now.min}:#{now.sec}&quot;</span>
&nbsp;
		data  = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
		<span style="color:#9966CC; font-weight:bold;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span>mbean.<span style="color:#9900CC;">object_name</span>.<span style="color:#9900CC;">get_key_property</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Name&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> =~ <span style="color:#006600; font-weight:bold;">/</span>server<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">then</span>
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;&quot;</span>
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> date
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> time
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> groupid
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> mbean.<span style="color:#9900CC;">object_name</span>.<span style="color:#9900CC;">get_key_property</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Name&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> mbean.<span style="color:#9900CC;">used_physical_memory</span>
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> mbean.<span style="color:#9900CC;">heap_size_max</span>
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> mbean.<span style="color:#9900CC;">free_physical_memory</span>
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> mbean.<span style="color:#9900CC;">total_garbage_collection_time</span>
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> mbean.<span style="color:#9900CC;">total_garbage_collection_count</span>
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> mbean.<span style="color:#9900CC;">total_nursery_size</span>
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> mbean.<span style="color:#9900CC;">heap_free_percent</span>
			file.<span style="color:#CC0066; font-weight:bold;">puts</span> data.<span style="color:#9900CC;">compact</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;, &quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
		<span style="color:#9966CC; font-weight:bold;">end</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
cmd = <span style="color:#996600;">'D:<span style="color:#000099;">\\</span>wamp<span style="color:#000099;">\\</span>bin<span style="color:#000099;">\\</span>mysql<span style="color:#000099;">\\</span>mysql5.0.51a<span style="color:#000099;">\\</span>bin<span style="color:#000099;">\\</span>mysqlimport -h localhost -P 3390 -s -u root --fields-optionally-enclosed-by=&quot;&quot;&quot; --fields-terminated-by=, --lines-terminated-by=&quot;<span style="color:#000099;">\n</span>&quot; --local sensis D:<span style="color:#000099;">\p</span>erf_jvm.csv'</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#008000; font-style:italic;">#{cmd}}</span>
cmd = <span style="color:#996600;">'cat D:<span style="color:#000099;">\p</span>erf_jvm.csv &gt;&gt; D:<span style="color:#000099;">\p</span>erf_jvm_archive.csv'</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#008000; font-style:italic;">#{cmd}}</span>
<span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">delete</span> <span style="color:#996600;">'D:<span style="color:#000099;">\p</span>erf_jvm.csv'</span>
&nbsp;
&nbsp;
<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#996600;">'D:<span style="color:#000099;">\p</span>erf_queues.csv'</span>, <span style="color:#996600;">'a'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
   runtime_mbeans = <span style="color:#6666ff; font-weight:bold;">JMX::MBean</span>.<span style="color:#9900CC;">find_all_by_name</span> <span style="color:#996600;">&quot;com.bea:Type=JMSDestinationRuntime,*&quot;</span>
   runtime_mbeans.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span> mbean <span style="color:#006600; font-weight:bold;">|</span>
		now  = <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>
		date = <span style="color:#996600;">&quot;#{now.year}-#{now.month}-#{now.day}&quot;</span>
		time = <span style="color:#996600;">&quot;#{now.hour}:#{now.min}:#{now.sec}&quot;</span>
&nbsp;
		data  = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
		<span style="color:#9966CC; font-weight:bold;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span>mbean.<span style="color:#9900CC;">object_name</span>.<span style="color:#9900CC;">get_key_property</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Name&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> =~ <span style="color:#006600; font-weight:bold;">/</span><span style="color:#9966CC; font-weight:bold;">Module</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">then</span>
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;&quot;</span>
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> date
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> time
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> groupid
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> mbean.<span style="color:#9900CC;">object_name</span>.<span style="color:#9900CC;">get_key_property</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Name&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> mbean.<span style="color:#9900CC;">messages_received_count</span>
			data <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> mbean.<span style="color:#9900CC;">messages_high_count</span>
			file.<span style="color:#CC0066; font-weight:bold;">puts</span> data.<span style="color:#9900CC;">compact</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;, &quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
		<span style="color:#9966CC; font-weight:bold;">end</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
cmd = <span style="color:#996600;">'D:<span style="color:#000099;">\\</span>wamp<span style="color:#000099;">\\</span>bin<span style="color:#000099;">\\</span>mysql<span style="color:#000099;">\\</span>mysql5.0.51a<span style="color:#000099;">\\</span>bin<span style="color:#000099;">\\</span>mysqlimport -h localhost -P 3390 -s -u root --fields-optionally-enclosed-by=&quot;&quot;&quot; --fields-terminated-by=, --lines-terminated-by=&quot;<span style="color:#000099;">\n</span>&quot; --local sensis D:<span style="color:#000099;">\p</span>erf_queues.csv'</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#008000; font-style:italic;">#{cmd}}</span>
cmd = <span style="color:#996600;">'cat D:<span style="color:#000099;">\p</span>erf_queues.csv &gt;&gt; D:<span style="color:#000099;">\p</span>erf_queues_archive.csv'</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#008000; font-style:italic;">#{cmd}}</span>
<span style="color:#CC0066; font-weight:bold;">sleep</span> <span style="color:#006666;">10</span>
<span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">delete</span> <span style="color:#996600;">'D:<span style="color:#000099;">\p</span>erf_queues.csv'</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://altentee.com/blogs/2008/monitoring-weblogic-92-with-jmx-and-jruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Monitoring Weblogic using JMX in LoadRunner</title>
		<link>http://altentee.com/blogs/2008/monitoring-weblogic-using-jmx-in-loadrunner/</link>
		<comments>http://altentee.com/blogs/2008/monitoring-weblogic-using-jmx-in-loadrunner/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 20:53:31 +0000</pubDate>
		<dc:creator>Tim Koopmans</dc:creator>
				<category><![CDATA[Altentee]]></category>
		<category><![CDATA[JMX]]></category>
		<category><![CDATA[loadrunner]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://90kts.com/blog/2008/monitoring-weblogic-using-jmx-in-loadrunner/</guid>
		<description><![CDATA[When configuring the WebLogic (JMX) monitor (Add Measurements via the Run tab in Controller) you may be presented with the following error: Java Virtual Machine Version mismatch: Required version: 1.3 To overcome this try the following steps &#8230; Rename the jmxri.jar file to jmxri.bak in the \LoadRunner\classes directory Copy the weblogic.jar from your application server [...]]]></description>
			<content:encoded><![CDATA[<p>When configuring the WebLogic (JMX) monitor (Add Measurements via the Run tab in Controller) you may be presented with the following error:</p>
<p><code>Java Virtual Machine Version mismatch: Required version: 1.3</code></p>
<p>To overcome this try the following steps &#8230;<br />
<span id="more-115"></span></p>
<p>Rename the jmxri.jar file to jmxri.bak in the <code><installdir>\LoadRunner\classes directory</code></p>
<p>Copy the weblogic.jar from your application server directory typically from<br />
<code><installdir>\bea\wlserver_<version>\server\lib</code><br />
to the<br />
<code><installdir>\LoadRunner\classes</code> directory</p>
<p>Edit the <code><installdir>\LoadRunner\dat\monitors\WebLogicMon.ini </code><br />
as per the following:</p>
<p><code><br />
[WebLogicMon]<br />
JVM=javaw.exe<br />
JavaVersion=1.5<br />
;JavaVendor=Sun Microsystems Inc.</p>
<p>JVM_CLASSES1=jmxri.jar<br />
JVM_CLASSES2=weblogicmon.jar</p>
<p>JVM_ARG1=-Dweblogic.ThreadPoolSize=20<br />
JVM_ARG2=-Dweblogic.ThreadPoolPercentSocketReaders=90</p>
<p>DetectVersions=0</p>
<p>Weblogic=weblogic.jar<br />
Port=7001</p>
<p>MetricListURL=/?type=0&#038;id=10&#038;host=%h<br />
MetricDataURL=/?type=0&#038;id=11&#038;host=%h<br />
MetricRequestURL=/?type=0&#038;id=12&#038;host=%h<br />
ShutdownHostURL=/?type=0&#038;id=13&#038;host=%h<br />
InitHostURL=/?type=0&#038;id=14&#038;host=%h</p>
<p>MonitorType=WebLogic<br />
DlgTitle=BEA WebLogic Monitor<br />
ExtensionDll=WebLogicMonExt.dll</p>
<p>ActivateCounters=1<br />
QueryLoginInfo=1<br />
RefreshMetricList=1<br />
DefaultPort=1112<br />
SourceHost=localhost<br />
PingHostURL=/?type=0&#038;id=201<br />
</code></p>
<p>Making sure that the JavaVersion and Port match your client/server settings!</p>
<p>Restart the Controller and you should now be able to add the appropriate counters using the WebLogic (JMX) monitor.</p>
]]></content:encoded>
			<wfw:commentRss>http://altentee.com/blogs/2008/monitoring-weblogic-using-jmx-in-loadrunner/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

