In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how Shell monitors the status of port 80 of httpd service". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
For example, monitor the port status of the httpd service, determine whether the server is started according to the port, if not, the script automatically starts the service, and exit the script if the service is running; if it is changed to another service port, but the script needs to be adjusted.
#! / bin/bash# monitors the status of the HTTP service every 3 seconds in real time. If the service is abnormal, it outputs an alarm message and tries to start it. When the service is normal, it prompts you to run normally. Web= `netstat-ant | grep 80 | awk'{print $4}'| awk-F:'{print $4} '`apachelog=/var/log/httpd/service.logif [' $web' = '80'] then echo "HTTPD is running" else echo Web service restart "echo" `date` Web service restart "> $apachelog / etc/init.d/httpd start & > / dev/null sleep 2 echo `date` restart Launch | / usr/sbin/sendmail-v telephonenumber@139.com > / dev/nullfi "how does Shell monitor the status of port 80 of httpd service"? that's it. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.