Code Monkey home page Code Monkey logo

Comments (1)

BlueSkyXN avatar BlueSkyXN commented on June 6, 2024

1,间隔时间取决你自己,定时任务1S,1M,1H都可以
2,这个ping并不是ICMPing,而是TCP【由go-torch提供服务】,理论上TCPing是很难出现丢失的【在国际带宽的情况下】,(概率极低,一般低于1%)如果你经常TCPing失败,说明其他使用者也会出现这种情况,请调整你的服务器和监控器
3,如何修改的话,可以提供简单的修改思路
以hw.sh为例,实现每次检测2次,在代码第96行:CHECK=$(curl -s "$PING_API/$ORG_IP/22")
有意思变量CHECK设置为后面地址的内容,你可以再加个CHECK2,也等于这个,这样就等于测2次了
第98行:if [ "$(echo $CHECK | grep ""status":true")" != "" ]
意思当CHECK这个变量中,出现字段status:true的时候触发下面内容,否则干嘛干嘛(基本IF语法)
套娃个IF 什么什么CHECK2什么什么即可
【99-110是第一次状态正常,112开始是第一次不正常,在那边加上双重IF即可】

当前脚本只检测一次,存在一定的偶然性。建议定义一下多次ping

from dns-auto-switch.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.