2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/other/dvb-signal
2011-12-18 15:10:19 +01:00

59 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
#
# Reads the signal strength from a DVB-c/s/t tuner
#
# (c) 2009 i.dobson@planet-ian.com
#
# Magic markers (optional):
#%# family=auto
#%# capabilities=autoconf suggest
#Change this value to point to the tuner you want to watch
Tuner=1
case $1 in
autoconf|detect)
if [ -e /dev/dvb/adapter$Tuner/ ] ; then
echo yes
exit 0
else
echo "no (dvb tuner $Tuner not found)"
exit 1
fi;;
config)
echo 'graph_title DVB signal strength '
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel Signal Strength % / Errors in 000s'
echo 'graph_category mythtv'
echo 'graph_scale no'
echo "signal.label Signal strength"
echo "signal.draw LINE1"
echo "signal.min 0"
echo "snr.label Signal to noise"
echo "snr.draw LINE1"
echo "snr.min 0"
echo "ber.label Bit error rate (in millions)"
echo "ber.draw LINE1"
echo "ber.min 0"
echo "unc.label Uncorrectable errors (in thousands)"
echo "unc.draw LINE1"
echo "unc.min 0"
exit 0;;
esac
if [ -e /dev/dvb/adapter$Tuner/ ] ; then
check=`femon -H -c 1 -a $Tuner | grep signal `
echo $check | awk '{printf "signal.value %.0f\nsnr.value %.0f\nber.value %.2f\nunc.value %.2f\n\n",$5,$8,$11/1000,$14/1000000}'
else
echo "snr.value 0"
echo "unc.value 0"
echo "ber.value 0"
echo "signal.value 0"
fi
exit 0