root / plugins / dvb / 2wcomdsr_ @ 81db94e2
Historique | Voir | Annoter | Télécharger (7,29 ko)
| 1 |
#!/bin/sh |
|---|---|
| 2 |
|
| 3 |
################################################################################################### |
| 4 |
# |
| 5 |
# Multigraph munin plugin to monitor 2wcom DSR01/DSR02 Professional Audio Satellite-Receivers |
| 6 |
# through their web interface status page. |
| 7 |
# |
| 8 |
# To use this plugin, copy it to the munin's plugin directory (eg. /usr/share/munin/plugins) |
| 9 |
# under the name "2wcomdsr_". Don't change this filename! Follow these steps: |
| 10 |
# |
| 11 |
# 1. Give names to your receivers, in fqdn style. Like "dvbs.radio1" or "dvbs.radio2". Make sure |
| 12 |
# you can resolve these names as DNS names from the munin machine. You can simply add them |
| 13 |
# as entries in /etc/hosts. |
| 14 |
# |
| 15 |
# 2. Then symlink it to munin's configured plugins directory (eg. /etc/munin/plugins) with names |
| 16 |
# according to the devices you wish to monitor, eg: |
| 17 |
# |
| 18 |
# 2wcomdsr_dvbs.radio1 |
| 19 |
# 2wcomdsr_dvbs.radio2 |
| 20 |
# |
| 21 |
# 3. In /etc/munin/munin.conf just add these lines for them. Yes, 127.0.0.1 is correct |
| 22 |
# because that points to the munin-node address not the UPS address. |
| 23 |
# |
| 24 |
# [2wcomdsr_dvbs.radio1] |
| 25 |
# address 127.0.0.1 |
| 26 |
# |
| 27 |
# [2wcomdsr_dvbs.radio2] |
| 28 |
# address 127.0.0.1 |
| 29 |
# |
| 30 |
# 4. In /etc/munin/plugin-conf.d/munin-node add the web interface login, to be able to read |
| 31 |
# the reveivers status pages (obviously replacing these with your own data): |
| 32 |
# |
| 33 |
# [2wcomdsr_*] |
| 34 |
# env.webuser admin |
| 35 |
# env.webpass admin |
| 36 |
# |
| 37 |
# The above is for all the receivers using the same username and password. If they are different |
| 38 |
# you can add as many entries as you want, by removing the wildcard and giving the entire name. |
| 39 |
# |
| 40 |
# 5. Restart the munin node by 'service munin-node restart'. |
| 41 |
# |
| 42 |
# If all went well, after 5 minutes or so you should have two additional nodes listed |
| 43 |
# on the Web Interface of munin. |
| 44 |
# |
| 45 |
# Tested & working with several 2wcom DSR01 Basic receivers, with Munin v.2.0.14 on Ubuntu LTS 12.04 |
| 46 |
# Created in 2013 by robi |
| 47 |
# v0.2 - added Viterbi/LDPC and RS/BCH BER graphs |
| 48 |
# v0.1 - initial version |
| 49 |
################################################################################################## |
| 50 |
|
| 51 |
case $0 in |
| 52 |
*2wcomdsr_*) |
| 53 |
hostname=${0##*/2wcomdsr_}
|
| 54 |
;; |
| 55 |
esac |
| 56 |
|
| 57 |
case $1 in |
| 58 |
config) |
| 59 |
|
| 60 |
echo "multigraph cpn" |
| 61 |
echo "host_name $hostname" |
| 62 |
echo "graph_args --base 1000" |
| 63 |
echo "graph_title Carrier/Noise Ratio" |
| 64 |
echo "graph_vlabel dB" |
| 65 |
echo "graph_category dvb" |
| 66 |
echo "graph_scale no" |
| 67 |
echo "graph_info Calculated carrier/noise ratio of the signal. To avoid data errors, the decoding of a received signal requires a minimum C/N ratio that depends on the FEC rate." |
| 68 |
echo "cpn.label C/N" |
| 69 |
echo "cpn.critical 10:" |
| 70 |
echo "cpn.info Calculated carrier/noise ratio of the signal." |
| 71 |
echo |
| 72 |
echo "multigraph cfo" |
| 73 |
echo "host_name $hostname" |
| 74 |
echo "graph_args --base 1000" |
| 75 |
echo "graph_title Carrier Frequency Offset" |
| 76 |
echo "graph_vlabel MHz" |
| 77 |
echo "graph_category dvb" |
| 78 |
echo "graph_scale no" |
| 79 |
echo "graph_info Incoming signals from the LNB are subject to frequency tolerances, thus check the 'CFO Error' under menu item 'Status>Tuner'. This value represents the margin by which the entered frequency deviates from the actual frequency. In order to maximize reception quality the CFO error should be minimized." |
| 80 |
echo "cfo.label CFO" |
| 81 |
echo "cfo.critical 250" |
| 82 |
echo "cfo.info Carrier Frequency Offset." |
| 83 |
echo |
| 84 |
echo "multigraph inp" |
| 85 |
echo "host_name $hostname" |
| 86 |
echo "graph_args --base 1000" |
| 87 |
echo "graph_title RF Signal Level" |
| 88 |
echo "graph_vlabel dBm" |
| 89 |
echo "graph_category dvb" |
| 90 |
echo "graph_scale no" |
| 91 |
echo "graph_info Input for the connection of the receiving LNB of the satellite antenna. Admissible RF signal input range is -82 to -10 dBm." |
| 92 |
echo "inp.label RF level" |
| 93 |
echo "inp.critical -65:" |
| 94 |
echo "inp.info Level of the RF signal at the 'RF-In' input." |
| 95 |
echo |
| 96 |
echo "multigraph tnr" |
| 97 |
echo "host_name $hostname" |
| 98 |
echo "graph_args --base 1000" |
| 99 |
echo "graph_title Tuner system Status" |
| 100 |
echo "graph_vlabel 1=OK, 0=BAD" |
| 101 |
echo "graph_category dvb" |
| 102 |
echo "graph_scale no" |
| 103 |
echo "graph_info Tuner system status: 1 = 'OK' or 0 = 'BAD'. It is OK if all the following values are OK: AGC (Automatic Gain Control), CE (Carrier Frequency Offset Estimation), Symbol Timing, Carrier Locked, Viterbi error correction." |
| 104 |
echo "tnr.label Tuner status" |
| 105 |
echo "tnr.critical 1:" |
| 106 |
echo "tnr.info Tuner system status: 1 = 'OK' or 0 = 'BAD'." |
| 107 |
echo |
| 108 |
echo "multigraph led2" |
| 109 |
echo "host_name $hostname" |
| 110 |
echo "graph_args --base 1000" |
| 111 |
echo "graph_title Warning LED" |
| 112 |
echo "graph_vlabel 0=OFF; >0=ON" |
| 113 |
echo "graph_category dvb" |
| 114 |
echo "graph_scale no" |
| 115 |
echo "graph_info Every monitoring function has a checkbox 'warning LED on' to select if the 'Warning' LED on the web interface and the front panel of the device is activated on alarms or not." |
| 116 |
echo "ld2.label Warning" |
| 117 |
echo "ld2.critical 1" |
| 118 |
echo "ld2.info Warning LED: 0 = OFF, greater than 0 = ON." |
| 119 |
echo |
| 120 |
echo "multigraph ber_vt" |
| 121 |
echo "host_name $hostname" |
| 122 |
echo "graph_args --base 1000 --logarithmic" |
| 123 |
echo "graph_title BER Viterbi/LDPC" |
| 124 |
echo "graph_vlabel Bit Error Rate" |
| 125 |
echo "graph_category dvb" |
| 126 |
#echo "graph_scale no" |
| 127 |
echo "graph_info Detected bit error rate (BER) before the Viterbi error correction." |
| 128 |
echo "ber_vt.label Viterbi/LDPC BER" |
| 129 |
echo "ber_vt.critical 0.0002" |
| 130 |
echo "ber_vt.info BER before Viterbi error correction" |
| 131 |
echo |
| 132 |
echo "multigraph ber_rs" |
| 133 |
echo "host_name $hostname" |
| 134 |
echo "graph_args --base 1000 --logarithmic" |
| 135 |
echo "graph_title BER Reed Solomon/BCH" |
| 136 |
echo "graph_vlabel Bit Error Rate" |
| 137 |
echo "graph_category dvb" |
| 138 |
#echo "graph_scale no" |
| 139 |
echo "graph_info Detected bit error rate (BER) before the Reed Solomon error correction." |
| 140 |
echo "ber_rs.label RS/BCH BER" |
| 141 |
echo "ber_rs.critical 0.0002" |
| 142 |
echo "ber_rs.info BER before Reed Solomon error correction" |
| 143 |
echo |
| 144 |
|
| 145 |
exit 0;; |
| 146 |
esac |
| 147 |
|
| 148 |
statusfile=/tmp/2wcomdsr_munin_$hostname.html |
| 149 |
|
| 150 |
wget -O $statusfile --user=$webuser --password=$webpass http://$hostname/stattuner.xml -o /dev/null --timeout 9 |
| 151 |
|
| 152 |
if [ -f "$statusfile" ] |
| 153 |
then |
| 154 |
cpn=`grep 'content_1<' $statusfile | sed 's/<[^>]*>//g' | sed 's/content_1//g;s/dB//g;s/ //g'` |
| 155 |
cfo=`grep 'content_2<' $statusfile | sed 's/<[^>]*>//g' | sed 's/content_2//g;s/MHz//g;s/ //g'` |
| 156 |
inp=`grep 'content_3<' $statusfile | sed 's/<[^>]*>//g' | sed 's/content_3//g;s/dBm//g;s/ //g'` |
| 157 |
tnr=`grep 'content_10<' $statusfile | sed 's/<[^>]*>//g' | sed 's/content_10//g;s/ //g'` |
| 158 |
ld2=`grep 'led_2<' $statusfile | sed 's/<[^>]*>//g' | sed 's/led_2//g;s/ //g'` |
| 159 |
bev=`grep 'content_12<' $statusfile | sed 's/<[^>]*>//g' | sed 's/content_12//g;s/ //g'` |
| 160 |
bes=`grep 'content_13<' $statusfile | sed 's/<[^>]*>//g' | sed 's/content_13//g;s/ //g'` |
| 161 |
|
| 162 |
rm -f $statusfile |
| 163 |
fi |
| 164 |
|
| 165 |
echo "multigraph cpn" |
| 166 |
echo -n "cpn.value " |
| 167 |
if [ -n "$cpn" ]; then |
| 168 |
echo "$cpn" |
| 169 |
else |
| 170 |
echo "U" |
| 171 |
fi |
| 172 |
echo |
| 173 |
|
| 174 |
|
| 175 |
echo "multigraph cfo" |
| 176 |
echo -n "cfo.value " |
| 177 |
if [ -n "$cfo" ]; then |
| 178 |
echo "$cfo" |
| 179 |
else |
| 180 |
echo "U" |
| 181 |
fi |
| 182 |
echo |
| 183 |
|
| 184 |
|
| 185 |
echo "multigraph inp" |
| 186 |
echo -n "inp.value " |
| 187 |
if [ -n "$inp" ]; then |
| 188 |
echo "$inp" |
| 189 |
else |
| 190 |
echo "U" |
| 191 |
fi |
| 192 |
echo |
| 193 |
|
| 194 |
|
| 195 |
echo "multigraph tnr" |
| 196 |
echo -n "tnr.value " |
| 197 |
if [ -n "$tnr" ]; then |
| 198 |
case "$tnr" in |
| 199 |
"OK" ) echo "1";; |
| 200 |
"BAD" ) echo "0";; |
| 201 |
esac |
| 202 |
else |
| 203 |
echo "U" |
| 204 |
fi |
| 205 |
echo |
| 206 |
|
| 207 |
|
| 208 |
echo "multigraph led2" |
| 209 |
echo -n "ld2.value " |
| 210 |
if [ -n "$ld2" ]; then |
| 211 |
echo "$ld2" |
| 212 |
else |
| 213 |
echo "U" |
| 214 |
fi |
| 215 |
echo |
| 216 |
|
| 217 |
echo "multigraph ber_vt" |
| 218 |
echo -n "ber_vt.value " |
| 219 |
if [ -n "$bev" ]; then |
| 220 |
case "$bev" in |
| 221 |
"--" ) echo "U";; |
| 222 |
* ) printf %.8f $bev && echo;; |
| 223 |
esac |
| 224 |
else |
| 225 |
echo "U" |
| 226 |
fi |
| 227 |
echo |
| 228 |
|
| 229 |
echo "multigraph ber_rs" |
| 230 |
echo -n "ber_rs.value " |
| 231 |
if [ -n "$bes" ]; then |
| 232 |
case "$bes" in |
| 233 |
"--" ) echo "U";; |
| 234 |
* ) printf %.8f $bes && echo;; |
| 235 |
esac |
| 236 |
else |
| 237 |
echo "U" |
| 238 |
fi |
| 239 |
echo |
| 240 |
|
