Showing 1 changed files with 10 additions and 8 deletions
+10 -8
monitoring.d/common-tests
... ...
@@ -37,14 +37,6 @@ function sys_state () {
37 37
     fi
38 38
 }
39 39
 
40
-function upgrades () {
41
-    local log="/var/log/unattended-upgrades/unattended-upgrades.log"
42
-    test -r $log || return
43
-    local lastline=$(tail -1 $log)
44
-    local lastentry=$(date +%s -d "$(cut -f1,2 -d' ' <<< $lastline)")
45
-    test -n "$lastentry" || return
46
-    local status=$(cut -f3 -d' ' <<< $lastline)
47
-    test $(($lastentry + 86400)) -lt $now && echo "pas de mise à jour depuis le ${lastline%% *}"
48 40
 }
49 41
 
50 42
 function certificates () {
... ...
@@ -67,3 +59,13 @@ function load_avg () {
67 59
         test ${load[i]%.*} -ge $procs && echo "charge moyenne à ${avg[i]}min = ${load[i]}"
68 60
     done
69 61
 }
62
+
63
+function upgrades () {
64
+    local log="/var/log/unattended-upgrades/unattended-upgrades.log"
65
+    test -r $log || return
66
+    local lastline=$(tail -1 $log)
67
+    local lastentry=$(date +%s -d "$(cut -f1,2 -d' ' <<< $lastline)")
68
+    test -n "$lastentry" || return
69
+    local status=$(cut -f3 -d' ' <<< $lastline)
70
+    test $(($lastentry + 86400)) -lt $now && echo "pas de mise à jour depuis le ${lastline%% *}"
71
+}