mirror of
https://github.com//cppla/ServerStatus
synced 2025-07-05 00:45:59 +08:00
Merge branch 'cppla:master' into master
This commit is contained in:
commit
74e65c910a
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
`Watchdog🐶已经加入,触发式告警。 interval只是为了防止频繁收到报警信息造成骚扰,并不是探测间隔。`
|
`Watchdog🐶已经加入,触发式告警。 interval只是为了防止频繁收到报警信息造成骚扰,并不是探测间隔。`
|
||||||
|
|
||||||
# 目录介绍:
|
# 目录:
|
||||||
|
|
||||||
* clients 客户端文件
|
* clients 客户端文件
|
||||||
* server 服务端文件
|
* server 服务端文件
|
||||||
@ -21,7 +21,7 @@
|
|||||||
* server/config.json 探针配置文件
|
* server/config.json 探针配置文件
|
||||||
* web/json 探针月流量
|
* web/json 探针月流量
|
||||||
|
|
||||||
# 自动部署:
|
# 部署:
|
||||||
|
|
||||||
【服务端】:
|
【服务端】:
|
||||||
```bash
|
```bash
|
||||||
@ -42,6 +42,11 @@ eg:
|
|||||||
wget --no-check-certificate -qO client-linux.py 'https://raw.githubusercontent.com/cppla/ServerStatus/master/clients/client-linux.py' && nohup python3 client-linux.py SERVER=45.79.67.132 USER=s04 >/dev/null 2>&1 &
|
wget --no-check-certificate -qO client-linux.py 'https://raw.githubusercontent.com/cppla/ServerStatus/master/clients/client-linux.py' && nohup python3 client-linux.py SERVER=45.79.67.132 USER=s04 >/dev/null 2>&1 &
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# 主题:
|
||||||
|
|
||||||
|
* layui:https://github.com/zeyudada/StatusServerLayui
|
||||||
|
<img src=https://dl.cpp.la/Archive/serverstatus_layui.png width=200 height=100 />
|
||||||
|
|
||||||
# 手动安装教程:
|
# 手动安装教程:
|
||||||
|
|
||||||
**【服务端配置】**
|
**【服务端配置】**
|
||||||
|
@ -155,17 +155,18 @@ def _ping_thread(host, mark, port):
|
|||||||
lostPacket = 0
|
lostPacket = 0
|
||||||
packet_queue = Queue(maxsize=PING_PACKET_HISTORY_LEN)
|
packet_queue = Queue(maxsize=PING_PACKET_HISTORY_LEN)
|
||||||
|
|
||||||
IP = host
|
while True:
|
||||||
if host.count(':') < 1: # if not plain ipv6 address, means ipv4 address or hostname
|
# flush dns , every time.
|
||||||
try:
|
IP = host
|
||||||
if PROBE_PROTOCOL_PREFER == 'ipv4':
|
if host.count(':') < 1: # if not plain ipv6 address, means ipv4 address or hostname
|
||||||
IP = socket.getaddrinfo(host, None, socket.AF_INET)[0][4][0]
|
try:
|
||||||
else:
|
if PROBE_PROTOCOL_PREFER == 'ipv4':
|
||||||
IP = socket.getaddrinfo(host, None, socket.AF_INET6)[0][4][0]
|
IP = socket.getaddrinfo(host, None, socket.AF_INET)[0][4][0]
|
||||||
except Exception:
|
else:
|
||||||
|
IP = socket.getaddrinfo(host, None, socket.AF_INET6)[0][4][0]
|
||||||
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
while True:
|
|
||||||
if packet_queue.full():
|
if packet_queue.full():
|
||||||
if packet_queue.get() == 0:
|
if packet_queue.get() == 0:
|
||||||
lostPacket -= 1
|
lostPacket -= 1
|
||||||
|
@ -153,17 +153,18 @@ def _ping_thread(host, mark, port):
|
|||||||
lostPacket = 0
|
lostPacket = 0
|
||||||
packet_queue = Queue(maxsize=PING_PACKET_HISTORY_LEN)
|
packet_queue = Queue(maxsize=PING_PACKET_HISTORY_LEN)
|
||||||
|
|
||||||
IP = host
|
while True:
|
||||||
if host.count(':') < 1: # if not plain ipv6 address, means ipv4 address or hostname
|
# flush dns, every time.
|
||||||
try:
|
IP = host
|
||||||
if PROBE_PROTOCOL_PREFER == 'ipv4':
|
if host.count(':') < 1: # if not plain ipv6 address, means ipv4 address or hostname
|
||||||
IP = socket.getaddrinfo(host, None, socket.AF_INET)[0][4][0]
|
try:
|
||||||
else:
|
if PROBE_PROTOCOL_PREFER == 'ipv4':
|
||||||
IP = socket.getaddrinfo(host, None, socket.AF_INET6)[0][4][0]
|
IP = socket.getaddrinfo(host, None, socket.AF_INET)[0][4][0]
|
||||||
except Exception:
|
else:
|
||||||
|
IP = socket.getaddrinfo(host, None, socket.AF_INET6)[0][4][0]
|
||||||
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
while True:
|
|
||||||
if packet_queue.full():
|
if packet_queue.full():
|
||||||
if packet_queue.get() == 0:
|
if packet_queue.get() == 0:
|
||||||
lostPacket -= 1
|
lostPacket -= 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user