2014-10-04 20:01:25 +02:00
|
|
|
#!/bin/bash
|
2009-02-10 01:24:14 +01:00
|
|
|
#
|
|
|
|
# A Munin Plugin to show umts signal strength using gcom
|
|
|
|
# Created by Derik Vercueil <jfvercueil@yahoo.co.uk>
|
|
|
|
# Based on a work of "auth"
|
|
|
|
#
|
|
|
|
# Parameters understood:
|
|
|
|
#
|
|
|
|
# config (required)
|
|
|
|
# autoconf (optional - used by munin-config)
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Magic markers (optional - used by munin-config and installation
|
|
|
|
# scripts):
|
|
|
|
#
|
|
|
|
#%# family=auto
|
|
|
|
#%# capabilities=autoconf
|
|
|
|
|
|
|
|
|
|
|
|
#############################
|
|
|
|
# Configuration
|
|
|
|
#############################
|
|
|
|
MAXLABEL=20
|
|
|
|
EXPR_BIN=/usr/bin/expr
|
|
|
|
#############################
|
|
|
|
|
|
|
|
if [ "$1" = "autoconf" ]; then
|
|
|
|
echo yes
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "config" ]; then
|
|
|
|
|
|
|
|
echo 'graph_title UMTS Signal Strength'
|
|
|
|
echo 'graph_args --base 1000 -l 0'
|
|
|
|
echo 'graph_vlabel Signal Strength'
|
|
|
|
echo 'graph_category network'
|
|
|
|
echo 'signal_strength.label Signal Strength'
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
#############################
|
|
|
|
# Illegal User
|
|
|
|
#############################
|
|
|
|
VAL=`gcom -d /dev/ttyUSB2 sig | sed 's/[Signal Quality: ]//g' | sed 's/,/./g'`
|
|
|
|
echo -en "signal_strength.value $VAL"
|
|
|
|
echo -n
|