1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Category Tree: Reduce number of categories

java -> virtualization (jvm)
wuala -> backup (wuala)
games (game) -> games (quake)
This commit is contained in:
dipohl 2017-02-26 15:49:01 +01:00
parent e148716e6e
commit 8d9fe5bdde
11 changed files with 7 additions and 7 deletions

View file

@ -1,95 +0,0 @@
#!/bin/bash
#
# Plugin to monitor BigBrotherBot errors
#
# ln -s /usr/share/node/node/plugins-auto/b3error_
# /etc/munin/node.d/b3error_name
#
# you must provide the path to bigbrotherbot logfile with env.logfile
# Parameters understood:
#
# config (required)
# autoconf (optional)
#
# Magic markers (optional - used by munin-config and installation
# scripts):
#
#%# capabilities=autoconf
B3NAME=${0##*/b3error_}
LOGTAIL=${logtail:-`which logtail`}
#logfile from env
STATEFILE=/var/lib/munin/plugin-state/${B3NAME}.offset
mktempfile () {
mktemp -t $1
}
if [ "$1" = "autoconf" ]; then
if [ -n "${B3NAME}" -a -f "${logfile}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ]; then
echo yes
exit 0
else
echo -n "no"
if [ ! -n "${B3NAME}" ]; then
echo " (you must call that plugin with a symlink)"
elif [ ! -n "${logfile}" ]; then
echo " (you must set the env variable env.logfile)"
elif [ ! -f "${logfile}" ]; then
echo " (log file : '${logfile}' not found)"
elif [ ! -n "${LOGTAIL}" ]; then
echo " (logtail required)"
elif [ ! -x "${LOGTAIL}" ]; then
echo " (cannot execute ${LOGTAIL})"
fi
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo "graph_title BigBrotherBot errors - ${B3NAME}"
cat <<'EOM'
graph_args --base 1000 -l 0
graph_vlabel Errors
graph_category Games
errors.label total errors
errors.draw AREA
rconreading.label RCON: ERROR reading
rconreading.draw AREA
eventqueue.label Event sat in queue too long
eventqueue.draw AREA
parseline.label could not parse line
parseline.draw AREA
other.label Other errors
other.draw AREA
EOM
exit 0
fi
errors=U
rconsocketerror=U
parseline=U
eventqueue=U
other=U
TEMP_FILE=`mktempfile munin-${B3NAME}-log.XXXXXX`
if [ -n "$TEMP_FILE" -a -f "$TEMP_FILE" ]
then
$LOGTAIL ${logfile} $STATEFILE > ${TEMP_FILE}
errors=`sed -rne 's/^[0-9]+\s+[0-9:]+\s+ERROR\s+(.+)/\1/p' ${TEMP_FILE} | wc -l`
rconreading=`grep 'RCON: ERROR reading' ${TEMP_FILE} | wc -l`
parseline=`grep 'could not parse line' ${TEMP_FILE} | wc -l`
eventqueue=`grep '**** Event sat in queue too long:' ${TEMP_FILE} | wc -l`
other=$(( $errors - ($rconreading + $parseline + $eventqueue) ))
/bin/rm -f $TEMP_FILE
fi
echo "errors.value ${errors}"
echo "rconreading.value ${rconreading}"
echo "eventqueue.value ${eventqueue}"
echo "parseline.value ${parseline}"
echo "other.value ${other}"
exit 0

View file

@ -1,106 +0,0 @@
#!/bin/ksh
#################################################################
# Title : Qstat plugin for Munin #
# Author : Benjamin DUPUIS - Poil #
# Email : poil@quake.fr #
# First release : 18/10/2007 #
#---------------------------------------------------------------#
#################################################################
# Variable : #
#---------------------------------------------------------------#
qstat_exe='/usr/local/bin/qstat'
#---------------------------------------------------------------#
# End of config
script_name=$(basename $0)
#################################################################
#################################################################
# Help #
#---------------------------------------------------------------#
usage() {
echo 'For testing the script, run qstat_ GameType IP Port'
echo ' - GameType : q3s, q4s ... run qstat for seeing available gametype'
echo 'For munin you must ln -s /usr/share/munin/plugins/qstat_ /etc/munin/plugins/qstat_GameType_IP2test_Port'
echo 'Perhaps you must have to set qstat_exe path, actually on'${qstat_exe};
echo 'Have Fun'
}
config() {
if [ "${script_name}" != "qstat_" ]; then
gametype=$(echo ${script_name} | cut -d_ -f2)
ip=$(echo ${script_name} | cut -d_ -f3)
port=$(echo ${script_name} | cut -d_ -f4)
else
gametype=$1
ip=$2
port=$3
fi
echo "graph_title Number of players on ${gametype} - ${ip}:${port}
graph_vlabel players
graph_args --base 1000 -r --lower-limit 0 --upper-limit 16
graph_category games
maxplayer.label max players
player.label players"
}
#################################################################
# Quake Stat, call qstat #
#---------------------------------------------------------------#
quake_stat() {
if [ "${script_name}" != "qstat_" ]; then
gametype=$(echo ${script_name} | cut -d_ -f2)
ip=$(echo ${script_name} | cut -d_ -f3)
port=$(echo ${script_name} | cut -d_ -f4)
else
gametype=$1
ip=$2
port=$3
fi
if [ ! -z ${gametype} ] && [ ! -z ${gametype} ] && [ ! -z ${gametype} ]; then
dummy=$(${qstat_exe} -raw ";" -nh -${gametype} ${ip}:${port})
playervalue=$(echo ${dummy} | cut -d\; -f6)
maxplayervalue=$(echo ${dummy} | cut -d\; -f5)
if [ -z "${playervalue}" ]; then
playervalue=0
fi
if [ -z "${maxplayervalue}" ]; then
maxplayervalue=0
fi
echo "maxplayer.value "${maxplayervalue};
echo "player.value "${playervalue};
else
echo "maxplayer.value U"
echo "player.value U"
fi
}
#################################################################
# Main #
#---------------------------------------------------------------#
case $1 in
config)
config
exit 0
;;
help | ?)
usage
exit 0
;;
autoconf)
echo "no (edit the script for set qstat path)"
;;
*)
quake_stat $1 $2 $3
exit 0
;;
esac

