added process print
This commit is contained in:
parent
250282f78b
commit
d5657eb1f8
6
bot.sh
6
bot.sh
|
@ -29,7 +29,8 @@ fi
|
|||
cpu=$(cpuUsage)
|
||||
if [ "$cpu" -gt "$cpulimit" ]; then
|
||||
echo "cpu limit!"
|
||||
send "warnung%20CPU%20Usage%20is%20high%20$cpu"
|
||||
proc=$(cpuHighest)
|
||||
send "warnung%20CPU%20Usage%20is%20high%20$cpu%25%0A$proc"
|
||||
fi
|
||||
|
||||
#mem usage
|
||||
|
@ -37,7 +38,8 @@ fi
|
|||
mem=$(memUsage)
|
||||
if [ "$mem" -gt "$memlimit" ]; then
|
||||
echo "mem limit!"
|
||||
send "warnung%20Memory%20Usage%20is%20high%20$mem%25"
|
||||
proc=$(memHighest)
|
||||
send "warnung%20Memory%20Usage%20is%20high%20$mem%25%0A$proc"
|
||||
fi
|
||||
|
||||
#CheckCerts
|
||||
|
|
4
cpu.sh
4
cpu.sh
|
@ -3,3 +3,7 @@
|
|||
function cpuUsage {
|
||||
ps -A -o pcpu | tail -n+2 | paste -sd+ | bc | awk '{print int($1)}'
|
||||
}
|
||||
|
||||
function cpuHighest {
|
||||
ps -eo pid,cmd,%cpu --sort=-%cpu | head -2 | tail -n 1
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue