Jul 102011
ibm websphere

This script is designed to get complete IBM WAS server status details and OS details . Its designed to help in debugging.

proc getDetails {} {

	puts "****************************************************************"
	puts "--		GET ALL DEBUG DETAILS			     --"
	puts "****************************************************************"
	set datetime [clock format [clock seconds] -format {%b. %d, %Y %I:%M:%S %p}]
	puts "server details on $datetime"
	puts "Starting getDetails script ..."
	puts "----------------------------------------------------------------------"
	# lines 4 and 5 find all the cell and process them one at a time
	set cells [$AdminConfig list Cell]
	#puts "Echo : $cells"
	foreach cell $cells {
		# lines 10 and 11 find all the nodes belonging to the cell and
		# process them at a time
		#puts " $cell"
		set nodes [$AdminConfig list Node $cell]
		#puts "echo $nodes"
		foreach node $nodes {
			# lines 16-20 find all the running servers belonging to the cell
			# and node, and process them one at a time
			set cname [$AdminConfig showAttribute $cell name]
			#puts "cname : $cname"
			set nname [$AdminConfig showAttribute $node name]
			#puts "nname : $nname"
			set servs [$AdminControl queryNames type=Server,cell=$cname,node=$nname,*]
			#puts "servs = $servs"
			puts "Number of running servers on node $nname: [llength $servs]"
				foreach server $servs {
					# lines 25-31 get some attributes from the server to display;
					# invoke an operation on the server JVM to display a property.
					set sname [$AdminControl getAttribute $server name]
					set ptype [$AdminControl getAttribute $server processType]
					puts "Server $sname processtype: $ptype "
					set pid [$AdminControl getAttribute $server pid]
					set state [$AdminControl getAttribute $server state]
					puts "Server $sname state $state"
					set jvm [$AdminControl queryNames type=JVM,cell=$cname,node=$nname,process=$sname,*]
					puts "Server $sname JVM details $jvm"
					puts "---------------------------------------------------------------------------------"
					puts "Websphere Application Server $sname Java Env. Details: "
					puts "---------------------------------------------------------------------------------"
					set javaspecname [$AdminControl invoke $jvm getProperty java.specification.name]
					puts " Java Specification Name: $javaspecname "
					set javaspecvendorname [$AdminControl invoke $jvm getProperty java.specification.vendor]
					puts "Java Specification vendor Name: $javaspecvendorname " 
					set javaver [$AdminControl invoke $jvm getProperty java.specification.version]
					puts "Java Specification Version: $javaver"
					set javalogmanager [$AdminControl invoke $jvm getProperty java.util.logging.manager]
					puts "java.util.logging.manager : $javalogmanager"
					set javalogconfig [$AdminControl invoke $jvm getProperty java.util.logging.configureByServer]
					puts " java.util.logging.configureByServer : $javalogconfig"
					set javautilpre [$AdminControl invoke $jvm getProperty java.util.prefs.PreferencesFactory]
					puts "java.util.prefs.PreferencesFactory : $javautilpre"
					set javavendor [$AdminControl invoke $jvm getProperty java.vendor]
					puts "java.vendor : $javavendor" 
					set javavendorurl [$AdminControl invoke $jvm getProperty java.vendor.url]
					puts "java.vendor.url : $javavendorurl "
					set javaversion [$AdminControl invoke $jvm getProperty java.version]
					puts "java.version : $javaversion "
					set javavminfo [$AdminControl invoke $jvm getProperty java.vm.info]
					puts "Java virtual machine info: $javavminfo"
					set osname [$AdminControl invoke $jvm getProperty os.name]
					#puts "Operating System found for $sname: $osname"
					puts "---------------------------------------------------------------------------"
					puts " $sname ($ptype) has pid $pid; state: $state; on $osname"
					# line 37-42 find the applications running on this server and
					# display the application name.
					set apps [$AdminControl queryNames type=Application,cell=$cname,node=$nname,process=$sname,*]
					#puts "apps= $apps "
					puts " Number of applications running on $sname: [llength $apps]"
						foreach app $apps {
							set aname [$AdminControl getAttribute $app name]
							puts " $aname"
							puts "----------------------------------------------------------------"
							puts ""
	puts "getdetails: -- Done."
	puts "---------------------------------------------------------------------------------------------------"
© Incase of any copyright infringements please check copyrights page for faster resolutions.

Leave a Reply

Show Buttons
Hide Buttons