View file

@ -1,106 +0,0 @@
#!/bin/ksh
#################################################################
# Title : Qstat plugin for Munin #
# Author : Benjamin DUPUIS - Poil #
# Email : poil@quake.fr #
# First release : 18/10/2007 #
#---------------------------------------------------------------#
#################################################################
# Variable : #
#---------------------------------------------------------------#
qstat_exe='/usr/bin/qstat'
#---------------------------------------------------------------#
# End of config
script_name=$(basename $0)
#################################################################
#################################################################
# Help #
#---------------------------------------------------------------#
usage() {
echo 'For testing the script, run qstat_ GameType IP Port'
echo ' - GameType : q3s, q4s ... run qstat for seeing available gametype'
echo 'For munin you must ln -s /usr/share/munin/plugins/qstat_ /etc/munin/plugins/qstat_GameType_IP2test_Port'
echo 'Perhaps you must have to set qstat_exe path, actually on'${qstat_exe};
echo 'Have Fun'
}
config() {
if [ "${script_name}" != "qstat_" ]; then
gametype=$(echo ${script_name} | cut -d_ -f2)
ip=$(echo ${script_name} | cut -d_ -f3)
port=$(echo ${script_name} | cut -d_ -f4)
else
gametype=$1
ip=$2
port=$3
fi
echo "graph_title Number of players on ${gametype} - ${ip}:${port}
graph_vlabel players
#graph_args --base 1000 -r --lower-limit 0 --upper-limit 64
graph_category games
maxplayer.label bots
player.label players"
}
#################################################################
# Quake Stat, call qstat #
#---------------------------------------------------------------#
quake_stat() {
if [ "${script_name}" != "qstat_" ]; then
gametype=$(echo ${script_name} | cut -d_ -f2)
ip=$(echo ${script_name} | cut -d_ -f3)
port=$(echo ${script_name} | cut -d_ -f4)
else
gametype=$1
ip=$2
port=$3
fi
if [ ! -z ${gametype} ] && [ ! -z ${gametype} ] && [ ! -z ${gametype} ]; then
dummy=$(${qstat_exe} -P -pa -sort P -${gametype} ${ip}:${port} | grep frags | grep -wv 0ms | wc -l)
dummy2=$(${qstat_exe} -P -pa -sort P -${gametype} ${ip}:${port} | grep frags | grep -w 0ms | wc -l)
playervalue=$dummy
maxplayervalue=$dummy2
if [ -z "${playervalue}" ]; then
playervalue=0
fi
if [ -z "${maxplayervalue}" ]; then
maxplayervalue=0
fi
echo "maxplayer.value "${maxplayervalue};
echo "player.value "${playervalue};
else
echo "maxplayer.value U"
echo "player.value U"
fi
}
#################################################################
# Main #
#---------------------------------------------------------------#
case $1 in
config)
config
exit 0
;;
help | ?)
usage
exit 0
;;
autoconf)
echo "no (edit the script for set qstat path)"
;;
*)
quake_stat $1 $2 $3
exit 0
;;
esac

