Tomcat Process Monitoring

Source: Internet
Author: User

Because the online service does not know when it will hang, it writes a script to monitor the Tomcat process. If the process does not exist, go to start the Tomcat process.


#!/bin/bash

Source/etc/profile

SOURCE ~/.bash_profile

# Source/etc/profile ~/.bash_profile These two sentences must be added, especially when monitoring some Java processes.

Pid= ' Ps-ef | grep App1 | Grep-v "grep" |sed-n 1p | awk ' {print $} '

If ["$pid" = = ""]; Then

sh/opt/tomcat/app1/bin/startup.sh

echo "Pull up Tomcat App1 process" >>/root/test.log

Fi


Then add the above script file in the edit/etc/crontab.

Tomcat Process Monitoring

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.