1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 10:39:53 +00:00

Plugin minecraft-users-ram_: return "U" if no value can be retrieved

This commit is contained in:
Lars Kruse 2018-07-11 19:30:24 +02:00
parent f6a8f2beb1
commit 651f6ac056

View file

@ -54,8 +54,8 @@ then #is running
MEMGiB=$(ps -p "$MC_PID" -o rss | sed -n '2p' | awk '{ print $1 / 1024 / 1024 }') MEMGiB=$(ps -p "$MC_PID" -o rss | sed -n '2p' | awk '{ print $1 / 1024 / 1024 }')
CPU=$(top -bp "$MC_PID" -n 1 | sed -n '$p' | awk '{ print $10 / 100; }') CPU=$(top -bp "$MC_PID" -n 1 | sed -n '$p' | awk '{ print $10 / 100; }')
else else
MEMGiB=0 MEMGiB="U"
CPU=0 CPU="U"
fi fi
echo "users.value $PLAYERCOUNT" echo "users.value $PLAYERCOUNT"