serverwatcher 5.1.5__tar.gz → 5.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {serverwatcher-5.1.5/src/serverwatcher.egg-info → serverwatcher-5.2.1}/PKG-INFO +1 -1
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/pyproject.toml +1 -1
- serverwatcher-5.2.1/src/serverwatcher/defaultconfigs/config.yaml +28 -0
- serverwatcher-5.2.1/src/serverwatcher/defaultconfigs/messages.yaml +58 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/src/serverwatcher/watcher.py +2 -2
- {serverwatcher-5.1.5 → serverwatcher-5.2.1/src/serverwatcher.egg-info}/PKG-INFO +1 -1
- serverwatcher-5.1.5/src/serverwatcher/defaultconfigs/config.yaml +0 -28
- serverwatcher-5.1.5/src/serverwatcher/defaultconfigs/messages.yaml +0 -58
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/LICENSE +0 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/README.md +0 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/setup.cfg +0 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/src/serverwatcher/__init__.py +0 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/src/serverwatcher/configclasses/__init__.py +0 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/src/serverwatcher/configclasses/config.py +0 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/src/serverwatcher/configclasses/messages.py +0 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/src/serverwatcher/configclasses/watcher.py +0 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/src/serverwatcher/defaultconfigs/watcher.yaml +0 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/src/serverwatcher/validator.py +0 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/src/serverwatcher.egg-info/SOURCES.txt +0 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/src/serverwatcher.egg-info/dependency_links.txt +0 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/src/serverwatcher.egg-info/requires.txt +0 -0
- {serverwatcher-5.1.5 → serverwatcher-5.2.1}/src/serverwatcher.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
watch_interval: 300
|
|
2
|
+
|
|
3
|
+
panel:
|
|
4
|
+
name: 'My Panel'
|
|
5
|
+
url: 'https://example.com'
|
|
6
|
+
api_key: 'CHANGE_ME'
|
|
7
|
+
|
|
8
|
+
origin:
|
|
9
|
+
server_id: 'CHANGE_ME'
|
|
10
|
+
|
|
11
|
+
server:
|
|
12
|
+
name: 'My SMP'
|
|
13
|
+
server_id: 'CHANGE_ME'
|
|
14
|
+
domain: 'mc.example.com'
|
|
15
|
+
port: 25565
|
|
16
|
+
rcon_port: 25575
|
|
17
|
+
rcon_password: 'password'
|
|
18
|
+
tps_command: 'ticks'
|
|
19
|
+
|
|
20
|
+
logger:
|
|
21
|
+
enabled: True
|
|
22
|
+
name: 'Server Watcher'
|
|
23
|
+
log_path: '/home/container/logs/'
|
|
24
|
+
timezone: 'America/Chicago'
|
|
25
|
+
|
|
26
|
+
terminal:
|
|
27
|
+
backspaces: 8
|
|
28
|
+
enable_clearing: True
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
prefix: '<aqua>[Server Watcher]'
|
|
2
|
+
|
|
3
|
+
broadcast_restart_at: '{prefix} The server will restart at {time} CDT.'
|
|
4
|
+
bullet: '-'
|
|
5
|
+
|
|
6
|
+
broadcast_minutes:
|
|
7
|
+
'120': '{prefix} Restart in 2 hours!'
|
|
8
|
+
'60': '{prefix} Restart in 1 hour!'
|
|
9
|
+
'45': '{prefix} Restart in 45 minutes!'
|
|
10
|
+
'30': '{prefix} Restart in 30 minutes!'
|
|
11
|
+
'15': '{prefix} Restart in 15 minutes!'
|
|
12
|
+
'5': '{prefix} Restart in 5 minutes!'
|
|
13
|
+
'1': '{prefix} Restart in 1 minute!'
|
|
14
|
+
|
|
15
|
+
broadcast_seconds:
|
|
16
|
+
'10': '{prefix} Restart in 10 seconds!'
|
|
17
|
+
'9': '{prefix} Restart in 9 seconds!'
|
|
18
|
+
'8': '{prefix} Restart in 8 seconds!'
|
|
19
|
+
'7': '{prefix} Restart in 7 seconds!'
|
|
20
|
+
'6': '{prefix} Restart in 6 seconds!'
|
|
21
|
+
'5': '{prefix} Restart in 5 seconds!'
|
|
22
|
+
'4': '{prefix} Restart in 4 seconds!'
|
|
23
|
+
'3': '{prefix} Restart in 3 seconds!'
|
|
24
|
+
'2': '{prefix} Restart in 2 seconds!'
|
|
25
|
+
'1': '{prefix} Restart in 1 second!'
|
|
26
|
+
|
|
27
|
+
logging:
|
|
28
|
+
startup: 'ServerWatcher is running!'
|
|
29
|
+
status_check: 'Checking server status...'
|
|
30
|
+
validation_fail: 'Validation FAILED.'
|
|
31
|
+
validation_ok: 'All validation checks succeeded.'
|
|
32
|
+
shutdown: 'Shutting down ServerWatcher.'
|
|
33
|
+
immediate_restart: 'Restarting immediately.'
|
|
34
|
+
no_restart: 'The server does not need to restart.'
|
|
35
|
+
scheduled: 'Restart needed, but anti-restart factors outweigh it.'
|
|
36
|
+
gap_low: 'Gap {gap}. Scheduling restart in 2 hours.'
|
|
37
|
+
gap_high: 'Gap {gap}. Scheduling restart in 1 hour.'
|
|
38
|
+
|
|
39
|
+
reasons:
|
|
40
|
+
pro_splash: 'PRO-RESTART REASONS:'
|
|
41
|
+
anti_splash: 'ANTI-RESTART REASONS:'
|
|
42
|
+
|
|
43
|
+
restart_soon: 'The server is set to restart soon'
|
|
44
|
+
ram: 'RAM usage ({ram}) is higher than {threshold} GB'
|
|
45
|
+
cpu: 'CPU usage ({cpu}) is higher than {threshold}%'
|
|
46
|
+
uptime: 'Uptime {uptime} exceeds {threshold}h'
|
|
47
|
+
tps: 'TPS {tps} is lower than {threshold}'
|
|
48
|
+
low_uptime: 'Uptime {uptime} is shorter than 30m'
|
|
49
|
+
players: 'There {verb} {count} {plural} online'
|
|
50
|
+
|
|
51
|
+
pro_restart_number: 'Pro-restart: '
|
|
52
|
+
anti_restart_number: 'Anti-restart:'
|
|
53
|
+
|
|
54
|
+
restarts:
|
|
55
|
+
restart_action_sent: 'Restart action sent. Waiting...'
|
|
56
|
+
back_online: 'Server is back online!'
|
|
57
|
+
back_online_broadcast: '{prefix} <green>Restart successful!'
|
|
58
|
+
failed_restart: 'Server failed to restart!'
|
|
@@ -99,7 +99,7 @@ class ServerWatcher:
|
|
|
99
99
|
self.say(self.messages.restart_action_sent)
|
|
100
100
|
time.sleep(self.watcherconfig.restart_wait_seconds)
|
|
101
101
|
|
|
102
|
-
self.say(self.messages.
|
|
102
|
+
self.say(self.messages.status_check, level="warn")
|
|
103
103
|
alive = waitForOnline(
|
|
104
104
|
self.server,
|
|
105
105
|
timeout=self.watcherconfig.restart_timeout,
|
|
@@ -179,7 +179,7 @@ class ServerWatcher:
|
|
|
179
179
|
)
|
|
180
180
|
pro += self.watcherconfig.weight_uptime
|
|
181
181
|
|
|
182
|
-
if (snap.tps if snap.tps is not None else
|
|
182
|
+
if (snap.tps if snap.tps is not None else 20) <= self.watcherconfig.threshold_tps:
|
|
183
183
|
restart_reasons.append(self.fmt(self.messages.reason_tps, tps=snap.tps, threshold=self.watcherconfig.threshold_tps))
|
|
184
184
|
pro += self.watcherconfig.weight_tps
|
|
185
185
|
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
watch_interval: 300
|
|
2
|
-
|
|
3
|
-
panel:
|
|
4
|
-
name: "My Panel"
|
|
5
|
-
url: "https://example.com"
|
|
6
|
-
api_key: "CHANGE_ME"
|
|
7
|
-
|
|
8
|
-
origin:
|
|
9
|
-
server_id: "CHANGE_ME"
|
|
10
|
-
|
|
11
|
-
server:
|
|
12
|
-
name: "My SMP"
|
|
13
|
-
server_id: "CHANGE_ME"
|
|
14
|
-
domain: "mc.example.com"
|
|
15
|
-
port: 25565
|
|
16
|
-
rcon_port: 25575
|
|
17
|
-
rcon_password: "password"
|
|
18
|
-
tps_command: "ticks"
|
|
19
|
-
|
|
20
|
-
logger:
|
|
21
|
-
enabled: True
|
|
22
|
-
name: "Server Watcher"
|
|
23
|
-
log_path: "/home/container/logs/"
|
|
24
|
-
timezone: "America/Chicago"
|
|
25
|
-
|
|
26
|
-
terminal:
|
|
27
|
-
backspaces: 8
|
|
28
|
-
enable_clearing: True
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
prefix: "<aqua>[Server Watcher]"
|
|
2
|
-
|
|
3
|
-
broadcast_restart_at: "{prefix} The server will restart at {time} CDT."
|
|
4
|
-
bullet: "-"
|
|
5
|
-
|
|
6
|
-
broadcast_minutes:
|
|
7
|
-
120: "{prefix} Restart in 2 hours!"
|
|
8
|
-
60: "{prefix} Restart in 1 hour!"
|
|
9
|
-
45: "{prefix} Restart in 45 minutes!"
|
|
10
|
-
30: "{prefix} Restart in 30 minutes!"
|
|
11
|
-
15: "{prefix} Restart in 15 minutes!"
|
|
12
|
-
5: "{prefix} Restart in 5 minutes!"
|
|
13
|
-
1: "{prefix} Restart in 1 minute!"
|
|
14
|
-
|
|
15
|
-
broadcast_seconds:
|
|
16
|
-
10: "{prefix} Restart in 10 seconds!"
|
|
17
|
-
9: "{prefix} Restart in 9 seconds!"
|
|
18
|
-
8: "{prefix} Restart in 8 seconds!"
|
|
19
|
-
7: "{prefix} Restart in 7 seconds!"
|
|
20
|
-
6: "{prefix} Restart in 6 seconds!"
|
|
21
|
-
5: "{prefix} Restart in 5 seconds!"
|
|
22
|
-
4: "{prefix} Restart in 4 seconds!"
|
|
23
|
-
3: "{prefix} Restart in 3 seconds!"
|
|
24
|
-
2: "{prefix} Restart in 2 seconds!"
|
|
25
|
-
1: "{prefix} Restart in 1 second!"
|
|
26
|
-
|
|
27
|
-
logging:
|
|
28
|
-
startup: "ServerWatcher is running!"
|
|
29
|
-
status_check: "Checking server status..."
|
|
30
|
-
validation_fail: "Validation FAILED."
|
|
31
|
-
validation_ok: "All validation checks succeeded."
|
|
32
|
-
shutdown: "Shutting down ServerWatcher."
|
|
33
|
-
immediate_restart: "Restarting immediately."
|
|
34
|
-
no_restart: "The server does not need to restart."
|
|
35
|
-
scheduled: "Restart needed, but anti-restart factors outweigh it."
|
|
36
|
-
gap_low: "Gap {gap}. Scheduling restart in 2 hours."
|
|
37
|
-
gap_high: "Gap {gap}. Scheduling restart in 1 hour."
|
|
38
|
-
|
|
39
|
-
reasons:
|
|
40
|
-
pro_splash: "PRO-RESTART REASONS:"
|
|
41
|
-
anti_splash: "ANTI-RESTART REASONS:"
|
|
42
|
-
|
|
43
|
-
restart_soon: "The server is set to restart soon"
|
|
44
|
-
ram: "RAM usage ({ram}) is higher than {threshold} GB"
|
|
45
|
-
cpu: "CPU usage ({cpu}) is higher than {threshold}%"
|
|
46
|
-
uptime: "Uptime {uptime} exceeds {threshold}h"
|
|
47
|
-
tps: "TPS {tps} is lower than {threshold}"
|
|
48
|
-
low_uptime: "Uptime {uptime} is shorter than 30m"
|
|
49
|
-
players: "There {verb} {count} {plural} online"
|
|
50
|
-
|
|
51
|
-
pro_restart_number: "Pro-restart: "
|
|
52
|
-
anti_restart_number: "Anti-restart:"
|
|
53
|
-
|
|
54
|
-
restarts:
|
|
55
|
-
restart_action_sent: "Restart action sent. Waiting..."
|
|
56
|
-
back_online: "Server is back online!"
|
|
57
|
-
back_online_broadcast: "{prefix} <green>Restart successful!"
|
|
58
|
-
failed_restart: "Server failed to restart!"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|