feat:添加serverstatus到列表#1507

This commit is contained in:
okxlin 2024-06-30 23:39:37 +08:00
parent d3e95d6d74
commit 56ce29bcec
11 changed files with 354 additions and 0 deletions

View File

@ -0,0 +1,5 @@
CONTAINER_NAME="serverstatus"
PANEL_APP_PORT_HTTP=40269
PANEL_APP_PORT_COMM=35601
SERVERSTATUS_CONFIG_PATH="./data/server/config.json"
SERVERSTATUS_JSON_PATH="./data/web/json"

View File

@ -0,0 +1,32 @@
additionalProperties:
formFields:
- default: "./data/server/config.json"
disabled: true
envKey: SERVERSTATUS_CONFIG_PATH
labelEn: Server Status Config Path
labelZh: 服务器状态配置路径
required: true
type: text
- default: "./data/web/json"
disabled: true
envKey: SERVERSTATUS_JSON_PATH
labelEn: Server Status Monthly Traffic State Path
labelZh: 探针月流量状态路径
required: true
type: text
- default: "35601"
edit: true
envKey: PANEL_APP_PORT_COMM
labelEn: Communication Port
labelZh: 通信端口
required: true
rule: paramPort
type: number
- default: "40269"
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Web Port
labelZh: Web 端口
required: true
rule: paramPort
type: number

View File

@ -0,0 +1,99 @@
{
"servers": [
{
"username": "s01",
"name": "node1",
"type": "xen",
"host": "host1",
"location": "🇨🇳",
"password": "USER_DEFAULT_PASSWORD",
"monthstart": 1
},
{
"username": "s02",
"name": "node2",
"type": "vmware",
"host": "host2",
"location": "🇯🇵",
"password": "USER_DEFAULT_PASSWORD",
"monthstart": 1
},
{
"disabled": true,
"username": "s03",
"name": "node3",
"type": "hyper",
"host": "host3",
"location": "🇫🇷",
"password": "USER_DEFAULT_PASSWORD",
"monthstart": 1
},
{
"username": "s04",
"name": "node4",
"type": "kvm",
"host": "host4",
"location": "🇰🇷",
"password": "USER_DEFAULT_PASSWORD",
"monthstart": 1
}
],
"monitors": [
{
"name": "baidu",
"host": "https://www.baidu.com",
"interval": 300,
"type": "https"
},
{
"name": "aliyun",
"host": "https://www.aliyun.com",
"interval": 300,
"type": "https"
},
{
"name": "114",
"host": "114.114.114.114:53",
"interval": 300,
"type": "tcp"
}
],
"watchdog": [
{
"name": "cpu high warning,exclude username s01",
"rule": "cpu>90&load_1>5&username!='s01'",
"interval": 600,
"callback": "https://yourSMSurl"
},
{
"name": "memory high warning, exclude less than 1GB vps",
"rule": "(memory_used/memory_total)*100>90&memory_total>1048576",
"interval": 300,
"callback": "https://yourSMSurl"
},
{
"name": "offline warning",
"rule": "online4=0&online6=0",
"interval": 600,
"callback": "https://yourSMSurl"
},
{
"name": "ddcc attack,limit type Oracle",
"rule": "tcp_count>600&type='Oracle'",
"interval": 300,
"callback": "https://yourSMSurl"
},
{
"name": "month traffic warning",
"rule": "(network_out-last_network_out)/1024/1024/1024>999",
"interval": 3600,
"callback": "https://yourSMSurl"
},
{
"name": "you can parse an expression combining any known field",
"rule": "load_5>3",
"interval": 900,
"callback": "https://yourSMSurl"
}
]
}

View File

@ -0,0 +1,25 @@
services:
serverstatus:
image: "cppla/serverstatus:1.1.4"
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:80 || bash -c 'kill -s 15 -1 && (sleep 10; kill -s 9 -1)'"]
interval: 30s
timeout: 10s
retries: 5
container_name: ${CONTAINER_NAME}
restart: always
networks:
- 1panel-network
volumes:
- ${SERVERSTATUS_CONFIG_PATH}:/ServerStatus/server/config.json
- ${SERVERSTATUS_JSON_PATH}:/usr/share/nginx/html/json
ports:
- ${PANEL_APP_PORT_COMM}:35601
- ${PANEL_APP_PORT_HTTP}:80
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true

View File

@ -0,0 +1,13 @@
# ServerStatus 中文版:
* ServerStatus中文版是一个酷炫高逼格的云探针、云监控、服务器云监控、多服务器探针~。
* 在线演示https://tz.cloudcpp.com
## 客户端配置
【客户端】:
```bash
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={$SERVER} USER={$USER} PASSWORD={$PASSWORD} >/dev/null 2>&1 &
#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 &
```

