Monitoring Application Services

Source: Internet
Author: User

At the application level, there will be a lot of services, so monitoring system service status becomes necessary.

#!/bin/bashpid ()  {        ps ax | grep  " Application " | grep -v grep >/dev/null 2>&1         if [ $? -eq 0 ];then         echo 1        else         echo 0        fi}pid= ' PID ' post ()  {         netstat -ntpl | grep post-number >/dev/ null 2>&1        if [ $? -eq 0 ]; then        echo 1         else        echo 0         fi}post= ' POST ' stat ()  {&Nbsp;       ps ax | grep  "APPLICATION"  | grep  -v grep | awk  ' {print $3} '  >/dev/null 2>&1         if [ $? !=  "sz"  -o $? !=  "SZ"  -o $? !=  "Zz"  ];then        echo 1         else        echo  0        fi}stat= ' STAT '          if [  $PID  = 1 -a  $POST  = 1 -a  $STAT  = 1  ];then        echo 0         else        echo 1         fi

Colleagues meet 3 conditions to prove that the service running state is normal, return 0 any one condition does not meet, all return 1

Monitoring Application Services

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.