Monitoring Archive

Application State Monitoring using WLST

There are scenarios when you would want to monitor the Application state of the currently deployed applications in the Domain using the WebLogic Server Runtime Mbeans. Properties like Application State.
This can be achieved through many ways like the Admin Console, JMX code, WLST scripts etc. WLST allows us to automate the monitoring.

WebLogic Server runtime MBeans are arranged in a hierarchical data structure. When connected to an Administration Server, you access the runtime MBean hierarchy by entering the serverRuntime or the domainRuntime command. The serverRuntime command places WLST at the root of the server runtime management objects, ServerRuntimeMBean; the domainRuntime command, at the root of the domain-wide runtime management objects, DomainRuntimeMBean. When connected to a Managed Server, the root of the runtime MBeans is ServerRuntimeMBean. The domain runtime MBean hierarchy exists on the Administration Server only; you cannot use the domainRuntimecommand when connected to a Managed Server.

The below post depicts the usage of WLST to monitor the Application State deployed in the domain.
Steps:
1. Script to monitor Application Runtime States
a. Save the below script ApplicationStatus.py on to your local machine.
**************************************************************************

 

connect('weblogic','weblogic','t3://localhost:8001')
domainRuntime()
cd('AppRuntimeStateRuntime/AppRuntimeStateRuntime')
AppList = cmo.getApplicationIds()
print '####### Application ####### Application State\n'
print '***********************************************\n'
for App in AppList:
print '#######',App ,' #######', cmo.getIntendedState(App)
print '***********************************************\n'

 

 

**************************************************************************
2. Execute the WLST Script
a. Set the CLASSPATH by running the setDomainEnv script from the
Alternatively you can set the CLASSPATH by specifying the –cp argument while executing the WLST Script
For Ex: java –cp $BEA_HOME/wlserver_10.3/server/lib/weblogic.jar weblogic.WLST ApplicationStatus.py

Downloads

You can download the WLST script from the below link.

ApplicationStatus.py

Note: Rename the file as ApplicationStatus.py

References:

http://download.oracle.com/docs/cd/E11035_01/wls100/config_scripting/monitoring.html

Regards,
Wonders Team. 🙂

Apache Administration FAQ’s

How to disable Case Sensitivity in Apache?

Apache is case sensitive. When you application is hosted in case-insensitive webserver(like IIS) and moved to case-sensitive webserver (like Apache) you may get some problems related to non availability of URLS(HTTP 404 error). Apach provides a module which helps to make URLs case-insensitive.

Open httpd.conf(your apache configuration file) and find out the below line

LoadModule speling_module modules/mod_speling.so

If the above module is avilable with your apache, turn on the CheckSpelling directive

CheckSpelling On

How to monitor Apache server status?

There is a built in module mod_status available in apache which helps to get server status from a web browser

To monitor Apache webserver,

Open httpd.conf(Placed at <Apache Install Dir>/conf/httpd.conf)

vi httpd.conf

Set the Location directive as below. It will alow only from 192.13.24.57

<Location /server-status>

SetHandler server-status

Order Deny,Allow

Deny from all

Allow from 192.13.24.57

</Location>

Set ExtendendStatus to on

ExtendedStatus on

Save the httpd.conf and restart the webserver

Now you can monitor your apache webserver with http://servername/server-status from 192.13.24.57 browser

How to know whether a library is built on 32-bit or 64-bit?

Type below command at shell

file /usr/local/apache2.2.11/lib/libapr-1.so.0.3.3

The output of above command is,

/usr/local/apache2.2.11/lib/libapr-1.so.0.3.3: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped

The output tells that the libapr-1.so.0.3.3 file is built on 32-bit machines

Monitoring WebLogic Server Runtime using WLST

There are scenarios when you would want to monitor the properties of your alive servers in the Domain using the WebLogic Server Runtime Mbeans. Properties like Server State, Server Health, Listen Port, Listen Addresses etc.

This can be achieved through many ways like the Admin Console, JMX code, WLST scripts etc. WLST allows us to automate the monitoring.

WebLogic Server runtime MBeans are arranged in a hierarchical data structure. When connected to an Administration Server, you access the runtime MBean hierarchy by entering the serverRuntime or the domainRuntime command. The serverRuntime command places WLST at the root of the server runtime management objects, ServerRuntimeMBean; the domainRuntime command, at the root of the domain-wide runtime management objects, DomainRuntimeMBean. When connected to a Managed Server, the root of the runtime MBeans is ServerRuntimeMBean. The domain runtime MBean hierarchy exists on the Administration Server only; you cannot use the domainRuntimecommand when connected to a Managed Server.

The below post depicts the usage of WLST to monitor the Server State of all the running servers in the domain.

Steps:

1. Script to monitor Server Runtime States

a. Save the below script ServerStatus.py on to your local machine.

**************************************************************************

 

username = 'weblogic'

password = 'weblogic'

URL='t3://localhost:8001'

connect(username,password,URL)

domainRuntime()

cd('ServerRuntimes')

servers=domainRuntimeService.getServerRuntimes()

for server in servers:

serverName=server.getName();

print '**************************************************\n'

print '##############    ', serverName,    '###############'

print '**************************************************\n'

print '##### Server State           #####', server.getState()

print '##### Server ListenAddress   #####', server.getListenAddress()

print '##### Server ListenPort      #####', server.getListenPort()

print '##### Server Health State    #####', server.getHealthState()

 

**************************************************************************

2. Execute the WLST Script

a.  Set the CLASSPATH by running the setDomainEnv script from the

Alternatively you can set the CLASSPATH by specifying the –cp argument while executing the WLST Script

For Ex:  java –cp $BEA_HOME/wlserver_10.3/server/lib/weblogic.jar  weblogic.WLST ServerStatus.py

Downloads

You can download the WLST script from the below link.

ServerStatus.py

Note: Save the script as ServerStatus.py

References:

http://download.oracle.com/docs/cd/E11035_01/wls100/config_scripting/monitoring.html

Regards,

Wonders Team. 🙂