Real-time Monitoring of tomcat processes and real-time monitoring of tomcat

Source: Internet
Author: User

Real-time Monitoring of tomcat processes and real-time monitoring of tomcat
#! /Bin/bash step = 2for (I = 0; I <60; I = I + step )); do ps aux | grep apptomcat | grep-v grep>/dev/null y = 'echo $? 'If ["$ y"-ne "0"]; then ps aux | grep webtomcat | grep-v grep>/dev/null if ['echo $? '-Eq "0"]; then ps uax | grep webtomcat | grep-v grep | awk '{print $2}' | xargs kill-9 &>/dev/null else exit fi else sleep 2 continue fi exit add done to crontab [root @ web2 bin] # cat/var/spool/cron/root

* ***/Data/2.sh

 

Monitors apptomcat in real time. If apptomcat fails, it will also kill webtomcat.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.