Saturday 30 November 2013

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()
   
   




9 comments:

  1. how should i query the current values of runasid and group and umask value

    ReplyDelete
  2. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
    Java training in Bangalore | Java training in Indira nagar

    Java training in Bangalore | Java training in Rajaji nagar

    Java training in Bangalore | Java training in Marathahalli

    Java training in Bangalore | Java training in Btm layout

    ReplyDelete
  3. Whoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.

    Best AWS Training in Chennai | Amazon Web Services Training in Chennai
    Learn Amazon Web Services Tutorial |Best AWS Tutorials For Beginners
    Best AWS Interview Questions And Answers
    Best AWS Training in Chennai | No.1 AWS Training Institute in Chennai Velachery, Tambaram, OMR

    ReplyDelete
  4. It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.
    Most of ideas can be nice content.The people to give them a good shake to get your point and across the command.

    Java training in Bangalore|best Java training in Bangalore

    ReplyDelete
  5. This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.

    Have you been thinking about the power sources and the tiles whom use blocks I wanted to thank you for this great read!! I definitely enjoyed every little bit of it and I have you bookmarked to check out the new stuff you post
    rpa training in bangalore
    best rpa training in bangalore
    rpa training in pune

    ReplyDelete