しかし、本当に要るのだろうかね。
詳細は前回のリンクの英文にあるので、それを見てもらえば概ね大丈夫だとおもうです。
(1)PMIの名前をゲットしてきて
#PMI Name
perfN = AdminControl.completeObjectName('type=Perf,process='+AS名とか+',*')
(2)PMIオブジェクトを作成して
((1)の名前がとれなかった場合は、PMIが無効になっている)
#PMI Object Name
perfObj = AdminControl.makeObjectName(perfN)
(3)見たいパフォーマンスデータのオブジェクト名を取得してきて
thpool_w = AdminControl.completeObjectName('type=ThreadPool,process='+AS名やって+',name=WebContainer,*')
(4)javax.management型に変換して
import javax.management as mgmt
param = [ mgmt.ObjectName(thpool_w), java.lang.Boolean('false')]
(5)jmxのメソッドを呼ぶ
sigs = ['javax.management.ObjectName', 'java.lang.Boolean']
th_stat = AdminControl.invoke_jmx( perfObj, 'getStatsObject', param, sigs)
(6)あとは煮るなり焼くなり好きにしてくれ
(これは数だけ表示させる例)
for i in th_stat.getStatisticNames():
stat = th_stat.getStatistic(i)
stat_val = None
className=str(stat.getClass())
if (className.find("Count") > -1):
stat_val = stat.getCount()
else:
stat_val = stat.getCurrent()
print "%s,%s,%s" % (stat.getName(),stat.getDescription()[:-1],stat_val)
原文抜粋
To show how you can do this, we'll start with the techniques described in an earlier article, Writing PMI applications using the JMX interface. The examples in that article were created for Java developers. Here, we'll use wsadmin Jython scripts to demonstrate
how easy it can be using this method to read and understand performance metrics.
なんて簡単なんでしょう!そう、IBMerならね!(ドヤァ
ホンマか!?(;´Д`)
ホンマにこれ簡単なんか!?
参考リンク
http://pic.dhe.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=%2Fcom.ibm.websphere.javadoc.doc%2Fpublic_html%2Fapi%2Fcom%2Fibm%2Fwebsphere%2Fpmi%2Fstat%2FStatsImpl.htmlhttps://www.ibm.com/developerworks/websphere/techjournal/1112_guillemenot/1112_guillemenot.html?ca=drs-http://publib.boulder.ibm.com/infocenter/wsdoc400/v6r0/index.jsp?topic=/com.ibm.websphere.iseries.doc/info/ae/ae/rxml_admincontrol.html
posted by koteitan at 14:13|
Comment(0)
|
TrackBack(0)
|
WebSphere
|

|