In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how the Linux Shell script monitors the running status of WAS. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
Principle: get the status of the instance by calling the script wsadmin.sh that comes with WAS
Operating system version:
[root] # head-1 / etc/redhat-release
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
WAS version:
[root] # / opt/IBM/WebSphere/AppServer/bin/versionInfo.sh | grep-A 3 "Installed Product"
Installed Product
Name IBM WebSphere Application Server-ND
Version 7.0.0.25
Code:
Check_was_state.sh
#! / bin/ksh WAS_IP= "192.168.222.3" WAS_USERNAME= "wasadmin" WAS_PASSWORD= "wasadmin" WAS_INSTANCE_NAME= "SampleServer1" WSADMIN= "/ opt/IBM/WebSphere/AppServer/bin/wsadmin.sh" FILE_STAT_LOG=was_stat_ `date + "% Y%m%d_%H%M%S" `. Log $WSADMIN-lang jython-host $WAS_IP-user $WAS_USERNAME-password $WAS_PASSWORD-f check_was_state.py > $FILE_STAT_LOG 2 > & 1 Grep "${WAS_INSTANCE_NAME}: STARTED" $FILE_STAT_LOG > / dev/null 2 > & 1 if [$? = = 0] Then echo "$WAS_IP $WAS_INSTANCE_NAME status is OK" else echo "$WAS_IP $WAS_INSTANCE_NAME status is not OK" fi
Check_was_state.py
Import AdminUtilities # List servers with specified server type servers = AdminTask.listServers ('- serverType APPLICATION_SERVER') # Convert Jython string to list servers = AdminUtilities.convertToList (servers) # Loop through each server in server list for aServer in servers: # Obtain server and node names sname = aServer [0:aServer.find ("(")] nname = aServer [aServer.find ("nodes/") + 6:aServer.find ("servers/")-1] runningServer = AdminControl.queryNames ("type=Server,node=" + nname + ", name=" + sname + " * ") if (len (runningServer) > 0): serverState = AdminControl.getAttribute (runningServer," state ") else: serverState =" STOPPED "# endIf # Two different states: STARTED, STOPPED print"% s:% s "% (sname,serverState) # endFor read the above Do you have any further understanding of how Linux Shell scripts monitor the running status of WAS? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.