i would think you'd want to post this in one of the BPPM/patrol/etc communities, not bsa... bsa does not perform service health monitoring.
Is there no way to do this in bsa?
I need a simple script that checks the status of weblogic servers and if any server goes to Unknown state, It sends mail.
anything is possible w/ scripting... but bsa is not designed to be a monitoring tool. do you have monitoring tools in your environment ? why do you want to use bsa for this vs a monitoring tool ?
We dont have any monitoring tools in our environment.
Weve been asked to write 2 scripts for bsa.
Another one is to filter weblogic server logs.
Can you help?
You can use bsa to do this – it’s not ideal since it’s not a monitoring tool – you need to figure out what commands you need to run to figure out if the system is healthy. Then you can import that into bsa. how do you determine your weblogic instance is healthy ?
Here is a jython script I have:
cd('/ServerLifeCycleRuntimes/' + server.getName() )
username = 'weblogic'
password = 'weblogic'
print 'AdminServer is not running.'
servers = cmo.getServers()
print '#### Weblogic Domain Status ####'
for server in servers:
serverState = serverStatus(server)
print 'Server ' + str(server.getName()) + ' is ' + serverState # + ' on ' + str(machine.getName())
I need to run this script in BSA. All the server configurations are done.
Another big probem I am facing is to parameterize this script for username,password,URL so that the same script can run on multiple remote servers
what are you going to do w/ the output of the script ?
If server state is UNKNOWN then it should send a mail to a distribution list stating that the server is in UNKNOWN state.
so you can probably add this as a type 3 nsh script which will copy and execute the script on the target. just make sure the script has the logic to send the mail.
I need help in parameterizing this script so that i can run the same script on all servers. Otherwise for every server. Ill have to manually modify the script to change username,password,listen address and port no.
you need to search some python docs on how to take arguments to the script as input. then when you add the script to bsa you can specify parameters and provide flags if you need to (if the script handles it) - then you could set some properties on the bsa server objects - for the weblogic username, passwd, ip and port and at runtime those values would be resolved and passed to the script.