Comments (1)
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)
- 动态IP如何设置 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dns-auto-switch.