Plugin swap: fix evaluation of swap usage

The variable name was misspelled.
This commit is contained in:
Lars Kruse 2020-02-07 14:13:37 +01:00
parent d1da0df1b2
commit 5de3df252e

View file

@ -17,8 +17,8 @@ config_swap() {
fetch_swap() { fetch_swap() {
if [ -f /proc/vmstat ]; then if [ -f /proc/vmstat ]; then
SINFO=$(cat /proc/vmstat) SINFO=$(cat /proc/vmstat)
echo "swap_in.value" $(echo "$INFO" | awk 'BEGIN { result="U"; } { if ($1 == "pswpin") result=$2; } END { print(result); }') echo "swap_in.value" $(echo "$SINFO" | awk 'BEGIN { result="U"; } { if ($1 == "pswpin") result=$2; } END { print(result); }')
echo "swap_out.value" $(echo "$INFO" | awk 'BEGIN { result="U"; } { if ($1 == "pswpout") result=$2; } END { print(result); }') echo "swap_out.value" $(echo "$SINFO" | awk 'BEGIN { result="U"; } { if ($1 == "pswpout") result=$2; } END { print(result); }')
else else
SINFO=$(grep "^swap" /proc/stat) SINFO=$(grep "^swap" /proc/stat)
echo "swap_in.value" $(echo "$SINFO" | cut -d\ -f2) echo "swap_in.value" $(echo "$SINFO" | cut -d\ -f2)