verbesserte Ausgabe, syntaktische Verbesserungen

This commit is contained in:
Patrick 2019-08-09 22:06:40 +02:00
parent e3b1a4c411
commit b40b8d6554
1 changed files with 8 additions and 2 deletions

View File

@ -1,7 +1,13 @@
#!/bin/bash
if ! type bc > /dev/null 2>&1
then
echo "bc nicht installiert"
exit 1
fi
processors="$(cat /proc/cpuinfo | grep processor -c)"
path=$(find /usr/lib* -name check_load)
processors="$(grep processor -c /proc/cpuinfo)"
warn1perc="70"
warn5perc="60"
warn15perc="50"
@ -30,4 +36,4 @@ crit1=$(echo "scale=2; $processors * $crit1perc / 100" | bc)
crit5=$(echo "scale=2; $processors * $crit5perc / 100" | bc)
crit15=$(echo "scale=2; $processors * $crit15perc / 100" | bc)
echo "check_loadavg -w $warn1,$warn5,$warn15 -c $crit1,$crit5,$crit15"
echo "command[check_load]=$path -w $warn1,$warn5,$warn15 -c $crit1,$crit5,$crit15"