mirror of
https://github.com/snowykami/server-status-client.git
synced 2026-01-26 13:41:53 +00:00
Compare commits
3 Commits
0360e58cc1
...
89d7fa3145
| Author | SHA1 | Date | |
|---|---|---|---|
| 89d7fa3145 | |||
| 833c96cbc5 | |||
| 2e4fd493c5 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -122,6 +122,8 @@ celerybeat.pid
|
|||||||
*.sage.py
|
*.sage.py
|
||||||
|
|
||||||
pdm.lock
|
pdm.lock
|
||||||
|
start.cmd
|
||||||
|
start.sh
|
||||||
|
|
||||||
# Environments
|
# Environments
|
||||||
.env
|
.env
|
||||||
|
|||||||
@@ -85,6 +85,13 @@ sudo systemctl enable server-status-client
|
|||||||
sudo systemctl start server-status-client
|
sudo systemctl start server-status-client
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 更新
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git pull
|
||||||
|
sudo systemctl restart server-status-client
|
||||||
|
```
|
||||||
|
|
||||||
### 服务端
|
### 服务端
|
||||||
|
|
||||||
请在中心服务器上部署 [server-status-server](https://github.com/snowykami/server-status-server)
|
请在中心服务器上部署 [server-status-server](https://github.com/snowykami/server-status-server)
|
||||||
@@ -120,7 +120,7 @@ class Api:
|
|||||||
|
|
||||||
class Client:
|
class Client:
|
||||||
def __init__(self, addr: str, token: str, client_id: str, name: str = "", location: str = "", labels: list[str] = [], link: str = "",
|
def __init__(self, addr: str, token: str, client_id: str, name: str = "", location: str = "", labels: list[str] = [], link: str = "",
|
||||||
interval: int = 5):
|
interval: int = 2):
|
||||||
self.api = Api(addr, {"token": token, "id": client_id})
|
self.api = Api(addr, {"token": token, "id": client_id})
|
||||||
self.api = self.api.group("/client")
|
self.api = self.api.group("/client")
|
||||||
self.api.add_headers(Authorization="{token}")
|
self.api.add_headers(Authorization="{token}")
|
||||||
@@ -224,7 +224,7 @@ class Client:
|
|||||||
self.hardware.mem_used = psutil.virtual_memory().used
|
self.hardware.mem_used = psutil.virtual_memory().used
|
||||||
self.hardware.swap_total = psutil.swap_memory().total
|
self.hardware.swap_total = psutil.swap_memory().total
|
||||||
self.hardware.swap_used = psutil.swap_memory().used
|
self.hardware.swap_used = psutil.swap_memory().used
|
||||||
self.hardware.cpu_cores = psutil.cpu_count()
|
self.hardware.cpu_cores = psutil.cpu_count(logical=False)
|
||||||
self.hardware.cpu_logics = psutil.cpu_count(logical=True)
|
self.hardware.cpu_logics = psutil.cpu_count(logical=True)
|
||||||
for part in psutil.disk_partitions():
|
for part in psutil.disk_partitions():
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user