4 Replies Latest reply: Nov 17, 2008 11:21 AM by david.karr RSS

    Problem with wlst. Print messages in a particular file.


      I have a problem with a script of wlst. I like get values and print in a file.
      Example... heapSizeCurrent. I get values but I don't know send to file own (example.log).

      Can someone help me, please?


      uname = "weblogic"
      pwd = "weblogic"
      url = "t3://localhost:7001"

      def monitorJVMHeapSize():

           connect(uname, pwd, url)
           serverNames = getRunningServerNames()

           for name in serverNames:
                print 'Now checking '+name.getName()
                     print 'OK Servidor '+name.getName()
                     heapSize = cmo.getHeapSizeCurrent()
                     heapFree = cmo.getHeapFreeCurrent()
                     heapFreePercent = cmo.getHeapFreePercent()
                     print "heapSize: "+str(heapSize)
                     print "heapFree: "+str(heapFree)
                     print "heapFreePercent: "+str(heapFreePercent)
                except WLSTException,e:
                     # this typically means the server is not active, just ignore
                     print 'Problemas con el servidor '+name.getName()

      def getRunningServerNames():
           return cmo.getServers()