Skip to content

Instantly share code, notes, and snippets.

@kurtcebe
Created July 23, 2013 12:52
Show Gist options
  • Save kurtcebe/6062126 to your computer and use it in GitHub Desktop.
Save kurtcebe/6062126 to your computer and use it in GitHub Desktop.
[WAS] wsadmin script for setting runtime traces on multiple servers
import sys
if len(sys.argv) < 1:
print 'please supply trace string as parameter'
sys.exit(1)
print 'tracestring is:' , sys.argv[0]
tsc = AdminControl.queryNames('WebSphere:type=TraceService,*').split("\n")
for ts in tsc:
# this if block is used to filter server names, comment to set traces also to dmgr and nodeagents
if ts.find('your_server_name_prefix') > 0:
print 'enabling traces for: ' , ts
AdminControl.setAttribute(ts, 'traceSpecification', sys.argv[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment