Your browser doesn't support the features requiredby impress.js, so you are presented with a simplified version of this presentation.
For the best experience please use the latest Chrome or Safari browser. Firefox 10 (to be released soon) will also handle it.
Die Benutzung aller Skripte auf diesen Folien und in den angegebenen Download Repositories erfolgt auf eigene Gefahr und ohne Garantie!
cd /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin [root@cnxwas1 bin]$ ./wsadmin.sh -lang jython -username wasadmin -password password
WASX7209I: Connected to process "dmgr" on node cnxwas1CellManager01 using SOAP connector; The type of process is: DeploymentManager WASX7031I: For help, enter: "print Help.help()" wsadmin>AdminControl.getCell() 'cnxwas1Cell01' wsadmin>execfile("connectionsConfig.py") Connections Administration initialized wsadmin>LCConfigService.checkOutConfig('/tmp','cnxwas1Cell01') # Edit /tmp/LotusConnections-config.xml and save your changes wsadmin>LCConfigService.checkInConfig('/tmp','cnxwas1Cell01') Loading schema file for validation: /tmp/LotusConnections-config.xsd Loading schema file for validation: /tmp/service-location.xsd /tmp/LotusConnections-config.xml is valid Connections configuration file successfully checked in
wsadmin>execfile("newsAdmin.py") Connecting to NewsMemberServiceName: News Configuration Environment initialized wsadmin>NewsMemberService.syncMemberExtIdByEmail("cstoettner@stoeps.local") syncMemberExtIdByEmail request processed
wsadmin>execfile("blogsAdmin.py") Connecting to {...} Blogs Administration initialized wsadmin>BlogsMemberService.syncMemberExtIdByEmail("cstoettner@stoeps.local") WASX70115E: Exception running command: "BlogsMemberSErvice.syncMemberExtIdByEmail("cstoettner@stoeps.local")"; exception information: There is no member associated with this email address or login name: cstoettner@stoeps.local wsadmin>BlogsMemberService.syncMemberExtIdByEmail("CStoettner@stoeps.local") syncMemberExtIdByEmail request processed
cd {WAS_HOME}/profiles/Dmgr01/bin
./wsadmin.sh -lang {jython | jacl} -username wasadmin -password password
wsadmin.bat -lang {jython | jacl} -username wasadmin -password password
export WAS_HOME=/opt/IBM/WebSphere/AppServer export DMGR=Dmgr01 export APPSRV=AppSrv01 alias dmgrBin='cd $WAS_HOME/profiles/$DMGR/bin' alias wsadmin='cd $WAS_HOME/profiles/$DMGR/bin;./wsadmin.sh -lang jython' alias nodeBin='cd $WAS_HOME/profiles/$APPSRV/bin' alias startNode='$WAS_HOME/profiles/$APPSRV/bin/startNode.sh' alias startDmgr='$WAS_HOME/bin/startManager.sh' alias stopNode='$WAS_HOME/profiles/$APPSRV/bin/stopNode.sh' alias stopDmgr='$WAS_HOME/bin/stopManager.sh' alias nodeLog='tail -f $WAS_HOME/profiles/$APPSRV/logs/nodeagent/SystemOut.log' alias InfraClusterLog='tail -f $WAS_HOME/profiles/$APPSRV/logs/InfraCluster_server1/SystemOut.log' alias Cluster1Log='tail -f $WAS_HOME/profiles/$APPSRV/logs/Cluster1_server1/SystemOut.log' alias Cluster2Log='tail -f $WAS_HOME/profiles/$APPSRV/logs/Cluster2_server1/SystemOut.log'
edit {WAS_HOME}/profiles/Dmgr01/properties/wsadmin.properties
{WAS_HOME}/profiles/Dmgr01/properties/soap.client.props
PropFilePasswordEncoder.sh soap.client.props com.ibm.SOAP.loginPassword
cd WAS_HOME
java/jre/bin/java \
-Djava.ext.dirs=deploytool/itp/plugins/com.ibm.websphere.v8_1.0.201.v20111031_1843/wasJars \
-cp securityimpl.jar:iwsorb.jar com.ibm.ws.security.util.PasswordDecoder \
"{xor}Lz4sLCgwLTs="
encoded password == "{xor}Lz4sLCgwLTs=", decoded password == "password"
[root@cnxwas1 bin]# ./wsadmin.sh -lang jython -username admin -password password WASX7209I: Connected to process "dmgr" on node cnxwas1CellManager01 using SOAP connector; The type of process is: DeploymentManager WASX7031I: For help, enter: "print Help.help()" wsadmin>synchAllNodes() WASX7015E: Exception running command: "synchAllNodes()"; exception information: com.ibm.bsf.BSFException: exception from Jython: Traceback (innermost last): File "", line 1, in ? NameError: synchAllNodes wsadmin>execfile("connectionsConfig.py") Connections Administration initialized wsadmin>synchAllNodes() Nodes synchronized
execfile('connectionsConfig.py') execfile("activitiesAdmin.py") execfile("blogsAdmin.py") execfile("communitiesAdmin.py") execfile("dogearAdmin.py") execfile("filesAdmin.py") execfile("forumsAdmin.py") execfile("homepageAdmin.py") execfile("newsAdmin.py") execfile("profilesAdmin.py") execfile("wikisAdmin.py")
cd {WAS_HOME}/profiles/Dmgr01/bin
Achtung: In Multinode Umgebungen wird beim Aufruf abgefragt, auf welchem Node dieser ausgeführt werden soll.
execfile("loadAll.py")
{WAS_HOME}/profiles/Dmgr01/properties/wsadmin.properties
./wsadmin.sh -lang jython -profile loadAll.py
# Defining a String x = 'Hello World' x = "Hello World Two" # Defining an integer y = 10 # Float z = 8.75 # Complex i = 1 + 8.07j # Multiple assignment x, y, z = 1, 2, 3
wsadmin>range(7) [0, 1, 2, 3, 4, 5, 6] # Include a step in the range wsadmin>range(0,10,3) [0, 3, 6, 9] # Good base for loops wsadmin>range(1,11) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] wsadmin>range(20,27) [20, 21, 22, 23, 24, 25, 26]
#List wsadmin>dbs = ['activities','blogs','communities','dogear','files','forum'] wsadmin>dbs[1] 'blogs'
# Dictionary with Performance Data wsadmin>minConnections = {'activities':1,'blogs':1,'communities':10,'dogear':1} wsadmin>maxConnections = {'activities':50,'blogs':250,'communities':200} wsadmin>maxConnections {'communities': 200, 'activities': 50, 'blogs': 250} wsadmin>maxConnections.keys() ['communities', 'activities', 'blogs'] wsadmin>maxConnections.values() [200, 50, 250] wsadmin>maxConnections['blogs'] 250
# Basic if condition : # print or do something elif other condition : # print or do something other else : # print or do completely different
# Example if value.find( 'CLFWY0217E' ) > -1 : print "\t\tuser already converted" elif value.find( 'CLFWY0212E' ) > -1 : print "\t\tuser not found in database" elif value.find( ' CLFWY0209E' ) > -1 : print "\t\tnew identifier '" + data[1] + "' does not exist." else : print '\t\tException value: ' + value
# For Loops dbs = ['activities','blogs','communities','dogear','files','forum','homepage'] for db in dbs: #loop through databases print "Database %s" % db
# While x = 0 y = 3 while x <= y : print 'Value of x is: %d' %(x) x += 1 else: print 'Completed!' Value of x is: 0 Value of x is: 1 Value of x is: 2 Value of x is: 3 Completed!
AdminConfig.list('ServerCluster', AdminConfig.getid( '/Cell:cnxwas1Cell01/')) # [9/20/13 12:45:36:204 CEST] WebSphere application server clusters AdminControl.invoke('WebSphere:name=InfraCluster,process=dmgr, platform=common,node=cnxwas1CellManager01,version=8.0.0.5,type=Cluster, mbeanIdentifier=InfraCluster,cell=cnxwas1Cell01,spec=1.0', 'rippleStart') # Note that scripting list commands may generate more information than is # displayed by the administrative console because the console generally filters # with respect to scope, templates, and built-in entries. # [9/22/13 19:09:43:718 CEST] DataSource AdminConfig.list('DataSource', AdminConfig.getid( '/Cell:cnxwas1Cell01/'))
# List of databases you want to check: dbs = ['activities','blogs','communities','dogear','files','forum','homepage'] for db in dbs: #loop through databases ds = AdminConfig.getid('/DataSource:' + db + '/') checkDS = AdminControl.testConnection(ds) if checkDS == "WASX7217I: Connection to provided datasource was successful." : print 'Connect to %s was successful' % db else : print 'Error: %s is not available' % db
Connect to activities was successful Connect to blogs was successful Connect to communities was successful [...]
#Define a dictionary with database names and parameters perf = {'activities':{'minConnections':1,'maxConnections':50}, 'blogs':{'minConnections':1,'maxConnections':250}, 'communities':{'minConnections':10,'maxConnections':200}, 'dogear':{'minConnections':1,'maxConnections':150}, 'files':{'minConnections':10,'maxConnections':100}, 'forum':{'minConnections':50,'maxConnections':100}, 'homepage':{'minConnections':20,'maxConnections':100}, ... 'wikis':{'minConnections':1,'maxConnections':100}} statementCacheSize = 100 #change to 50 for oracle
# perf.keys() gives a list of all databases in perf for db in perf.keys(): # Looping through databases, first values in dictionary # db.upper() convert the database name to capitals print 'Change DataSource parameters for: %s' % db.upper() t1=AdminConfig.getid('/DataSource:' + db + '/') print ' statementCacheSize: ' + str(statementCacheSize) print ' minConnections: ' + str(perf[db]['minConnections']) print ' maxConnections: ' + str(perf[db]['maxConnections']) AdminConfig.modify(t1,'[[statementCacheSize "' + str(statementCacheSize) + '"]]') AdminConfig.modify(t1,'[[connectionPool [[minConnections "' + str(perf[db]['minConnections']) + '"][maxConnections "' + str(perf[db]['maxConnections']) + '"]]]]') AdminConfig.save()
MAILADDRESS = sys.argv[0] print "Syncing MemberService for " + MAILADDRESS execfile("/opt/install/scripts/loadAll.py") ActivitiesMemberService.syncMemberExtIdByEmail(MAILADDRESS) BlogsMemberService.syncMemberExtIdByEmail(MAILADDRESS) CommunitiesMemberService.syncMemberExtIdByEmail(MAILADDRESS) DogearMemberService.syncMemberExtIdByEmail(MAILADDRESS) FilesMemberService.syncMemberExtIdByEmail(MAILADDRESS) ForumsMemberService.syncMemberExtIdByEmail(MAILADDRESS) NewsMemberService.syncMemberExtIdByEmail(MAILADDRESS) WikisMemberService.syncMemberExtIdByEmail(MAILADDRESS)
./wsadmin.sh –lang jython –f "memberSyncByEmail.py" "cstoettner@stoeps.local"
EmailMatch = sys.argv[0] # Loading Connections Administration Commands execfile("activitiesAdmin.py") execfile("blogsAdmin.py") execfile("communitiesAdmin.py") execfile("dogearAdmin.py") execfile("filesAdmin.py") execfile("forumsAdmin.py") execfile("homepageAdmin.py") execfile("newsAdmin.py") execfile("profilesAdmin.py") execfile("wikisAdmin.py") apps = ['Activities','Blogs','Communities','Dogear','Files','Forums','News','Wikis']
def memService(appname,EmailMatch): if("Activities" == appname) : print "\tActivitiesMemberService.syncAllMembersByExtId" ActivitiesMemberService.syncAllMembersByExtId( {"updateOnEmailLoginMatch": EmailMatch } ) elif("Blogs" == appname) : print "\tBlogsMemberService.syncAllMembersByExtId" BlogsMemberService.syncAllMembersByExtId( {"updateOnEmailLoginMatch": EmailMatch } ) elif("News" == appname) : print "\tNewsMemberService.syncAllMembersByExtId" NewsMemberService.syncAllMembersByExtId( {"updateOnEmailLoginMatch": EmailMatch } ) elif("Dogear" == appname) : print "\tDogearMemberService.syncAllMembersByExtId" DogearMemberService.syncAllMembersByExtId( {"updateOnEmailLoginMatch": EmailMatch } ) elif("Communities" == appname) : print "\tCommunitesMemberService.syncAllMembersByExtId" CommunitiesMemberService.syncAllMembersByExtId( {"updateOnEmailLoginMatch": EmailMatch } ) elif("Files" == appname) : print "\tFilesMemberService.syncAllMembersByExtId" FilesMemberService.syncAllMembersByExtId( {"updateOnEmailLoginMatch": EmailMatch } ) elif("Forums" == appname) : print "\tForumsMemberService.syncAllMembersByExtId" ForumsMemberService.syncAllMembersByExtId( {"updateOnEmailLoginMatch": EmailMatch } ) elif("Wikis" == appname) : print "\tWikisMemberService.syncAllMembersByExtId" WikisMemberService.syncAllMembersByExtId( {"updateOnEmailLoginMatch": EmailMatch } ) else : print "\tUnknown application name '" + appname + "'"
for app in apps: print "Sync all Members by EXTID for " + app memService(app, EmailMatch)
apps = AdminApp.list() appsList = apps.split(lineSeparator) #List of all applications path = '/opt/install/backup' # must exist! for app in appsList: filename = app + ".txt" my_file = open(path + '/' + filename,'w') my_file.write (AdminApp.view(app,"-MapRolesToUsers")) my_file.flush my_file.close()
./wsadmin.sh –lang jython –f "{path}/securityrolebackup.py" 'backuppath'
import os import sys # Restore Security Role from Textfile (created with j2eerolebackup path = sys.argv[0] if path == '': path='../temp/j2eebackup' # path where Backup is stored print "Setting path to %s!" % path if not os.path.exists(path): print "Path does not exists, please provide directory with your backup files!" sys.exit()
def convertFile2Dict(appname): # function to convert backup txt files of Security Role Backup to a dictionary filename = path + '/' + appname + ".txt" myfile = open(filename,'r') count = 0 dict = {} for line in myfile.readlines(): # for loop through file to read it line by line if (':' in line) and (count > 12): value = line.split(':')[0] # cred = line.split(':')[1].strip('\n') cred = line.split(':')[1] # cred = cred.strip(' ') cred = cred.strip() if value == "Role": role = cred dict[role] = {} dict[role][value] = cred count += 1 return dict
def setSecurityRoles(dictionary,appName): strRoleChange = '[' for role in dictionary.keys(): # Loop through Roles strRoleChange += '[\"' + role + '\" ' strRoleChange += dictionary[role]['Everyone?'] + ' ' strRoleChange += dictionary[role]['All authenticated?'] + ' ' strRoleChange += '\"' + dictionary[role]['Mapped users'] + '\" ' strRoleChange += '\"' + dictionary[role]['Mapped groups'] + '\"] ' strRoleChange += ']]' AdminApp.edit(appName, '[-MapRolesToUsers' + strRoleChange +']') print "Setting Roles and Users for %s" % appName AdminConfig.save() apps = AdminApp.list() appsList = apps.split(lineSeparator) # Test with some Apps: # appsList = ['Blogs','Activities','Wikis'] # or Single App: # appsList = ['Blogs'] for app in appsList: # For testing: set app to example applicatio setSecurityRoles(convertFile2Dict(app),app) print "Restore of Security Roles finished!"
# ConfigureConnectionsRolesRestricted # # Author: Klaus Bild # E-Mail: # If you want to set multiple Admins or Groups # # Variables for Usermapping connwasadmin = 'wasadmin' connadmin = 'Admin1|Admin2' connmoderators = 'Moderator1|Moderator2' connmetrics = 'Metrics1|Metrics2' connmobile = 'Mobile1|Mobile2'
# Variables for Groupmapping connadmingroup = 'CNXAdmins' connmoderatorgroup = 'CNXModerators' connmetricsgroup = 'CNXMetricsAdmins' connmobilegroup = 'CNXMobileAdmins' appName = 'Activities' # "role" Yes No = everyone # "role" No Yes = All Authenticated # "role" No No = None AdminApp.edit( appName, '[-MapRolesToUsers [["person" No Yes "" ""] ["everyone" Yes No "" ""] ["reader" Yes No "" ""] ["metrics-reader" No Yes "" ""] ["search-admin" No No "' + connwasadmin + '|' + connadmin + '" "' + connadmingroup + '"] ["widget-admin" No No "' + connwasadmin + '|' + connadmin + '" "' + connadmingroup + '"] ["admin" No No "' + connwasadmin + '|' + connadmin + '" "' + connadmingroup + '"] ["bss-provisioning-admin" No No "" ""] ]]' ) print "Setting Roles and Users for Activities" AdminConfig.save() ...
db2 list database directory | grep alias | awk '{print $4}' | sort
db2cmd -i -c -w "db2 list database directory | where {$_ -match "alias"}\ | %{ $_.Split('=')[1]; }"
db2 list active databases
#!/bin/bash databases=$(db2 list database directory | grep alias | awk '{print $4}' | sort) for database in ${databases[@]} do echo $database db2 "connect to $database" db2 -tvf automaint.sql db2 "connect reset" done
if [ -z "$1" ]; then echo "USAGE: `basename $0` mailaddress" exit ; fi MAIL=$1 db2 -x "connect to peopledb" | grep alias | awk '{print $5}' db2 -x "SELECT PROF_GUID, PROF_MAIL FROM EMPINST.EMPLOYEE WHERE PROF_MAIL_LOWER = '${MAIL,,}'" db2 -x "connect reset" > /dev/null while true; do printf "Which email address should be used for Lookup?\n" read MAIL break done
db2 -x "connect to OPNACT"| grep alias | awk '{print $5}' db2 -x "select EXID from activities.oa_memberprofile where email = '$MAIL'" db2 -x "connect reset" > /dev/null db2 -x "connect to BLOGS"| grep alias | awk '{print $5}' db2 -x "select EXTID from blogs.rolleruser where EMAILADDRESS = '$MAIL'" db2 -x "connect reset" > /dev/null db2 -x "connect to SNCOMM"| grep alias | awk '{print $5}' db2 -x "select DIRECTORY_UUID from SNCOMM.MEMBERPROFILE where email = '${MAIL,,}'" db2 -x "connect reset" > /dev/null db2 -x "connect to dogear"| grep alias | awk '{print $5}' db2 -x "select MEMBER_ID from DOGEAR.PERSON where email = '${MAIL,,}'" db2 -x "connect reset" > /dev/null db2 -x "connect to files"| grep alias | awk '{print $5}' db2 -x "select DIRECTORY_ID from FILES.USER where email = '$MAIL'" db2 -x "connect reset" > /dev/null db2 -x "connect to forum" | grep alias | awk '{print $5}' db2 -x "select EXID from FORUM.DF_MEMBERPROFILE where email = '$MAIL'" db2 -x "connect reset" > /dev/null db2 -x "connect to Homepage"| grep alias | awk '{print $5}' db2 -x "select EXID from HOMEPAGE.PERSON where USER_MAIL = '$MAIL'" db2 -x "connect reset" > /dev/null db2 -x "connect to wikis"| grep alias | awk '{print $5}' db2 -x "select DIRECTORY_ID from WIKIS.USER where email = '$MAIL'" | grep "-" db2 -x "connect reset" > /dev/null
TMP1=`mktemp -d` trap "rm -rf $TMP1" EXIT while getopts h:p:f:?: option do case "${option}" in h) SERVERNAME=${OPTARG};; p) SERVERPORT=${OPTARG};; f) STORECACERTS=${OPTARG};; ?) echo "USAGE: `basename $0` -h hostname -p port -f Certfile\n" echo "You have to type a password for keyfile twice and set\n" echo "the key to trusted!" exit ;; esac done if [ -z "$SERVERNAME" ] | [ -z "$SERVERPORT" ] | [ -z "$STORECACERTS" ] ; then echo "USAGE: `basename $0` -h hostname -p port -f Certfile" echo "You have to type a password for keyfile twice and set\n" echo "the key to trusted!" exit fi
openssl s_client -showcerts -connect $SERVERNAME:$SERVERPORT < /dev/null > $TMP1/cst-key.out openssl x509 -outform DER < $TMP1/cst-key.out > $TMP1/cst-key.der openssl x509 -inform der -in $TMP1/cst-key.der -out $TMP1/cst-key.pem keytool -import -alias Selfsigned -keystore $STORECACERTS -file $TMP1/cst-key.pem
function func_compute_CN(fieldname) { var givenName = work.getAttribute("givenName"); var sn = work.getAttribute("sn"); if(sn != null) { var result = givenName + ' ' + sn; } return result; }
displayName={func_compute_CN}
function function_settimezone(fieldname){ var timeZone = 'Europe/Amsterdam'; result = timeZone; return result; }
timezone={function_settimezone}
function function_setnull(fieldname){ var result = ''; return result; }
desciption={function_setnull}