3 releases
0.1.2 | Aug 13, 2021 |
---|---|
0.1.1 | Jul 2, 2021 |
0.1.0 | Mar 21, 2021 |
#201 in WebSocket
40 downloads per month
34KB
655 lines
_ _ _ ____ _ _ ____ _
| |_(_) ___| | __/ ___| |__ __ _ ___| | _____ _ __| _ \ _ _ ___| |_
| __| |/ __| |/ / | | '_ \ / _` |/ __| |/ / _ \ '__| |_) | | | / __| __|
| |_| | (__| <| |___| | | | (_| | (__| < __/ | | _ <| |_| \__ \ |_
\__|_|\___|_|\_\\____|_| |_|\__,_|\___|_|\_\___|_| |_| \_\\__,_|___/\__| tickChecker for Rust
What's TickChecker
- Check target alive state
- Execute the command after failure
- Execute the remote call after failure (with http or https)
- Write all state to local logs (with log file or json)
In short, TickChecker is a simple management tool for server cloud computing in any field to check whether the target service has survived.
Ok,We Support Protocols:
- Tcp ping (for port check)
- Tcp over tls,like tcp ping
- ICMP
- Http or Https
- Websocket(Check port only,include upgrade protocols)
install
use rust source
git clone https://gitlab.com/koangel/gTickCheckerRust.git
cd gTickCheckerRust
cargo build
use binary
- download git release packet
- unzip
- run
./tickChecker
config
log_path = "./log/tickChecker.log"
timer_debug = true
timer_log = "./log/timer.log"
# log level
log_level = "debug"
roll_count = 30
# mb
file_size = 50
# zero is cpu nums
work_thread = 0
[[action]]
id = 1
name = "httpAction"
# http or ping or tcp or tcp_tls or websocket
atype = "http"
# http : http://www.baidu.com or https://www.baidu.com ,check use get method
# ping : 192.168.1.1
# tcp : 192.168.1.75:80
# tcp_tls : 192.168.1.75:443
# websocket : http://192.168.1.75/ws (only upgrade)
target = "http://www.baidu.com"
# for https or tcp tls ,skip host and cret check.
skip_tls_check = true
# output result data
output_result = true
# check timeout time,millis
timeout = 10000
# failed count do action
fail_count = 2
# failed do action, http or command
fail_type = "http"
# http method get only
fail = "http://www.163.com/abc?a=1"
# recover do action, http or command
recover_type = "http"
recover = "http://www.163.com/abc?a=2"
# wait loop, millis
count = -1
# tick millis
tick = 60000
action config
[[action]]
id = 1
name = "httpAction"
# http or ping or tcp or tcp_tls or websocket
atype = "http"
# http : http://www.baidu.com or https://www.baidu.com ,check use get method
# ping : 192.168.1.1
# tcp : 192.168.1.75:80
# tcp_tls : 192.168.1.75:443
# websocket : http://192.168.1.75/ws (only upgrade)
target = "http://www.baidu.com"
skip_tls_check = true
output_result = true
timeout = 10000
# failed count do action
fail_count = 2
# failed do action, http or command
fail_type = "http"
# http method get only
fail = "http://www.163.com/abc?a=1"
# recover do action, http or command
recover_type = "http"
recover = "http://www.163.com/abc?a=2"
# wait loop, 毫秒
count = -1
# tick
tick = 60000
[[action]]
id = 2
name = "pingAction"
# http or ping or tcp or tcp_tls or websocket
atype = "ping"
# http : http://www.baidu.com or https://www.baidu.com
# ping : 192.168.1.1
# tcp : 192.168.1.75:80
# tcp_tls : 192.168.1.75:443
# websocket : http://192.168.1.75/ws (only upgrade)
target = "192.168.1.75"
skip_tls_check = true
output_result = true
timeout = 2000
# failed count do action
fail_count = 2
# failed do action, http or command
fail_type = "command"
# http method get only
fail = 'echo "ping failed ip: {target}"'
# recover do action, http or command
recover_type = "command"
recover = 'echo "recover ping ip: {target}"'
# wait loop, 毫秒
count = -1
# tick
tick = 60000
[[action]]
id = 3
name = "tcpAction"
# http or ping or tcp or tcp_tls or websocket
atype = "tcp"
# http : http://www.baidu.com or https://www.baidu.com
# ping : 192.168.1.1
# tcp : 192.168.1.75:80
# tcp_tls : 192.168.1.75:443
# websocket : http://192.168.1.75/ws (only upgrade)
target = "192.168.1.75:80"
skip_tls_check = true
output_result = true
timeout = 3000
# failed count do action
fail_count = 2
# failed do action, http or command
fail_type = "command"
# http method get only
fail = 'echo "tcp failed ip: {target}"'
# recover do action, http or command
recover_type = "command"
recover = 'echo "tcp ping ip: {target}"'
# wait loop, 毫秒
count = -1
# tick
tick = 60000
[[action]]
id = 4
name = "tlsAction"
# http or ping or tcp or tcp_tls or websocket
atype = "tcp_tls"
# http : http://www.baidu.com or https://www.baidu.com
# ping : 192.168.1.1
# tcp : 192.168.1.75:80
# tcp_tls : 192.168.1.75:443
# websocket : http://192.168.1.75/ws (only upgrade)
target = "192.168.1.75:443"
skip_tls_check = true
output_result = true
timeout = 3000
# failed count do action
fail_count = 2
# failed do action, http or command
fail_type = "http"
# http method get only
fail = "http://www.163.com/abc?a=1"
# recover do action, http or command
recover_type = "http"
recover = "http://www.163.com/abc?a=2"
# wait loop, 毫秒
count = -1
# tick
tick = 60000
[[action]]
id = 5
name = "wsAction"
# http or ping or tcp or tcp_tls or websocket
atype = "websocket"
# http : http://www.baidu.com or https://www.baidu.com
# ping : 192.168.1.1
# tcp : 192.168.1.75:80
# tcp_tls : 192.168.1.75:443
# websocket : ws://192.168.1.75/ws (only upgrade)
target = "ws://192.168.1.75/ws"
skip_tls_check = true
output_result = true
timeout = 3000
# failed count do action
fail_count = 2
# failed do action, http or command
fail_type = "http"
# http method get only
fail = "http://www.163.com/abc?a=1"
# recover do action, http or command
recover_type = "http"
recover = "http://www.163.com/abc?a=2"
# wait loop, 毫秒
count = -1
# tick
tick = 60000
logs directory
log/tickChecker.log
log/timer.log
other project
Dependencies
~20–34MB
~577K SLoC