-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtestDatasources.py
30 lines (27 loc) · 1.17 KB
/
testDatasources.py
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
################################################
# testDatasources.py #
# Script to test all the datasources within a #
# WebSphere cell. #
# #
# usage: #
# <profile_home>/bin/wsadmin.sh -f #
# /path/to/testDatasources.py #
# #
# Brian S Paskin (IBM SWG) #
# 13 May 2013 #
################################################
# Get a list of the Datasources defined in the cell
datasources = AdminConfig.list('DataSource').splitlines()
# Loop through the datasources and test ignoring
# the default ones defined by WAS
for datasource in datasources:
# get the name of the datasource
name = AdminConfig.showAttribute(datasource, 'name')
# check the name to see if it is a WAS default and
# test Datasource
if ( name != "DefaultEJBTimerDataSource" ):
try:
AdminControl.testConnection(datasource)
print "Testing " + name + " successful "
except:
print "Testing " + name + " failed "