Showing 2 changed files with 9 additions and 9 deletions
+9
monitoring.d/common-tests
... ...
@@ -57,3 +57,12 @@ function certificates () {
57 57
         fi
58 58
     done
59 59
 }
60
+
61
+function load_avg () {
62
+    local procs=$(grep -c "^processor" /proc/cpuinfo)
63
+    local load=($(</proc/loadavg))
64
+    local avg=(1 5 15)
65
+    for ((i=0; i<${#avg[@]}; i++)); do
66
+        test ${load[i]%.*} -ge $procs && echo "charge moyenne à ${avg[i]}min = ${load[i]}"
67
+    done
68
+}
-9
monitoring.d/raspberrypi
... ...
@@ -78,15 +78,6 @@ function core_alim () {
78 78
     test $volt == "1.2000V" || echo "$volt"
79 79
 }
80 80
 
81
-function load_avg () {
82
-    local procs=4
83
-    local load=($(</proc/loadavg))
84
-    local avg=(1 5 15)
85
-    for ((i=0; i<${#avg[@]}; i++)); do
86
-        test ${load[i]%.*} -ge $procs && echo "charge moyenne à ${avg[i]}min = ${load[i]}"
87
-    done
88
-}
89
-
90 81
 function mem_pressure () {
91 82
     local meminfo=($(</proc/meminfo))
92 83
     local level=(danger severe warning)