forked from pvelder/wlst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchwls
80 lines (70 loc) · 3.44 KB
/
chwls
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
66
67
68
69
70
71
72
73
74
75
76
77
78
# Set some constants
username='weblogic'
password='osbacc@gdi'
import socket
localhost = socket.gethostname()
import os
domain = os.getenv('WL_DOMAIN')
domain_dir= os.getenv('WL_DOMAIN_DIR')
mwHome = os.getenv('MW_HOME')
print mwHome
url = 't3://' + localhost + ':7001'
print url
connect(username, password,url)
servers = domainRuntimeService.getServerRuntimes();
for server in servers:
print 'SERVER: ' + server.getName();
print '**************************************************'
print serverName
print '**************************************************'
print '##### Server State #####', server.getState()
print '##### Server ListenAddress #####', server.getListenAddress()
print '##### Server ListenPort #####', server.getListenPort()
print '##### Server Health State #####', server.getHealthState()
print 'SERVER: ' + server.getName();
print('APPLICATION RUNTIME INFORMATION');
apps = server.getApplicationRuntimes();
for app in apps:
print 'Application: ' + app.getName();
crs = app.getComponentRuntimes();
for cr in crs:
print '-Component Type: ' + cr.getType();
if (cr.getType() == 'EJBComponentRuntime'):
ejbRTs = cr.getEJBRuntimes();
for ejbRT in ejbRTs:
print ' -EJBRunTime: ' + ejbRT.getName() + ' Type ' + ejbRT.getType();
if (ejbRT.getType() == 'MessageDrivenEJBRuntime'):
print ' -MDB Status: ' + ejbRT.getMDBStatus() + ', MDB Health State: ' + repr(ejbRT.getHealthState());
if (ejbRT.getType() == 'StatelessEJBRuntime'):
print ' -EJB Name: ' + ejbRT.getEJBName();
print ' -Resources: ' + repr(ejbRT.getTransactionRuntime());
if (cr.getType() == 'WebAppComponentRuntime'):
print ' -Name: ' + cr.getName() + ', Session Current Count: ' + repr(cr.getOpenSessionsCurrentCount());
servlets = cr.getServlets();
for servlet in servlets:
print ' -Servlet: ' + servlet.getServletName() + ', total: ' + repr(servlet.getInvocationTotalCount()) + ', average time: ' + repr(servlet.getExecutionTimeAverage());
print('JMS RUNTIME INFORMATION');
jmsRuntime = server.getJMSRuntime();
connections = jmsRuntime.getConnections();
for connection in connections:
print('-Connection Name: ' + connection.getName());
sessions = connection.getSessions();
for session in sessions:
print(' -Session Name: ' + session.getName());
consumers = session.getConsumers();
for consumer in consumers:
print(' -Consumer Name: ' + consumer.getName() + ', Bytes Received: ' + repr(consumer.getBytesReceivedCount()));
producers = session.getProducers();
for producer in producers:
print(' -Producer Name: ' + producer.getName() + ', Bytes Send: ' + repr(producer.getBytesSentCount()));
jmsServers = jmsRuntime.getJMSServers();
for jmsServer in jmsServers:
print('-JMSServer: ' + jmsServer.getName());
destinations = jmsServer.getDestinations();
for destination in destinations:
print(' -Destination: ' + destination.getName() + ', ' + repr(destination.getMessagesHighCount()) + ', ' + repr(destination.getConsumersHighCount()));
print('JDBC RUNTIME INFORMATION');
jdbcRuntime = server.getJDBCServiceRuntime();
datasources = jdbcRuntime.getJDBCDataSourceRuntimeMBeans();
for datasource in datasources:
print('-Data Source: ' + datasource.getName() + ', Active Connections: ' + repr(datasource.getActiveConnectionsCurrentCount()) + ', Waiting for Connections: ' + repr(datasource.getWaitingForConnectionCurrentCount()));