View File

@ -0,0 +1,19 @@
name: ServerStatus
tags:
- 实用工具
title: 多服务器状态监控
description: 多服务器状态监控
additionalProperties:
key: serverstatus
name: ServerStatus
tags:
- Tool
shortDescZh: 多服务器状态监控
shortDescEn: Multi-server status monitoring
type: tool
crossVersionUpdate: true
limit: 0
recommend: 0
website: https://github.com/cppla/ServerStatus
github: https://github.com/cppla/ServerStatus
document: https://github.com/cppla/ServerStatus

View File

@ -0,0 +1,5 @@
CONTAINER_NAME="serverstatus"
PANEL_APP_PORT_HTTP=40269
PANEL_APP_PORT_COMM=35601
SERVERSTATUS_CONFIG_PATH="./data/server/config.json"
SERVERSTATUS_JSON_PATH="./data/web/json"

View File

@ -0,0 +1,32 @@
additionalProperties:
formFields:
- default: "./data/server/config.json"
disabled: true
envKey: SERVERSTATUS_CONFIG_PATH
labelEn: Server Status Config Path
labelZh: 服务器状态配置路径
required: true
type: text
- default: "./data/web/json"
disabled: true
envKey: SERVERSTATUS_JSON_PATH
labelEn: Server Status Monthly Traffic State Path
labelZh: 探针月流量状态路径
required: true
type: text
- default: "35601"
edit: true
envKey: PANEL_APP_PORT_COMM
labelEn: Communication Port
labelZh: 通信端口
required: true
rule: paramPort
type: number
- default: "40269"
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Web Port
labelZh: Web 端口
required: true
rule: paramPort
type: number

View File

@ -0,0 +1,99 @@
{
"servers": [
{
"username": "s01",
"name": "node1",
"type": "xen",
"host": "host1",
"location": "🇨🇳",
"password": "USER_DEFAULT_PASSWORD",
"monthstart": 1
},
{
"username": "s02",
"name": "node2",
"type": "vmware",
"host": "host2",
"location": "🇯🇵",
"password": "USER_DEFAULT_PASSWORD",
"monthstart": 1
},
{
"disabled": true,
"username": "s03",
"name": "node3",
"type": "hyper",
"host": "host3",
"location": "🇫🇷",
"password": "USER_DEFAULT_PASSWORD",
"monthstart": 1
},
{
"username": "s04",
"name": "node4",
"type": "kvm",
"host": "host4",
"location": "🇰🇷",
"password": "USER_DEFAULT_PASSWORD",
"monthstart": 1
}
],
"monitors": [
{
"name": "baidu",
"host": "https://www.baidu.com",
"interval": 300,
"type": "https"
},
{
"name": "aliyun",
"host": "https://www.aliyun.com",
"interval": 300,
"type": "https"
},
{
"name": "114",
"host": "114.114.114.114:53",
"interval": 300,
"type": "tcp"
}
],
"watchdog": [
{
"name": "cpu high warning,exclude username s01",
"rule": "cpu>90&load_1>5&username!='s01'",
"interval": 600,
"callback": "https://yourSMSurl"
},
{
"name": "memory high warning, exclude less than 1GB vps",
"rule": "(memory_used/memory_total)*100>90&memory_total>1048576",
"interval": 300,
"callback": "https://yourSMSurl"
},
{
"name": "offline warning",
"rule": "online4=0&online6=0",
"interval": 600,
"callback": "https://yourSMSurl"
},
{
"name": "ddcc attack,limit type Oracle",
"rule": "tcp_count>600&type='Oracle'",
"interval": 300,
"callback": "https://yourSMSurl"
},
{
"name": "month traffic warning",
"rule": "(network_out-last_network_out)/1024/1024/1024>999",
"interval": 3600,
"callback": "https://yourSMSurl"
},
{
"name": "you can parse an expression combining any known field",
"rule": "load_5>3",
"interval": 900,
"callback": "https://yourSMSurl"
}
]
}

View File

@ -0,0 +1,25 @@
services:
serverstatus:
image: "cppla/serverstatus:latest"
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:80 || bash -c 'kill -s 15 -1 && (sleep 10; kill -s 9 -1)'"]
interval: 30s
timeout: 10s
retries: 5
container_name: ${CONTAINER_NAME}
restart: always
networks:
- 1panel-network
volumes:
- ${SERVERSTATUS_CONFIG_PATH}:/ServerStatus/server/config.json
- ${SERVERSTATUS_JSON_PATH}:/usr/share/nginx/html/json
ports:
- ${PANEL_APP_PORT_COMM}:35601
- ${PANEL_APP_PORT_HTTP}:80
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true

BIN
apps/serverstatus/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB