summaryrefslogtreecommitdiffstats
path: root/modules-available
diff options
context:
space:
mode:
authorSimon Rettberg2019-02-19 16:24:22 +0100
committerSimon Rettberg2019-02-19 16:24:22 +0100
commita46ab41355a1ca1a7507358c07045b0ba5ae1f59 (patch)
treea50903aa7002fe324a0f12c999cc7d2fa9af5ac7 /modules-available
parent[js_weekcalendar] Only show short header if event is < 1 hr (diff)
downloadslx-admin-a46ab41355a1ca1a7507358c07045b0ba5ae1f59.tar.gz
slx-admin-a46ab41355a1ca1a7507358c07045b0ba5ae1f59.tar.xz
slx-admin-a46ab41355a1ca1a7507358c07045b0ba5ae1f59.zip
[statistics] Fix RAM change warning to handle increase too
Diffstat (limited to 'modules-available')
-rw-r--r--modules-available/statistics/api.inc.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules-available/statistics/api.inc.php b/modules-available/statistics/api.inc.php
index 280e5abc..d4b8f346 100644
--- a/modules-available/statistics/api.inc.php
+++ b/modules-available/statistics/api.inc.php
@@ -441,7 +441,8 @@ function checkHardwareChange($old, $new)
$ram2 = ceil($new['mbram'] / 1024);
}
if ($ram1 !== $ram2) {
- EventLog::warning('[poweron] Client ' . $new['uuid'] . ' (' . $new['clientip'] . "): RAM decreased from {$ram1}GB to {$ram2}GB");
+ $word = $ram1 > $ram2 ? 'decreased' : 'increased';
+ EventLog::warning('[poweron] Client ' . $new['uuid'] . ' (' . $new['clientip'] . "): RAM $word from {$ram1}GB to {$ram2}GB");
}
if (!empty($old['cpumodel']) && !empty($new['cpumodel']) && $new['cpumodel'] !== $old['cpumodel']) {
EventLog::warning('[poweron] Client ' . $new['uuid'] . ' (' . $new['clientip'] . "): CPU changed from '{$old['cpumodel']}' to '{$new['cpumodel']}'");