|
|
@ -613,7 +613,7 @@ prompt_ip() {
|
|
|
|
|
|
|
|
|
|
|
|
prompt_load() {
|
|
|
|
prompt_load() {
|
|
|
|
if [[ "$OS" == "OSX" ]]; then
|
|
|
|
if [[ "$OS" == "OSX" ]]; then
|
|
|
|
load_avg_5min=$(sysctl vm.loadavg | grep -o -E '[0-9]+\.[0-9]+' | head -n 1)
|
|
|
|
load_avg_5min=$(sysctl vm.loadavg | grep -o -E '[0-9]+(\.|,)[0-9]+' | head -n 1)
|
|
|
|
ramfree=$(vm_stat | grep "Pages free" | grep -o -E '[0-9]+')
|
|
|
|
ramfree=$(vm_stat | grep "Pages free" | grep -o -E '[0-9]+')
|
|
|
|
# Convert pages into Bytes
|
|
|
|
# Convert pages into Bytes
|
|
|
|
ramfree=$(( $ramfree * 4096 ))
|
|
|
|
ramfree=$(( $ramfree * 4096 ))
|
|
|
@ -624,6 +624,9 @@ prompt_load() {
|
|
|
|
base=K
|
|
|
|
base=K
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Replace comma
|
|
|
|
|
|
|
|
load_avg_5min=${load_avg_5min//,/.}
|
|
|
|
|
|
|
|
|
|
|
|
if [[ "$load_avg_5min" -gt 10 ]]; then
|
|
|
|
if [[ "$load_avg_5min" -gt 10 ]]; then
|
|
|
|
BACKGROUND_COLOR="red"
|
|
|
|
BACKGROUND_COLOR="red"
|
|
|
|
FUNCTION_SUFFIX="_CRITICAL"
|
|
|
|
FUNCTION_SUFFIX="_CRITICAL"
|
|
|
|