Polling detects Apache status and enables Spike alarms

Source: Internet
Author: User

#!/bin/Bashshell_user="Root"Shell_domain="Apache"shell_list="/root/ip_list"Shell_row=`Cat$shell _list |WC-l 'functionTrans_text () {text=$1Curl'https://oapi.dingtalk.com/robot/send?access_token=b4fcf5862088a1bc7f2bf66a'-H'Content-type:application/json'-D'{#指定钉钉机器人hook地址            "Msgtype":"text",             "text": {            "content":"'"$text"'"        }, }'}functionapache_check_80 () {IP=$1URL="/ http $ip/index.html"Http_code= ' Curl-o/dev/NULL-S-W "%{http_code}" "${url}"`    if[$HTTP _code! = $ ]         ThenTrans_text"=================================================================\ n $ip Apache Server Status exception, Web page return code:'"$HTTP _code"'Please deal with it in time!\ n================================================================= \ n"    fi} while true Doshell_list="/root/ip_list"Shell_row=`Cat$shell _list |WC-l ' forTempinch`seq 1$shell _row ' Doip_addr=`Cat$shell _list |Head-N $temp |Tail-N1' apache_check_80 $Ip _addr Done    Sleep Ten Done

Polling detects Apache status and enables Spike alarms

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.