From 56ce29bcecabcaafc9655c992a9764022f8a342b Mon Sep 17 00:00:00 2001 From: okxlin Date: Sun, 30 Jun 2024 23:39:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0serverstatus=E5=88=B0?= =?UTF-8?q?=E5=88=97=E8=A1=A8#1507?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/serverstatus/1.1.4/.env.sample | 5 + apps/serverstatus/1.1.4/data.yml | 32 ++++++ .../1.1.4/data/server/config.json | 99 ++++++++++++++++++ apps/serverstatus/1.1.4/docker-compose.yml | 25 +++++ apps/serverstatus/README.md | 13 +++ apps/serverstatus/data.yml | 19 ++++ apps/serverstatus/latest/.env.sample | 5 + apps/serverstatus/latest/data.yml | 32 ++++++ .../latest/data/server/config.json | 99 ++++++++++++++++++ apps/serverstatus/latest/docker-compose.yml | 25 +++++ apps/serverstatus/logo.png | Bin 0 -> 4768 bytes 11 files changed, 354 insertions(+) create mode 100644 apps/serverstatus/1.1.4/.env.sample create mode 100644 apps/serverstatus/1.1.4/data.yml create mode 100644 apps/serverstatus/1.1.4/data/server/config.json create mode 100644 apps/serverstatus/1.1.4/docker-compose.yml create mode 100644 apps/serverstatus/README.md create mode 100644 apps/serverstatus/data.yml create mode 100644 apps/serverstatus/latest/.env.sample create mode 100644 apps/serverstatus/latest/data.yml create mode 100644 apps/serverstatus/latest/data/server/config.json create mode 100644 apps/serverstatus/latest/docker-compose.yml create mode 100644 apps/serverstatus/logo.png diff --git a/apps/serverstatus/1.1.4/.env.sample b/apps/serverstatus/1.1.4/.env.sample new file mode 100644 index 00000000..a574f5ff --- /dev/null +++ b/apps/serverstatus/1.1.4/.env.sample @@ -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" diff --git a/apps/serverstatus/1.1.4/data.yml b/apps/serverstatus/1.1.4/data.yml new file mode 100644 index 00000000..ff64c231 --- /dev/null +++ b/apps/serverstatus/1.1.4/data.yml @@ -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 diff --git a/apps/serverstatus/1.1.4/data/server/config.json b/apps/serverstatus/1.1.4/data/server/config.json new file mode 100644 index 00000000..fe6c42ac --- /dev/null +++ b/apps/serverstatus/1.1.4/data/server/config.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/apps/serverstatus/1.1.4/docker-compose.yml b/apps/serverstatus/1.1.4/docker-compose.yml new file mode 100644 index 00000000..5abfdf37 --- /dev/null +++ b/apps/serverstatus/1.1.4/docker-compose.yml @@ -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 + diff --git a/apps/serverstatus/README.md b/apps/serverstatus/README.md new file mode 100644 index 00000000..41ffd096 --- /dev/null +++ b/apps/serverstatus/README.md @@ -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 & +``` \ No newline at end of file diff --git a/apps/serverstatus/data.yml b/apps/serverstatus/data.yml new file mode 100644 index 00000000..d9b70d9b --- /dev/null +++ b/apps/serverstatus/data.yml @@ -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 diff --git a/apps/serverstatus/latest/.env.sample b/apps/serverstatus/latest/.env.sample new file mode 100644 index 00000000..a574f5ff --- /dev/null +++ b/apps/serverstatus/latest/.env.sample @@ -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" diff --git a/apps/serverstatus/latest/data.yml b/apps/serverstatus/latest/data.yml new file mode 100644 index 00000000..ff64c231 --- /dev/null +++ b/apps/serverstatus/latest/data.yml @@ -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 diff --git a/apps/serverstatus/latest/data/server/config.json b/apps/serverstatus/latest/data/server/config.json new file mode 100644 index 00000000..fe6c42ac --- /dev/null +++ b/apps/serverstatus/latest/data/server/config.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/apps/serverstatus/latest/docker-compose.yml b/apps/serverstatus/latest/docker-compose.yml new file mode 100644 index 00000000..5c26b713 --- /dev/null +++ b/apps/serverstatus/latest/docker-compose.yml @@ -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 + diff --git a/apps/serverstatus/logo.png b/apps/serverstatus/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..9cec3e62d1817bf3fe702d0d21ccdd15beb049a2 GIT binary patch literal 4768 zcmV;R5?}3!P)jbaz0;>2SrtTwn z)H1E<6|nIfMA{#)@DVcPBd_i=ZPq7b*aVQ=DY5Pzci0(h))HveB68OhgW4TK;2AyS zBR=37iQ5q&-xx{y0kHG{i`f8%*aIc!0CLy^Eam`g*8zFh0f5*89p?dM*a14?0yE?Q zUfBUw+5te|0Z!ZiklO)A-Ud4LYx6xd0000XbW%=J06iXX(G4#H{Qi$>R_ar^=A=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