wayar: make loadavg script nicer
This commit is contained in:
parent
8f084c0210
commit
de2d5e01bc
|
@ -4,12 +4,13 @@
|
|||
|
||||
local load_all=$(cut -d' ' -f1,2,3 /proc/loadavg)
|
||||
local load=${${(@s: :)load_all}[1]}
|
||||
print -l ${load} ${load_all}
|
||||
|
||||
if [[ ${load} -gt $(( $(nproc) + 1 )) ]]; then
|
||||
print critical
|
||||
elif [[ ${load} -gt $(nproc) ]]; then
|
||||
print warning
|
||||
else
|
||||
print good
|
||||
local class=good
|
||||
local nproc=$(nproc)
|
||||
if [[ ${load} -gt $(( ${nproc} + 1 )) ]]; then
|
||||
class=critical
|
||||
elif [[ ${load} -gt ${nproc} ]]; then
|
||||
class=warning
|
||||
fi
|
||||
|
||||
print -l ${load} ${load_all} ${class}
|
||||
|
|
Loading…
Reference in New Issue
Block a user