Enable internal logic for streamcounting

This commit is contained in:
vvitkov 2018-10-31 16:27:11 +02:00
parent ecad87d725
commit 7f57130a0c
2 changed files with 6 additions and 4 deletions

View File

@ -1,2 +1,4 @@
# config file for count-streams.sh # config file for count-streams.sh
STREAMERS=http://stream.openfest.org/stats STREAMERS=http://stream.openfest.org/stats
WARNLEVEL=3
CRITLEVEL=6

View File

@ -8,17 +8,17 @@ if [ -e $MK_CONFDIR/count-streams.cfg ] ; then
. $MK_CONFDIR/count-streams.cfg . $MK_CONFDIR/count-streams.cfg
fi fi
echo "<<<mrpe>>>"
if [ ! -r $MK_CONFDIR/count-streams.xsl ] ; then if [ ! -r $MK_CONFDIR/count-streams.xsl ] ; then
_res=3 _res=3
_data="UNKNOWN: Stylesheet not found" _data="UNKNOWN: Stylesheet not found"
fi fi
echo "<<<stream_count>>>"
for STREAMER in ${STREAMERS} ; do for STREAMER in ${STREAMERS} ; do
stream_count=`curl -sfq -m1 ${STREAMER} | xsltproc $MK_CONFDIR/count-streams.xsl -` stream_count=`curl -sfq -m1 ${STREAMER} | xsltproc $MK_CONFDIR/count-streams.xsl -`
_warn=${1:-3} _warn=${WARNLEVEL:-3}
_crit=${2:-6} _crit=${CRITLEVEL:-6}
if [ $stream_count -ge $_crit ] ; then if [ $stream_count -ge $_crit ] ; then
_data="OK - stream count $stream_count" _data="OK - stream count $stream_count"