View file

@ -1,106 +0,0 @@
#!/bin/ksh
#################################################################
# Title : Qstat plugin for Munin #
# Author : Benjamin DUPUIS - Poil #
# Email : poil@quake.fr #
# First release : 18/10/2007 #
#---------------------------------------------------------------#
#################################################################
# Variable : #
#---------------------------------------------------------------#
qstat_exe='/usr/bin/qstat'
#---------------------------------------------------------------#
# End of config
script_name=$(basename $0)
#################################################################
#################################################################
# Help #
#---------------------------------------------------------------#
usage() {
echo 'For testing the script, run qstat_ GameType IP Port'
echo ' - GameType : q3s, q4s ... run qstat for seeing available gametype'
echo 'For munin you must ln -s /usr/share/munin/plugins/qstat_ /etc/munin/plugins/qstat_GameType_IP2test_Port'
echo 'Perhaps you must have to set qstat_exe path, actually on'${qstat_exe};
echo 'Have Fun'
}
config() {
if [ "${script_name}" != "qstat_" ]; then
gametype=$(echo ${script_name} | cut -d_ -f2)
ip=$(echo ${script_name} | cut -d_ -f3)
port=$(echo ${script_name} | cut -d_ -f4)
else
gametype=$1
ip=$2
port=$3
fi
echo "graph_title Number of players on ${gametype} - ${ip}:${port}
graph_vlabel players
#graph_args --base 1000 -r --lower-limit 0 --upper-limit 64
graph_category games
maxplayer.label bots
player.label players"
}
#################################################################
# Quake Stat, call qstat #
#---------------------------------------------------------------#
quake_stat() {
if [ "${script_name}" != "qstat_" ]; then
gametype=$(echo ${script_name} | cut -d_ -f2)
ip=$(echo ${script_name} | cut -d_ -f3)
port=$(echo ${script_name} | cut -d_ -f4)
else
gametype=$1
ip=$2
port=$3
fi
if [ ! -z ${gametype} ] && [ ! -z ${gametype} ] && [ ! -z ${gametype} ]; then
dummy=$(${qstat_exe} -P -pa -sort P -${gametype} ${ip}:${port} | grep team | grep -wv 0ms | wc -l)
dummy2=$(${qstat_exe} -P -pa -sort P -${gametype} ${ip}:${port} | grep team | grep -w 0ms | wc -l)
playervalue=$dummy
maxplayervalue=$dummy2
if [ -z "${playervalue}" ]; then
playervalue=0
fi
if [ -z "${maxplayervalue}" ]; then
maxplayervalue=0
fi
echo "maxplayer.value "${maxplayervalue};
echo "player.value "${playervalue};
else
echo "maxplayer.value U"
echo "player.value U"
fi
}
#################################################################
# Main #
#---------------------------------------------------------------#
case $1 in
config)
config
exit 0
;;
help | ?)
usage
exit 0
;;
autoconf)
echo "no (edit the script for set qstat path)"
;;
*)
quake_stat $1 $2 $3
exit 0
;;
esac