Design a script that monitors the surviving state of a remote machine (assuming IP 123.23.11.21) and sends a message to yourself when it finds an outage.

Source: Internet
Author: User

#!/bin/bash #Remote monitoring.If the network is broken,email me~
ping -c10 www.baidu.com > 33.log while "1" "1" ] do     t=$( awk ‘{print $1}‘ 33.log)     if [ ! -z $($t) ]; then          echo " "          sleep 30     else          break ;     fi done     echo "DiaoXianLe" |mail -s  "down" [email protected]


This article is from the It Dick thread blog, so be sure to keep this source http://68686789.blog.51cto.com/10438688/1694908

Design a script that monitors the surviving state of a remote machine (assuming IP 123.23.11.21) and sends a message to yourself when it finds an outage.

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.