mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-26 02:48:28 +00:00
Initial version
This commit is contained in:
parent
fbc71d60b5
commit
5d78918d0b
1 changed files with 32 additions and 0 deletions
32
plugins/other/minecraft-users
Executable file
32
plugins/other/minecraft-users
Executable file
|
@ -0,0 +1,32 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Config:
|
||||||
|
# [minecraft_players
|
||||||
|
# playerfile /etc/minecraft/players.txt
|
||||||
|
# subtract true
|
||||||
|
#
|
||||||
|
# playerfile - location of player list file, for example from the OnlineUsers
|
||||||
|
# plugin
|
||||||
|
# subtract - OnlineUsers has a header above the user list, set this to true
|
||||||
|
# to subtract 1 from the output to compensate
|
||||||
|
case $1 in
|
||||||
|
config)
|
||||||
|
cat <<'EOM'
|
||||||
|
graph_title Connected players
|
||||||
|
graph_vlabel players
|
||||||
|
players.label players
|
||||||
|
graph_info Number of players connected to Minecraft
|
||||||
|
graph_category Minecraft
|
||||||
|
EOM
|
||||||
|
exit 0;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo -n "players.value "
|
||||||
|
|
||||||
|
count=`wc -l ${playerfile} | cut -d' ' -f1`
|
||||||
|
if [ $subtract="true" ];
|
||||||
|
then
|
||||||
|
echo -n "$(($count - 1))"
|
||||||
|
else
|
||||||
|
echo $count
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue