Some useful commands to modify JVM, thread pool, Process Execution and MonitoringPolicy attributes
lineSeparator = java.lang.System.getProperty('line.separator')
server = 'server1'
srv=AdminConfig.getid('/Server:' + server)
#java Virtual Machine properties(init heap,Max heap etc....
jvmid = AdminConfig.list("JavaVirtualMachine", srv)
print jvmid
inith = ['initialHeapSize',1200]
maxh = ['maximumHeapSize',1300]
ver = ['verboseModeGarbageCollection','true']
attr = [inith,maxh,ver]
AdminConfig.modify(jvmid,attr)
AdminConfig.save()
####################
#process Execution #
####################
process = AdminConfig.list('JavaProcessDef', srv)
print process
ex = AdminConfig.showAttribute(process,'execution')
AdminConfig.modify(ex, [['processPriority', 30],['runAsGroup', ['srini']],['runAsUser', ['yaganti']],['runInProcessGroup', 5],['umask', 022]])
AdminConfig.save()
####################################
#MonitoringPolicy attributes..... #
####################################
mp = AdminConfig.showAttribute(process,'monitoringPolicy')
AdminConfig.modify(mp,[['autoRestart', 'false'],['maximumStartupAttempts',5],['nodeRestartState', 'STOPPED'],['pingInterval',600],['pingTimeout',3000]])
AdminConfig.save()
#########################
#JVM Custom Properties #
#########################
na = ['name', 'ALLCORP_CONFIG_SERVER_NAME']
val = ['value', 'DEV/AGENCY']
desc = ['description', 'Configuration Name']
jvmcpattrs = [na,val,desc]
AdminConfig.create("Property", jvmid, jvmcpattrs)
AdminConfig.save()
############################
#JVM Thread pool update #
############################
thpid = AdminConfig.list('ThreadPool',srv).split(lineSeparator)
print thpid
for pool in thpid:
print pool
name='WebContainer'
#if (thpid == name):
if (pool.find("WebContainer") != -1):
print "hello"
AdminConfig.modify(pool,[['maximumSize', 100]])
AdminConfig.save()