{"id":4576,"date":"2015-04-23T17:23:48","date_gmt":"2015-04-23T09:23:48","guid":{"rendered":"http:\/\/rmohan.com\/?p=4576"},"modified":"2015-04-26T19:26:45","modified_gmt":"2015-04-26T11:26:45","slug":"automation-of-monitoring-weblogic-server-runtime-using-wlst","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=4576","title":{"rendered":"Automation of Monitoring Weblogic Server Runtime using WLST"},"content":{"rendered":"<div class=\"article-header\">\n<h1 class=\"title entry-title\"><a href=\"http:\/\/siva-cs.blogspot.com\/2014\/03\/automation-of-monitoring-weblogic.html\" rel=\"bookmark\" data-item-type=\"post\" data-id=\"3746415490064238032\"><br class=\"Apple-interchange-newline\" \/>Automation of Monitoring Weblogic Server Runtime using WLST<\/a><\/h1>\n<\/div>\n<div class=\"article-content entry-content\">\n<div dir=\"ltr\">In a production environment, the health and the runtime of the Weblogic server instances must be pro-actively monitored in order to prevent the outage\/interruption of the service to customers.In this post I am explaining how the<b>WLST<\/b><span class=\"Apple-converted-space\">\u00a0<\/span>(<b>W<\/b>eb<b>L<\/b>ogic<span class=\"Apple-converted-space\">\u00a0<\/span><b>S<\/b>cripting<span class=\"Apple-converted-space\">\u00a0<\/span><b>T<\/b>ool) can be used to automate the monitoring of Weblogic Domains. WLST is based on Jython which is a Java implementation of Python.Since WLST is using the syntax of Python, indentation must be strictly followed.Here in the below script, we are using WLST Online mode to connect to the Admin Server of the Weblogic domain and then interact with the servers&#8217; MBeans. Weblogic server stores the Runtime information in a hierarchical data model called MBean. Its like UNIX file system and you can use cd(), ls() and pwd() commands to navigate to the directories of Weblogic instances which are part of the domain and then you can read various Runtime attributes using the cmo.getXXXX() function. cmo stands for the Current Management Object. Below is an example statement to get the state of a Weblogic server instance.<\/p>\n<div><b>cd(&#8216;domainRuntime:\/ServerLifeCycleRuntimes\/&#8217;+serverName)<\/b><\/div>\n<div>\n<div><b>serverState=cmo.getState()<\/b><\/div>\n<\/div>\n<p>Connect() function can be used to connect to the admin server and then the serverRuntime() function can be used to switch to the domain&#8217;s runtime MBean tree. Following is the syntax for the connect function.<\/p>\n<div>\n<div><b>connect(&#8220;username&#8221;,&#8221;password&#8221;,&#8221;admin_server_url&#8221;)<\/b><br \/>\n<b><br \/>\n<\/b>Following Weblogic domain runtime attributes are monitored by this wlst script.<\/p>\n<ul>\n<li>Server State<\/li>\n<li>Server Health<\/li>\n<li>Idle Thread Count<\/li>\n<li>Application Status<\/li>\n<li>JDBC Datasouce State<\/li>\n<li>JMS Pending Messages<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div><b>\u00a0<\/b><\/div>\n<div>####################################################################################<br \/>\n# Name : weblogic_report.py<br \/>\n# Author<span class=\"Apple-converted-space\">\u00a0<\/span> : T.Sivashanker<br \/>\n# Purpose \u00a0 : To generate a report of various weblogic runtime attributes<br \/>\n####################################################################################<br \/>\nimport thread<br \/>\nimport sys<br \/>\nimport string<br \/>\nimport java.util.Date as Date<br \/>\nimport reusername=&#8217;weblogic&#8217;<br \/>\npassword=&#8217;admin123&#8242;<br \/>\nadmin_url=&#8217;t3:\/\/localhost:7001&#8217;#Connect to the admin server.<br \/>\ntry:<br \/>\nconnect(username,password,admin_url)<br \/>\nexcept:<br \/>\n#Disconnect from the admin server.<br \/>\ndisconnect()<br \/>\n#Exit the wlst scripting tool.<br \/>\nexit()<br \/>\n#Exit the python program.<br \/>\nsys.exit(0)reportStatus=&#8217;GREEN&#8217;#To get the names of all the servers in the weblogic domain.<br \/>\nservers = [&#8216;admin_server&#8217;,&#8217;Managed_Server-01&#8242;,&#8217;Managed_Server-02&#8242;,&#8217;Managed_Server-03&#8242;]# Open the html file<br \/>\nfo = open(&#8216;\/usr\/siva\/reportContent.html&#8217;,&#8217;w+&#8217;);########################################################################################<br \/>\n### \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0To get the State \u00a0of the servers \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0###<br \/>\n########################################################################################<br \/>\nfor server in servers:stateColor=&#8217;lime&#8217;try:<br \/>\ncd(&#8216;domainRuntime:\/ServerLifeCycleRuntimes\/&#8217;+server)<br \/>\nserverState=cmo.getState()<br \/>\nif(serverState != &#8216;RUNNING&#8217;):<br \/>\nstateColor=&#8217;red&#8217;<br \/>\nexcept:<br \/>\nserverState=&#8217;UNKNOWN&#8217;<br \/>\nstateColor=&#8217;red&#8217;<br \/>\nreportStatus=&#8217;RED&#8217;########################################################################################<br \/>\n### \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0To get the Health of the servers \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0###<br \/>\n########################################################################################<br \/>\nfor server in servers:healthColor=&#8217;lime&#8217;<\/p>\n<p>try:<br \/>\ncd(&#8216;domainRuntime:\/ServerRuntimes\/&#8217;+server)<br \/>\nserverStateX=cmo.getState()<br \/>\ntempHealthState=cmo.getHealthState().getState()<br \/>\nif (tempHealthState == 0):<br \/>\nserverHealthState=&#8217;OK&#8217;<br \/>\nexcept:<br \/>\nserverHealthState=&#8217;FAILED&#8217;<br \/>\nhealthColor=&#8217;red&#8217;<br \/>\nreportStatus=&#8217;RED&#8217;<\/p>\n<p>########################################################################################<br \/>\n### \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0To get the Idle Thread count \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0###<br \/>\n########################################################################################<br \/>\ndomainRuntime()<\/p>\n<p>for server in servers:<\/p>\n<p>if( string.find(server,&#8217;admin&#8217;) != -1):<br \/>\ncontinue<br \/>\ncolor=&#8217;lime&#8217;<\/p>\n<p>try:<br \/>\ncd(&#8216;domainRuntime:\/ServerRuntimes\/&#8217;+server+&#8217;\/ExecuteQueueRuntimes\/weblogic.kernel.Default&#8217;)<br \/>\nidlecount=get(&#8216;ExecuteThreadCurrentIdleCount&#8217;)<\/p>\n<p>except:<br \/>\nidlecount=0<br \/>\ncolor=&#8217;red&#8217;<br \/>\nreportStatus=&#8217;RED&#8217;<\/p>\n<p>if (idlecount &lt; 10):<br \/>\ncolor=&#8217;red&#8217;<br \/>\nelif(idlecount &gt;= 10 and idlecount &lt;20):<br \/>\ncolor=&#8217;#F8A136&#8242;<br \/>\nreportStatus=&#8217;AMBER&#8217;<br \/>\nelse:<br \/>\ncolor=&#8217;lime&#8217;<\/p>\n<p>########################################################################################<br \/>\n### \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0To get the Application status \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ###<br \/>\n########################################################################################<br \/>\ndomainRuntime()<\/p>\n<p>cd(&#8216;domainRuntime:\/AppRuntimeStateRuntime\/AppRuntimeStateRuntime&#8217;)<br \/>\nAppList = cmo.getApplicationIds()<\/p>\n<p>for App in AppList:<br \/>\ncolor=&#8217;lime&#8217;<br \/>\nAppState=cmo.getIntendedState(App)<\/p>\n<p>if (AppState!=&#8217;STATE_ACTIVE&#8217;):<br \/>\ncolor=&#8217;red&#8217;<br \/>\nreportStatus=&#8217;RED&#8217;<\/p>\n<p>if( AppState == None ):<br \/>\n#continue<br \/>\nAppState=&#8217;None&#8217;<\/p>\n<p>########################################################################################<br \/>\n### \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0To get JDBC DataSource status \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ###<br \/>\n########################################################################################<br \/>\ntotalCount1=0<br \/>\ncurrentCount1=0<br \/>\nhighCount1=0<br \/>\njdbcstate1=&#8221;<\/p>\n<p>for server in servers:<\/p>\n<p>if( string.find(server,&#8217;admin&#8217;) != -1):<br \/>\ncontinue<br \/>\n#currentcolor1=&#8217;lime&#8217;<br \/>\njdbccolor1=&#8217;lime&#8217;<\/p>\n<p>totalCount1=0<br \/>\ncurrentCount1=0<br \/>\nhighCount1=0<br \/>\njdbcstate1=&#8221;<\/p>\n<p>try:<br \/>\ncd(&#8216;domainRuntime:\/ServerRuntimes\/&#8217;+server+&#8217;\/JDBCServiceRuntime\/&#8217;+server+&#8217;\/JDBCDataSourceRuntimeMBeans\/&lt;jdbc_name&gt;&#8217;)<\/p>\n<p>totalCount1=get(&#8216;ConnectionsTotalCount&#8217;)<br \/>\ncurrentCount1=get(&#8216;ActiveConnectionsCurrentCount&#8217;)<br \/>\nhighCount1=get(&#8216;ActiveConnectionsHighCount&#8217;)<br \/>\njdbcstate1=get(&#8216;State&#8217;)<\/p>\n<p>except:<br \/>\ncurrentcolor=&#8217;red&#8217;<br \/>\nreportStatus=&#8217;RED&#8217;<\/p>\n<p>if(jdbcstate1 != &#8216;Running&#8217;):<br \/>\njdbcstate1=&#8217;FAILED&#8217;<br \/>\njdbccolor1=&#8217;red&#8217;<\/p>\n<p>########################################################################################<br \/>\n### \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0To get JMS Pending Messages \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ###<br \/>\n########################################################################################<br \/>\nrunningServers = domainRuntimeService.getServerRuntimes();<br \/>\ncount=0<\/p>\n<p>#To get the count of JMS Destinations<br \/>\nfor server in runningServers:<br \/>\ntempname=str(server)<br \/>\nif( string.find(tempname,&#8217;admin&#8217;) != -1):<br \/>\ncontinue<br \/>\njmsRuntime = server.getJMSRuntime();<br \/>\njmsServers = jmsRuntime.getJMSServers();<br \/>\nfor jmsServer in jmsServers:<br \/>\ndestinations = jmsServer.getDestinations();<\/p>\n<p>for destination in destinations:<br \/>\ncount=count+1<\/p>\n<p>break<\/p>\n<p>x=0<br \/>\nwhile (x &lt; count):<br \/>\nx = x + 1<br \/>\nprint(&#8220;\\<br \/>\nDestination&#8221;+str(x)+&#8221;\\<br \/>\n\\<br \/>\n&#8220;);<\/p>\n<p>pendingColor=&#8217;lime&#8217;<\/p>\n<p>for server in runningServers:<br \/>\ntempname=str(server.getName())<br \/>\nif( string.find(tempname,&#8217;admin&#8217;) != -1):<br \/>\ncontinue<br \/>\nfo.write(&#8220;\\<br \/>\n&lt;tr&gt;\\n\\<br \/>\n&lt;td&gt;&#8221;+tempname+&#8221;&lt;\/td&gt;\\n\\<br \/>\n&#8220;);<br \/>\njmsRuntime = server.getJMSRuntime();<br \/>\njmsServers = jmsRuntime.getJMSServers();<br \/>\nfor jmsServer in jmsServers:<br \/>\ndestinations = jmsServer.getDestinations();<br \/>\nfor destination in destinations:<br \/>\npendingMessages=destination.getMessagesPendingCount()<br \/>\nif(pendingMessages != 0):<br \/>\npendingColor=&#8217;red&#8217;<br \/>\nprint str(pendingMessages)<\/p>\n<p>for server in runningServers:<br \/>\ntempname=str(server.getName())<br \/>\nif( string.find(tempname,&#8217;admin&#8217;) != -1):<br \/>\ncontinue<br \/>\njmsRuntime = server.getJMSRuntime();<br \/>\njmsServers = jmsRuntime.getJMSServers();<br \/>\nfor jmsServer in jmsServers:<br \/>\ndestinations = jmsServer.getDestinations();<\/p>\n<p>for destination in destinations:<\/p>\n<p>x=destination.getName()<br \/>\nx = x[x.find(&#8216;@&#8217;)+1:len(x)]<\/p>\n<p>fo.write(&#8220;\\<br \/>\n&lt;li&gt;\\n\\<br \/>\n&#8220;+str(x)+&#8221;\\<br \/>\n&lt;\/li&gt;\\n\\<br \/>\n&#8220;);<br \/>\nbreak<\/p>\n<p>#Disconnect from the admin server.<br \/>\ndisconnect()<br \/>\n#Exit the wlst scripting tool.<br \/>\nexit()<br \/>\n#Exit the python program.<br \/>\nsys.exit(0)<br \/>\nprint &#8220;the END&#8221;<\/p>\n<p>Above wlst script can be run using the command javac by specifying the classpath of the weblogic.jar.<\/p>\n<p><b>java -cp \/&lt;MIDDLE_WARE_HOME&gt;\/server\/lib\/weblogic.jar weblogic.WLST wls_report.py<\/b><br \/>\nweblogic wlst workmanager monitoring<br \/>\nimport thread<br \/>\nfrom java.util import Date<br \/>\nfrom java.text import SimpleDateFormat<br \/>\n# Configured user credentials with storeUserConfig<\/p>\n<p>def monitorThrds():<br \/>\nconnect(&#8220;weblogic&#8221;, &#8220;pwd&#8221;, &#8220;t3:\/\/IP:Port&#8221;);<br \/>\nserverNames = getRunningServerNames()<br \/>\ndomainRuntime()<\/p>\n<p>for i in range(10000):<br \/>\nprint &#8216;[&#8216; + SimpleDateFormat(&#8216;d MMM yyyy HH:mm:ss&#8217;).format(java.util.Date()) + &#8216;]&#8217;<br \/>\nfor sname in serverNames:<br \/>\ntry:<br \/>\ncd(&#8220;domainRuntime:\/ServerRuntimes\/&#8221; + sname.getName() + &#8220;\/MaxThreadsConstraintRuntimes\/MaxThreadConstraint-oms&#8221;)<br \/>\nautomaxexecnt=get(&#8216;ExecutingRequests&#8217;)<br \/>\nautomaxdefcnt = get(&#8216;DeferredRequests&#8217;)<br \/>\ncd(&#8220;domainRuntime:\/ServerRuntimes\/&#8221; + sname.getName() + &#8220;\/MaxThreadsConstraintRuntimes\/MaxThreadsConstraint-oms.ws.jms&#8221;)<br \/>\njmsmaxexecnt=get(&#8216;ExecutingRequests&#8217;)<br \/>\njmsmaxdefcnt = get(&#8216;DeferredRequests&#8217;)<br \/>\ncd(&#8220;domainRuntime:\/ServerRuntimes\/&#8221; + sname.getName() + &#8220;\/MinThreadsConstraintRuntimes\/MinThreadsConstraint-oms.automation&#8221;)<br \/>\nautominexecnt=get(&#8216;ExecutingRequests&#8217;)<br \/>\nautominpendcnt = get(&#8216;PendingRequests&#8217;)<br \/>\ncd(&#8220;domainRuntime:\/ServerRuntimes\/&#8221; + sname.getName() + &#8220;\/MinThreadsConstraintRuntimes\/MinThreadsConstraint-oms.ws.jms&#8221;)<br \/>\njmsminexecnt=get(&#8216;ExecutingRequests&#8217;)<br \/>\njmsminpendcnt = get(&#8216;PendingRequests&#8217;)<br \/>\nprint &#8216;%8s %10s\u00a0 Min = ( E:%4d\u00a0\u00a0\u00a0 P:%4d )\u00a0\u00a0\u00a0 Max = ( E:%4d\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 D:%4d )&#8217; %\u00a0 (&#8220;(auto)&#8221;, sname.getName(), autominexecnt, autominpendcnt, automaxexecnt, automaxdefcnt)<br \/>\nprint &#8216;%8s %10s\u00a0 Min = ( E:%4d\u00a0\u00a0\u00a0 P:%4d )\u00a0\u00a0\u00a0 Max = ( E:%4d\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 D:%4d )&#8217; %\u00a0 (&#8220;(jms)&#8221;, sname.getName(), jmsminexecnt, jmsminpendcnt, jmsmaxexecnt, jmsmaxdefcnt)<br \/>\nexcept WLSTException,e:<br \/>\n# this typically means the server is not active, just ignore<br \/>\npass<br \/>\nprint &#8216;======================================================================&#8217;<br \/>\nprint &#8221;<br \/>\nimport time<br \/>\ntime.sleep(3)<br \/>\ndef getRunningServerNames():<br \/>\ndomainConfig()<br \/>\nreturn cmo.getServers()<br \/>\nif __name__== &#8220;main&#8221;:<br \/>\nmonitorThrds()<br \/>\ndisconnect()<\/p>\n<p>weblogic wlst jms monitoring<br \/>\nimport thread<br \/>\nfrom java.util import Date<br \/>\nfrom java.text import SimpleDateFormat<br \/>\n# Configured user credentials with storeUserConfig<\/p>\n<p>def monitorJMS():<br \/>\nconnect(&#8220;weblogic&#8221;, &#8220;pwd&#8221;, &#8220;t3:\/\/IP:Port&#8221;);<br \/>\nservers = domainRuntimeService.getServerRuntimes();<br \/>\nfor i in range(10000):<br \/>\nprint &#8216;[&#8216; + SimpleDateFormat(&#8216;d MMM yyyy HH:mm:ss&#8217;).format(java.util.Date()) + &#8216;]&#8217;<br \/>\nif (len(servers) &gt; 0):<br \/>\nfor server in servers:<br \/>\nprint &#8216;\u00a0 Server Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216; , server<br \/>\njmsRuntime = server.getJMSRuntime();<br \/>\njmsServers = jmsRuntime.getJMSServers();<br \/>\nfor jmsServer in jmsServers:<br \/>\ndestinations = jmsServer.getDestinations();<br \/>\nfor destination in destinations:<br \/>\nprint destination.getName()<br \/>\nprint &#8216;\u00a0 MessagesCurrentCount\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216; ,\u00a0 destination.getMessagesCurrentCount()<br \/>\nprint &#8216;\u00a0 MessagesHighCount\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216; ,\u00a0 destination.getMessagesHighCount()<br \/>\nprint &#8216;\u00a0 MessagesMovedCurrentCount\u00a0\u00a0 &#8216; ,\u00a0 destination.getMessagesMovedCurrentCount()<br \/>\nprint &#8216;\u00a0 MessagesPendingCount\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216; ,\u00a0 destination.getMessagesPendingCount()<br \/>\nprint &#8216;\u00a0 MessagesReceivedCount\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216; ,\u00a0 destination.getMessagesReceivedCount()<br \/>\nprint &#8221;<br \/>\nimport time<br \/>\ntime.sleep(10)<br \/>\nif __name__== &#8220;main&#8221;:<br \/>\nmonitorJMS()<br \/>\ndisconnect()<\/p>\n<p><strong>weblogic wlst thread monitoring<\/strong><br \/>\nfrom java.util import Date<br \/>\nfrom java.text import SimpleDateFormat<br \/>\n# Configured user credentials with storeUserConfig<\/p>\n<p>def monitorThrds():<br \/>\nconnect(&#8220;weblogic&#8221;, &#8220;pwd&#8221;, &#8220;t3:\/\/IP:Port&#8221;);<br \/>\nserverNames = getRunningServerNames()<br \/>\ndomainRuntime()<\/p>\n<p>for i in range(10000):<br \/>\nprint &#8216;[&#8216; + SimpleDateFormat(&#8216;d MMM yyyy HH:mm:ss&#8217;).format(java.util.Date()) + &#8216;]&#8217;<br \/>\nprint &#8216;======================================================================&#8217;<br \/>\nprint &#8216;| Execute\u00a0\u00a0\u00a0\u00a0 Total\u00a0\u00a0\u00a0 Idle\u00a0\u00a0\u00a0 Pending\u00a0\u00a0\u00a0\u00a0 Hogging\u00a0\u00a0\u00a0 Queue\u00a0\u00a0\u00a0\u00a0 StdBy&#8217;<br \/>\nprint &#8216;| QueueName\u00a0\u00a0 Count\u00a0\u00a0\u00a0 Count\u00a0\u00a0\u00a0 Count\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Count\u00a0\u00a0\u00a0\u00a0 Length\u00a0\u00a0\u00a0 Count&#8217;<br \/>\nprint &#8216;======================================================================&#8217;<br \/>\nfor sname in serverNames:<br \/>\ntry:<br \/>\ncd(&#8220;domainRuntime:\/ServerRuntimes\/&#8221; + sname.getName() + &#8220;\/ThreadPoolRuntime\/ThreadPoolRuntime&#8221;)<br \/>\ntotcnt=get(&#8216;ExecuteThreadTotalCount&#8217;)<br \/>\nidlecnt = get(&#8216;ExecuteThreadIdleCount&#8217;)<br \/>\npndcnt =get(&#8216;PendingUserRequestCount&#8217;)<br \/>\nsevcnt = get(&#8216;HoggingThreadCount&#8217;)<br \/>\nqueuelength = get(&#8216;QueueLength&#8217;)<br \/>\nstdbycnt = get(&#8216;StandbyThreadCount&#8217;)<br \/>\nprint &#8216;| %10s\u00a0 %4d\u00a0\u00a0\u00a0 %4d\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 %4d\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 %4d\u00a0\u00a0\u00a0\u00a0 %4d\u00a0\u00a0\u00a0\u00a0\u00a0 %4d&#8217; %\u00a0 (sname.getName(), totcnt, idlecnt, pndcnt, sevcnt, queuelength, stdbycnt)<br \/>\nexcept WLSTException,e:<br \/>\n# this typically means the server is not active, just ignore<br \/>\npass<br \/>\nprint &#8216;======================================================================&#8217;<br \/>\nprint &#8221;<br \/>\nimport time<br \/>\ntime.sleep(3)<br \/>\ndef getRunningServerNames():<br \/>\ndomainConfig()<br \/>\nreturn cmo.getServers()<br \/>\nif __name__== &#8220;main&#8221;:<br \/>\nmonitorThrds()<br \/>\ndisconnect()<\/p>\n<p><strong>weblogic wlst SAF monitoring<\/strong><br \/>\nfrom java.util import Date<br \/>\nfrom java.text import SimpleDateFormat<br \/>\n# Configured user credentials with storeUserConfig<\/p>\n<p>def monitorThrds():<br \/>\nconnect(&#8220;weblogic&#8221;, &#8220;pwd&#8221;, &#8220;t3:\/\/IP:Port&#8221;);<br \/>\nserverNames = getRunningServerNames()<br \/>\nserverRuntime()<br \/>\nfor i in range(10000):<br \/>\nprint &#8216;[&#8216; + SimpleDateFormat(&#8216;d MMM yyyy HH:mm:ss&#8217;).format(java.util.Date()) + &#8216;]&#8217;<br \/>\nprint &#8216;======================================================================&#8217;<br \/>\nfor sname in serverNames:<br \/>\ntry:<br \/>\ncd(&#8220;domainRuntime:\/ServerRuntimes\/&#8221; + sname.getName() + &#8220;\/SAFRuntime\/&#8221; +sname.getName() + &#8220;.saf\/Agents&#8221;)<br \/>\ntry:<br \/>\nagents=cmo.getAgents()<br \/>\nfor agName in agents:<br \/>\n#print agName.getName()<br \/>\ncd(agName.getName())<br \/>\nmsgpend=cmo.getMessagesPendingCount()<br \/>\nmsgcur=cmo.getMessagesCurrentCount()<br \/>\nmsgtot=cmo.getMessagesReceivedCount()<br \/>\n#print &#8216;%s messages received %s\u00a0 = %d\u00a0 %d\u00a0 %d&#8217; % (agName.getName(), sname.getName(), msgcur, msgpend, msgtot)<br \/>\n#print &#8216;%-30s %s\u00a0 CUR:%5d\u00a0\u00a0 PEND:%5d\u00a0\u00a0 RECV:%5d&#8217; % (agName.getName(), sname.getName(), msgcur,msgpend,msgtot )<br \/>\nprint &#8216;%-30s\u00a0 CUR:%5d\u00a0\u00a0 PEND:%5d\u00a0 RECV:%8d&#8217; % (agName.getName(),\u00a0 msgcur,msgpend,msgtot )<br \/>\ncd(&#8220;..&#8221;)<br \/>\nexcept WLSTException,e:<br \/>\npass<br \/>\nexcept WLSTException,e:<br \/>\n# this typically means the server is not active, just ignore<br \/>\npass<br \/>\nprint &#8216;======================================================================&#8217;<br \/>\nprint &#8221;<br \/>\nimport time<br \/>\ntime.sleep(10)<br \/>\ndef getRunningServerNames():<br \/>\ndomainConfig()<br \/>\nreturn cmo.getServers()<br \/>\nif __name__== &#8220;main&#8221;:<br \/>\nmonitorThrds()<br \/>\ndisconnect()<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3 class=\"post-title entry-title\">weblogic wlst jms monitoring<\/h3>\n<div id=\"post-body-9107238701200419222\" class=\"post-body entry-content\">import thread<br \/>\nfrom java.util import Date<br \/>\nfrom java.text import SimpleDateFormat<br \/>\n# Configured user credentials with storeUserConfigdef monitorJMS():<br \/>\nconnect(&#8220;weblogic&#8221;, &#8220;<a href=\"mailto:smf@admin1\">pwd<\/a>&#8220;, &#8220;t3:\/\/IP:Port&#8221;);<br \/>\nservers = domainRuntimeService.getServerRuntimes();<br \/>\nfor i in range(10000):<br \/>\nprint &#8216;[&#8216; + SimpleDateFormat(&#8216;d MMM yyyy HH:mm:ss&#8217;).format(java.util.Date()) + &#8216;]&#8217;<br \/>\nif (len(servers) &gt; 0):<br \/>\nfor server in servers:<br \/>\nprint &#8216;\u00a0 Server Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216; , server<br \/>\njmsRuntime = server.getJMSRuntime();<br \/>\njmsServers = jmsRuntime.getJMSServers();<br \/>\nfor jmsServer in jmsServers:<br \/>\ndestinations = jmsServer.getDestinations();<br \/>\nfor destination in destinations:<br \/>\nprint destination.getName()<br \/>\nprint &#8216;\u00a0 MessagesCurrentCount\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216; ,\u00a0 destination.getMessagesCurrentCount()<br \/>\nprint &#8216;\u00a0 MessagesHighCount\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216; ,\u00a0 destination.getMessagesHighCount()<br \/>\nprint &#8216;\u00a0 MessagesMovedCurrentCount\u00a0\u00a0 &#8216; ,\u00a0 destination.getMessagesMovedCurrentCount()<br \/>\nprint &#8216;\u00a0 MessagesPendingCount\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216; ,\u00a0 destination.getMessagesPendingCount()<br \/>\nprint &#8216;\u00a0 MessagesReceivedCount\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216; ,\u00a0 destination.getMessagesReceivedCount()<br \/>\nprint &#8221;<br \/>\nimport time<br \/>\ntime.sleep(10)<br \/>\nif __name__== &#8220;main&#8221;:<br \/>\nmonitorJMS()<br \/>\ndisconnect()<\/p>\n<h3 class=\"post-title entry-title\"><a href=\"http:\/\/www.javamonamour.org\/2013\/11\/wlst-to-monitor-all-datasources-on-all.html\">WLST to monitor all Datasources on all Managed Servers by connecting only to the Admin<\/a><\/h3>\n<div class=\"post-body entry-content\">\n<pre>#connect to the admin server\r\n\r\ndomainRuntime()\r\nallservers=ls('\/ServerRuntimes\/', returnMap='true')\r\nfor server in allservers:\r\n    allds = ls('\/ServerRuntimes\/' + server + '\/JDBCServiceRuntime\/' + server + '\/JDBCDataSourceRuntimeMBeans', returnMap='true')\r\n    for ds in allds:\r\n        cd ('\/ServerRuntimes\/' + server + '\/JDBCServiceRuntime\/' + server + '\/JDBCDataSourceRuntimeMBeans\/' + ds)\r\n        print server, ds, cmo.getActiveConnectionsCurrentCount()\r\n\r\n\r\n\r\n<\/pre>\n<h3 class=\"post-title entry-title\">WLST to dump free heap memory<\/h3>\n<div id=\"post-body-2897979750884264221\" class=\"post-body entry-content\">\n<pre class=\"source-code\"><code>from java.io import FileWriter\r\nfrom java.io import BufferedWriter\r\nfrom java.util import Date\r\nconnect(eval('username'),eval('password'),eval('url'))\r\ndomainRuntime()\r\ncd('\/ServerRuntimes\/' + eval('managedServerName') + '\/JVMRuntime\/' + eval('managedServerName'))\r\nheapFreeCurrentPerOld = str(cmo.getHeapFreePercent())\r\nheapFreeCurrentValOld = str(cmo.getHeapFreeCurrent())\r\ncmo.runGC()\r\njava.lang.Thread.sleep(int(eval('sleepTime')))\r\n\r\nheapFreeCurrentPerNew = str(cmo.getHeapFreePercent())\r\nheapFreeCurrentValNew = str(cmo.getHeapFreeCurrent())\r\nnewDate = Date()\r\nfstream = FileWriter(eval('outputFile'),true)\r\nout =  BufferedWriter(fstream)\r\nout.write(eval('managedServerName') + \",\" + str(newDate.getTime()) + \",\" + heapFreeCurrentPerOld + \",\" + heapFreeCurrentValOld + \",\" + heapFreeCurrentPerNew + \",\" + heapFreeCurrentValNew + \"\\n\");\r\nout.close();\r\ndisconnect()\r\nexit()\r\n<\/code><\/pre>\n<p>There is also a property file which contains the configuration information<\/p>\n<pre class=\"source-code\"><code>managedServerName=&lt;MANAGED&gt;\r\nusername=&lt;USER&gt;\r\npassword=&lt;PASSWORD&gt;\r\nurl=&lt;URL&gt;\r\nsleepTime=&lt;PAUSE&gt;\r\noutputFile=&lt;PathToFile.csv&gt;\r\n<\/code><\/pre>\n<p>And finally to run<\/p>\n<p>$WL_SERVER_HOME\/common\/bin&gt;wlst -loadProperties<span class=\"Apple-converted-space\"><br \/>\n<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>Monitoring the JCA Adapter\u2019s through WLST script \u2013 Oracle SOA 11g<\/h3>\n<p>Sometimes we may need to monitor the runtime performance of the JCA adapters, the monitoring is possible through EM console for limited details, the below WLST script will help us to monitor the required details of the JCA adapter (the scrip should be extended to monitor more details).<\/p>\n<p>The below script can be used for monitoring only the DBAdapter\u2019s and MQAdapter\u2019s; the same can be extended to monitor other JCA Adapters (like FileAdapter) .<\/p>\n<p>Before executing the script change the below condition according to your server name.<\/p>\n<p><strong><em>if server.getName().strip().startswith(&#8216;S&#8217;) | server.getName().strip().startswith(&#8216;O&#8217;)<\/em><\/strong><\/p>\n<p>The Adapters are only available in SOA and OSB servers so that I am filtering the other servers \u00a0based on the name(AdminServer or MS servers) .The exception will be thrown if we are trying to cd the MBean related to Adapters in others servers.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>def monitorDBAdapter(serverName):<br \/>\ncd(&#8220;ServerRuntimes\/&#8221;+str(serverName)+&#8221;\/ApplicationRuntimes\/DbAdapter\/ComponentRuntimes\/DbAdapter\/ConnectionPools&#8221;)<br \/>\nconnectionPools = ls(returnMap=&#8217;true&#8217;)<br \/>\nprint &#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8216;<br \/>\nprint &#8216;DBAdapter Runtime details for &#8216;+ serverName<br \/>\nprint &#8216;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216;<br \/>\nprint &#8216;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216;<br \/>\nprint &#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8216;<\/p>\n<p>print &#8216;%10s %13s %15s %18s&#8217; % (&#8216;Connection Pool&#8217;, &#8216;State&#8217;, &#8216;Current&#8217;, &#8216;Created&#8217;)<br \/>\nprint &#8216;%10s %10s %24s %21s&#8217; % (&#8221;, &#8221;, &#8216;Capacity&#8217;, &#8216;Connections&#8217;)<br \/>\nprint &#8216;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216;<br \/>\nprint &#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8216;<br \/>\nfor connectionPool in connectionPools:<br \/>\nif connectionPool!=&#8217;eis\/DB\/SOADemo&#8217;:<br \/>\ncd(&#8216;\/&#8217;)<br \/>\ncd(&#8220;ServerRuntimes\/&#8221;+str(serverName)+&#8221;\/ApplicationRuntimes\/DbAdapter\/ComponentRuntimes\/DbAdapter\/ConnectionPools\/&#8221;+str(connectionPool))<br \/>\nprint &#8216;%15s %15s %10s %20s&#8217; % (cmo.getName(), cmo.getState(), cmo.getCurrentCapacity(), cmo.getConnectionsCreatedTotalCount())<\/p>\n<p>print &#8216;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216;<br \/>\nprint &#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8216;<\/p>\n<p>def monitorMQAdapter(serverName):<br \/>\ncd(&#8220;ServerRuntimes\/&#8221;+str(serverName)+&#8221;\/ApplicationRuntimes\/MQSeriesAdapter\/ComponentRuntimes\/MQSeriesAdapter\/ConnectionPools&#8221;)<br \/>\nconnectionPoolsMQ = ls(returnMap=&#8217;true&#8217;)<br \/>\nprint &#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8216;<br \/>\nprint &#8216;MQAdapter Runtime details for &#8216;+ serverName<br \/>\nprint &#8216;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216;<br \/>\nprint &#8216;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216;<br \/>\nprint &#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8216;<\/p>\n<p>print &#8216;%15s %17s %15s %18s&#8217; % (&#8216;Connection Pool&#8217;, &#8216;State&#8217;, &#8216;Current&#8217;, &#8216;Created&#8217;)<br \/>\nprint &#8216;%15s %15s %24s %21s&#8217; % (&#8221;, &#8221;, &#8216;Capacity&#8217;, &#8216;Connections&#8217;)<br \/>\nprint &#8216;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216;<br \/>\nprint &#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8216;<br \/>\nfor connectionPoolMQ in connectionPoolsMQ:<br \/>\ncd(&#8216;\/&#8217;)<br \/>\ncd(&#8220;ServerRuntimes\/&#8221;+str(serverName)+&#8221;\/ApplicationRuntimes\/MQSeriesAdapter\/ComponentRuntimes\/MQSeriesAdapter\/ConnectionPools\/&#8221;)<br \/>\ncd(connectionPoolMQ)<br \/>\nprint &#8216;%15s %20s %10s %20s&#8217; % (cmo.getName(), cmo.getState(), cmo.getCurrentCapacity(), cmo.getConnectionsCreatedTotalCount())<\/p>\n<p>print &#8216;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8216;<br \/>\nprint &#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8216;<\/p>\n<p>def main():<br \/>\n#connect(username, password, admurl)<br \/>\nconnect(&#8216;weblogic&#8217;,&#8217;password&#8217;,&#8217;t3:\/\/&lt;&lt;SOA Host&gt;&gt;:&lt;&lt;SOA Port&gt;&gt;&#8217;)<br \/>\nservers = cmo.getServers()<br \/>\ndomainRuntime()<br \/>\nfor server in servers:<br \/>\ncd(&#8220;\/ServerLifeCycleRuntimes\/&#8221; + server.getName())<br \/>\nif cmo.getState() == &#8216;RUNNING&#8217;:<br \/>\nif server.getName().strip().startswith(&#8216;S&#8217;) | server.getName().strip().startswith(&#8216;O&#8217;) :<br \/>\nmonitorDBAdapter(server.getName())<br \/>\nfor server in servers:<br \/>\ncd(&#8216;\/&#8217;)<br \/>\ncd(&#8220;\/ServerLifeCycleRuntimes\/&#8221; + server.getName())<br \/>\nif cmo.getState() == &#8216;RUNNING&#8217;:<br \/>\nif server.getName().strip().startswith(&#8216;S&#8217;) | server.getName().strip().startswith(&#8216;O&#8217;) :<br \/>\nmonitorMQAdapter(server.getName())<br \/>\ndisconnect()<\/p>\n<p>main()<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Server State using WLST<\/strong><\/p>\n<p>While trouble shooting administrator need to check the status of all server instances. This is the basic need when the all the servers are in bounced for production code move. This same script can be applicable for the pre-production or staging environment too. WLST provides the built-in methods, which gives the status of the Server instance or servers in a Cluster. Here we will deal with individual instance wise data.<\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2015\/04\/ServerLifeCycle.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4587\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2015\/04\/ServerLifeCycle.png\" alt=\"ServerLifeCycle\" width=\"640\" height=\"327\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2015\/04\/ServerLifeCycle.png 640w, https:\/\/mohan.sg\/wp-content\/uploads\/2015\/04\/ServerLifeCycle-300x153.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2015\/04\/ServerLifeCycle-150x77.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2015\/04\/ServerLifeCycle-400x204.png 400w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Using above shown MBean hierarchy we can fetch the all WebLogic domain server instance&#8217;s states. If your production WebLogic domain consists of two digit (eg. 60 instances) or three digit number (eg. 120 instances) of managed server then, it is difficult to see all server\u2019s state at once. Weblogic Administration console is unable to show all the servers in the domain on a single page. Navigating in between also a time eating process so think! think better way!! WLST has the solution.<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>To get the status of all servers in the domain can be obtained with the following steps<br \/>\n1. Connect to the Admin Server<br \/>\n2. Fetch the server list from the domain runtime MBean<br \/>\n3. Iterate the loop and get the state of each managed server with Server Life Cycle Runtime MBean<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\n4. Repeat if required the step 3 as per the user input<br \/>\n5. Finally disconnect<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>##################################################<br \/>\n# This script is used to check the status of all WL instances including the admin<br \/>\n###########################################################<\/p>\n<p>def conn():<br \/>\nUCF=&#8217;\/path\/.AdminScripts\/userConfigFile.sec&#8217;<br \/>\nUKF=&#8217;\/path\/.AdminScripts\/userKeyFile.sec&#8217;<br \/>\nadmurl = &#8220;t3:\/\/hostname:wlport&#8221;<\/p>\n<p>try:<br \/>\nconnect(userConfigFile=UCF, userKeyFile=UKF, url=admurl)<br \/>\nexcept ConnectionException,e:<br \/>\nprint &#8216;\\033[1;31m Unable to find admin server&#8230;\\033[0m&#8217;<br \/>\nexit()<\/p>\n<p>def ServrState():<br \/>\nprint &#8216;Fetching state of every WebLogic instance&#8217;<br \/>\n#Fetch the state of the every WebLogic instance<br \/>\nfor name in serverNames:<br \/>\ncd(&#8220;\/ServerLifeCycleRuntimes\/&#8221; + name.getName())<br \/>\nserverState = cmo.getState()<br \/>\nif serverState == &#8220;RUNNING&#8221;:<br \/>\nprint &#8216;Server &#8216; + name.getName() + &#8216; is :\\033[1;32m&#8217; + serverState + &#8216;\\033[0m&#8217;<br \/>\nelif serverState == &#8220;STARTING&#8221;:<br \/>\nprint &#8216;Server &#8216; + name.getName() + &#8216; is :\\033[1;33m&#8217; + serverState + &#8216;\\033[0m&#8217;<br \/>\nelif serverState == &#8220;UNKNOWN&#8221;:<br \/>\nprint &#8216;Server &#8216; + name.getName() + &#8216; is :\\033[1;34m&#8217; + serverState + &#8216;\\033[0m&#8217;<br \/>\nelse:<br \/>\nprint &#8216;Server &#8216; + name.getName() + &#8216; is :\\033[1;31m&#8217; + serverState + &#8216;\\033[0m&#8217;<br \/>\nquit()<\/p>\n<p>def quit():<br \/>\nprint &#8216;\\033[1;35mRe-Run the script HIT any key..\\033[0m&#8217;<br \/>\nAns = raw_input(&#8220;Are you sure Quit from WLST&#8230; (y\/n)&#8221;)<br \/>\nif (Ans == &#8216;y&#8217;):<br \/>\ndisconnect()<br \/>\nstopRedirect()<br \/>\nexit()<br \/>\nelse:<br \/>\nServrState()<\/p>\n<p>if __name__== &#8220;main&#8221;:<br \/>\nredirect(&#8216;.\/logs\/Server.log&#8217;, &#8216;false&#8217;)<br \/>\nconn()<br \/>\nserverNames = cmo.getServers()<br \/>\ndomainRuntime()<br \/>\nServrState()<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3 class=\"post-title entry-title\">Monitor Weblogic using WLST in java<\/h3>\n<div id=\"post-body-8436301589917323606\" class=\"post-body entry-content\">\n<div dir=\"ltr\">Here is the code i used to monitor the weblogic server details written in java using WLST. At times the weblogic console doesnt respond or is very slow. The script helps getting the important data needed during issues and help monitoring the server.Main parameters that we normally want to monitor :<br \/>\n&#8211; JVM Stats<br \/>\n&#8211; JMS stats<br \/>\n&#8211; JTA stats<br \/>\n&#8211; Thread Pool<br \/>\n&#8211; Deployed Application stateHere goes the java file , it fetches this data and writes to a text file.<\/p>\n<div><\/div>\n<div>\n<div><b>Utility method to write the data to file<\/b><\/div>\n<div>\u00a0 \u00a0public static void writeFile(StringBuffer data) {<\/div>\n<div>\u00a0 \u00a0 \u00a0try {<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0FileWriter outFile = new FileWriter(&#8220;C:\\\\ServerStats\\\\serverinfo.txt&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0BufferedWriter out = new BufferedWriter(outFile);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0out.write(data.toString());<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0out.close();<\/div>\n<div>\u00a0 \u00a0 \u00a0}catch(Exception e){e.printStackTrace();}<\/div>\n<div>\u00a0 }<\/div>\n<div><\/div>\n<\/div>\n<div>\n<div><b>Main code to fetch server info :<\/b><\/div>\n<div>The code is pretty simple and additional code for other parameters can be added easily.<\/div>\n<div><\/div>\n<div><\/div>\n<div>\u00a0 StringBuffer data= new StringBuffer(&#8220;Data&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 MBeanHome home = null;<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0String url = &#8220;t3:\/\/serverurl:port&#8221;;<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0String username = &#8220;weblogic&#8221;;<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0String password = &#8220;welcome1&#8221;;<\/div>\n<div><\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 try {<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Environment env = new Environment();<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 env.setProviderUrl(url);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 env.setSecurityPrincipal(username);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 env.setSecurityCredentials(password);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Context ctx = env.getInitialContext();<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 home = (MBeanHome) ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 } catch (Exception e) {System.out.println(&#8220;Exception caught: &#8221; + e);}<\/div>\n<div><\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 try {<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;DOMAIN NAME : \u00a0&#8221; + \u00a0home.getActiveDomain().getName() +&#8221;\\n&#8221;);<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 } catch (Exception e) {System.out.println(&#8220;Exception: &#8221; + e);}<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Set mbeanSet = home.getMBeansByType(&#8220;ServerRuntime&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0data.append(&#8220;Number of servers in the domain: &#8221; + mbeanSet.size() +&#8221;\\n&#8221;);<\/div>\n<div><\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Iterator mbeanIterator = mbeanSet.iterator();<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 int cls=1;<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 while(mbeanIterator.hasNext()) {<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ServerRuntimeMBean serverRuntime = \u00a0(ServerRuntimeMBean)mbeanIterator.next();<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if(cls==1)<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 {<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 try{<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ClusterRuntimeMBean clusterruntime = serverRuntime.getClusterRuntime();<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;- CLUSTER INFORMATION&#8212;&#8212;&#8212;&#8212;&#8212;&#8221; + &#8220;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;1. Cluster Name : \u00a0&#8220;+clusterruntime.getName()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;2. Cluster MulticastMessagesLostCount : &#8220;+clusterruntime.getMulticastMessagesLostCount()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;3. Cluster Server Names \u00a0&#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 for(int j=0;j&lt;clusterruntime.getServerNames().length;j++) {<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8221; Server : \u00a0&#8220;+(clusterruntime.getServerNames())[j] + &#8220;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }catch(Exception e){e.printStackTrace();}<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div><\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/if(cls==1)<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/{<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 try{<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;- WEB SERVER INFORMATION&#8212;&#8212;&#8212;&#8212;&#8212;&#8221; + &#8220;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 WebServerRuntimeMBean[] webserverruntime = serverRuntime.getWebServerRuntimes();<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 for(int j=0;j&lt;webserverruntime.length;j++) {<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;1. Web server info : Web server Names \u00a0&#8220;+webserverruntime[j].getWebServerName()+&#8221;\\n&#8221;);<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }catch(Exception e){e.printStackTrace();}<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if(serverRuntime.getState().equals(ServerStates.RUNNING)){<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8221; INFO STARTS FOR SERVER &#8220;+serverRuntime.getName()+&#8221; ******&#8221;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0data.append(&#8220;1. Server Name = &#8221; + serverRuntime.getName()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0data.append(&#8220;2. Server ListenAddress = &#8221; + \u00a0serverRuntime.getListenAddress()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0data.append(&#8220;3. Server ListenPort = &#8221; + \u00a0serverRuntime.getListenPort()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0data.append(&#8220;4. Admin server Host = &#8221; + \u00a0serverRuntime.getAdminServerHost()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0data.append(&#8220;5. Health state = &#8221; + \u00a0serverRuntime.getHealthState()+&#8221;\\n&#8221;);<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8221; JVM Parameters For SERVER &#8220;+serverRuntime.getName()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 JVMRuntimeMBean jvmruntime = serverRuntime.getJVMRuntime();<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;1. JVM Current Heap size = &#8221; + jvmruntime.getHeapSizeCurrent()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;2. JVM \u00a0Heap free Current \u00a0= &#8221; + jvmruntime.getHeapFreeCurrent()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;3. JVM \u00a0Heap free Percent = &#8221; + jvmruntime.getHeapFreePercent()+&#8221;%&#8221;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;4. JVM \u00a0Heap size max = &#8221; + jvmruntime.getHeapSizeMax()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;5. JVM \u00a0JavaVersion = &#8221; + jvmruntime.getJavaVersion()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;6. JVM \u00a0JavaVendor = &#8221; + jvmruntime.getJavaVendor()+&#8221;\\n&#8221;);<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 try{<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ExecuteQueueRuntimeMBean[] executeQueueRuntime =serverRuntime.getExecuteQueueRuntimes();<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8221; Execute Queue Runtime parameters &#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 for(int j =0;j&lt;executeQueueRuntime.length;j++)<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 {<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;1. Execute Queue ThreadTotalCount = \u00a0&#8220;+executeQueueRuntime[j].getExecuteThreadTotalCount()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;2. Execute Queue ThreadCurrentIdleCount = \u00a0&#8220;+executeQueueRuntime[j].getExecuteThreadCurrentIdleCount()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;3. Pending RequestCurrentCount = \u00a0&#8220;+executeQueueRuntime[j].getPendingRequestCurrentCount()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;4. PendingRequestOldestTime = \u00a0&#8220;+executeQueueRuntime[j].getPendingRequestOldestTime()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }catch(Exception e){e.printStackTrace();}<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8221; \u00a0JTA STATS FOR SERVER &#8220;+serverRuntime.getName() +&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 JTARuntimeMBean jtaruntime= serverRuntime.getJTARuntime();<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0data.append( &#8220;1. Total Trx = &#8221; + jtaruntime.getActiveTransactionsTotalCount()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0data.append( &#8220;2. Total Abondened Trx = &#8221; + jtaruntime.getTransactionAbandonedTotalCount()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0data.append( &#8220;3. Total Commited Trx = &#8221; + jtaruntime.getTransactionCommittedTotalCount()+&#8221;\\n&#8221;);<\/div>\n<div><\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8221; JMS Parameters FOR SERVER \u00a0&#8220;+serverRuntime.getName()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 JMSRuntimeMBean jmsruntime= serverRuntime.getJMSRuntime();<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 JMSServerRuntimeMBean[] jmsservers= jmsruntime.getJMSServers();<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 for(int i=0;i&lt;jmsservers.length;i++)<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 {<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0data.append( &#8220;1. JMS Server Name = &#8220;+jmsservers[i].getName()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0data.append( &#8220;2. MessagesHighCount = &#8220;+jmsservers[i].getMessagesHighCount()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0data.append( &#8220;3. MessagesPendingCount = &#8220;+jmsservers[i].getMessagesPendingCount()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0data.append( &#8220;3. DestinationsCurrentCount = &#8220;+jmsservers[i].getDestinationsCurrentCount()+&#8221;\\n&#8221;);<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;4. JMS Health : &#8221; + jmsruntime.getHealthState()+&#8221;\\n&#8221;);<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8221; Application Runtime Data FOR SERVER \u00a0&#8220;+serverRuntime.getName()+&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8220;+&#8221;\\n&#8221;);<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0ApplicationRuntimeMBean[] appruntime = serverRuntime.getApplicationRuntimes();<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0for(int j=0;j&lt;appruntime.length;j++)<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0{<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0if(appruntime[j].isEAR())<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0{<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;Application Name : &#8221; +appruntime[j].getApplicationName() +&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8220;Application Name : &#8221; +appruntime[j].getHealthState() +&#8221;\\n&#8221;);<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0}<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0}<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ ThreadPoolRuntimeMBean tpoolruntime=serverRuntime.getThreadPoolRuntime();<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 data.append(&#8221; INFO ENDS FOR SERVER &#8220;+serverRuntime.getName() +&#8221;\\n&#8221;);<\/div>\n<div><\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 cls++;<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\/\/while ends<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 writeFile(data);<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<div id=\"highlighter_433745\" class=\"syntaxhighlighter  py ie\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\"><\/td>\n<td class=\"code\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3 class=\"post-title entry-title\">WEBLOGIC MONITORING SCRIPT in WLST Tool<\/h3>\n<div id=\"post-body-5728710329058693876\" class=\"post-body entry-content\">\n<div dir=\"ltr\">Web Logic Monitoring Script in WLST which would monitor JVM, Execute Queue, JDBC and JMS resources of all the Web Logic instances running in a domain. Please feel free to modify the script as necessary.<\/p>\n<div><b>WLST Script:<\/b><\/p>\n<div><b><br \/>\n<\/b># WLST WebLogic Server Monitoring Scriptusername=&#8217;wxyz&#8217;<br \/>\npassword=&#8217;******&#8217;<br \/>\nurldict={}<br \/>\nconnect(username,password,&#8217;t3:\/\/kyarpt5q:9001&#8242;)<br \/>\nserverlist=adminHome.getMBeansByType(&#8216;Server&#8217;)<br \/>\nfor svr in serverlist:<br \/>\nurldict[svr.getName()]=&#8217;t3:\/\/&#8217;+svr.getListenAddress()+&#8217;:&#8217;+str(svr.getListenPort())<br \/>\ndisconnect()<\/p>\n<p>for svr,url in urldict.items():<br \/>\ntry:<br \/>\nconnect(username,password,url)<br \/>\njvmrtlist=home.getMBeansByType(&#8216;JVMRuntime&#8217;)<br \/>\nprint &#8216; &#8216;<br \/>\nprint &#8216; &#8216;<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\nprint &#8216;The Runtime Stats of Server: &#8216;+svr<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\nprint &#8216; &#8216;<br \/>\nprint &#8216;JVM&#8217;<br \/>\nprint &#8216; &#8216;<br \/>\nprint &#8216;FreeJVM TotalJVM UsedJVM&#8217;<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\nprint &#8216; &#8216;<br \/>\nfor jvmRT in jvmrtlist:<br \/>\nfreejvm = jvmRT.getAttribute(&#8220;HeapFreeCurrent&#8221;)<br \/>\ntotaljvm = jvmRT.getAttribute(&#8220;HeapSizeCurrent&#8221;)<br \/>\nusedjvm = (totaljvm &#8211; freejvm)<br \/>\nprint freejvm,&#8217; &#8216;,totaljvm,&#8217; &#8216;,usedjvm<br \/>\nprint &#8216; &#8216;<\/p>\n<p>eqrtlist=home.getMBeansByType(&#8216;ExecuteQueueRuntime&#8217;)<br \/>\nprint &#8216; &#8216;<br \/>\nprint &#8216; &#8216;<br \/>\nprint &#8216;EXECUTE QUEUES&#8217;<br \/>\nprint &#8216; &#8216;<br \/>\nprint &#8216;ExecuteQueueName TotalCount CurrIdleCount PendRequestCurrCount ServicedRequestTotalCount&#8217;<br \/>\nprint &#8216; &#8216;<br \/>\nfor eqRT in eqrtlist:<br \/>\neqname = eqRT.getAttribute(&#8220;Name&#8221;)<br \/>\neqtthreads = eqRT.getAttribute(&#8220;ExecuteThreadTotalCount&#8221;)<br \/>\neqithreads = eqRT.getAttribute(&#8220;ExecuteThreadCurrentIdleCount&#8221;)<br \/>\neqqc = eqRT.getAttribute(&#8220;PendingRequestCurrentCount&#8221;)<br \/>\neqthrougp = eqRT.getAttribute(&#8220;ServicedRequestTotalCount&#8221;)<br \/>\nprint eqname,&#8217; &#8216;,eqtthreads,&#8217; &#8216;,eqithreads,&#8217; &#8216;,eqqc,&#8217; &#8216;,eqthrougp<br \/>\nprint &#8216; &#8216;<\/p>\n<p>poolrtlist=home.getMBeansByType(&#8216;JDBCConnectionPoolRuntime&#8217;)<br \/>\nprint &#8216; &#8216;<br \/>\nprint &#8216; &#8216;<br \/>\nprint &#8216;JDBC CONNECTION POOLS&#8217;<br \/>\nprint &#8216; &#8216;<br \/>\nprint &#8216;Name Maxcapacity ActiveCurrent ActiveHighCount WaitSecondsHighCount WaitingCurrentCount State&#8217;<br \/>\nprint &#8216; &#8216;<br \/>\nfor poolRT in poolrtlist:<br \/>\npname = poolRT.getName()<br \/>\npmaxcapacity = poolRT.getAttribute(&#8220;MaxCapacity&#8221;)<br \/>\npaccc = poolRT.getAttribute(&#8220;ActiveConnectionsCurrentCount&#8221;)<br \/>\npachc = poolRT.getAttribute(&#8220;ActiveConnectionsHighCount&#8221;)<br \/>\npwshc = poolRT.getAttribute(&#8220;WaitSecondsHighCount&#8221;)<br \/>\npwfccc = poolRT.getAttribute(&#8220;WaitingForConnectionCurrentCount&#8221;)<br \/>\npstate = poolRT.getAttribute(&#8220;State&#8221;)<br \/>\nprint pname,&#8217; &#8216;,pmaxcapacity,&#8217; &#8216;,paccc,&#8217; &#8216;,pachc,&#8217; &#8216;, pwshc,&#8217; &#8216;,pwfccc,&#8217; &#8216;,pstate<br \/>\nprint &#8216; &#8216;<\/p>\n<p>jmsrtlist=home.getMBeansByType(&#8216;JMSDestinationRuntime&#8217;)<br \/>\nprint &#8216; &#8216;<br \/>\nprint &#8216; &#8216;<br \/>\nprint &#8216;JMS DESTINATIONS&#8217;<br \/>\nprint &#8216; &#8216;<br \/>\nprint &#8216;Name ByteCurr Pending Received High MsgCurr Pending High Received ConsumersTotal&#8217;<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\nprint &#8216; &#8216;<br \/>\nfor jmsRT in jmsrtlist:<br \/>\njmsname = jmsRT.getAttribute(&#8220;Name&#8221;)<br \/>\njmsbcc = jmsRT.getAttribute(&#8220;BytesCurrentCount&#8221;)<br \/>\njmsbpc = jmsRT.getAttribute(&#8220;BytesPendingCount&#8221;)<br \/>\njmsbrc = jmsRT.getAttribute(&#8220;BytesReceivedCount&#8221;)<br \/>\njmsbhc = jmsRT.getAttribute(&#8220;BytesHighCount&#8221;)<br \/>\njmsmcc = jmsRT.getAttribute(&#8220;MessagesCurrentCount&#8221;)<br \/>\njmsmpc = jmsRT.getAttribute(&#8220;MessagesPendingCount&#8221;)<br \/>\njmsmhc = jmsRT.getAttribute(&#8220;MessagesHighCount&#8221;)<br \/>\njmsmrc = jmsRT.getAttribute(&#8220;MessagesReceivedCount&#8221;)<br \/>\njmsctc = jmsRT.getAttribute(&#8220;ConsumersTotalCount&#8221;)<br \/>\nprint jmsname,&#8217; &#8216;,jmsbcc,&#8217; &#8216;,jmsbpc,&#8217; &#8216;,jmsbrc,&#8217; &#8216;,jmsbhc,&#8217; &#8216;,jmsmcc,&#8217; &#8216;,jmsmpc,&#8217; &#8216;,jmsmhc,&#8217; &#8216;, jmsmrc,&#8217; &#8216;,jmsctc<br \/>\nprint &#8216; &#8216;<\/p>\n<p>disconnect()<br \/>\nexcept:<br \/>\nprint &#8220;Skipping &#8220;+svr<br \/>\ncontinue<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p> Automation of Monitoring Weblogic Server Runtime using WLST In a production environment, the health and the runtime of the Weblogic server instances must be pro-actively monitored in order to prevent the outage\/interruption of the service to customers.In this post I am explaining how theWLST (WebLogic Scripting Tool) can be used to automate the monitoring [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4576"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4576"}],"version-history":[{"count":12,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4576\/revisions"}],"predecessor-version":[{"id":4620,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4576\/revisions\/4620"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}