From a46ab41355a1ca1a7507358c07045b0ba5ae1f59 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 19 Feb 2019 16:24:22 +0100 Subject: [statistics] Fix RAM change warning to handle increase too --- modules-available/statistics/api.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules-available') 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']}'"); -- cgit v1.2.3-55-g7522