Showing 1 changed files with 10 additions and 0 deletions
+10
supervision.d/common-tests
... ...
@@ -36,3 +36,13 @@ function sys_state () {
36 36
             }')
37 37
     fi
38 38
 }
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)) -gt $now && echo "pas de mise à jour depuis le ${lastline%% *}"
48
+}