mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Plugin minecraft-users-ram_: more precise netstat output filtering
This commit is contained in:
parent
94f46d392b
commit
00149864b2
@ -47,8 +47,8 @@ then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PLAYERCOUNT=$(netstat -tn | grep -i "$MC_PORT" | grep ESTABLISHED | wc -l)
|
PLAYERCOUNT=$(netstat -tn | grep ":$MC_PORT " | grep ESTABLISHED | wc -l)
|
||||||
MC_PID=$(netstat -tlpn | grep "$MC_PORT" | sed -n -e '1p' | awk '{ print $7 }' | cut -d '/' -f1)
|
MC_PID=$(netstat -tlpn | grep ":$MC_PORT " | sed -n -e '1p' | awk '{ print $7 }' | cut -d '/' -f1)
|
||||||
if [ ! -z "${MC_PID}" ]
|
if [ ! -z "${MC_PID}" ]
|
||||||
then #is running
|
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 }')
|
||||||
|
Loading…
Reference in New Issue
Block a user