1#!/usr/local/bin/bash
2#
3# A Munin Plugin to show umts signal strength using gcom
4# Created by Derik Vercueil <jfvercueil@yahoo.co.uk>
5# Based on a work of "auth"
6#
7# Parameters understood:
8#
9# 	config   (required)
10# 	autoconf (optional - used by munin-config)
11#
12#
13# Magic markers (optional - used by munin-config and installation
14# scripts):
15#
16#%# family=auto
17#%# capabilities=autoconf
18
19
20#############################
21# Configuration
22#############################
23MAXLABEL=20
24EXPR_BIN=/usr/bin/expr
25#############################
26
27if [ "$1" = "autoconf" ]; then
28	echo yes
29	exit 0
30fi
31
32if [ "$1" = "config" ]; then
33
34	echo 'graph_title UMTS Signal Strength'
35	echo 'graph_args --base 1000 -l 0'
36	echo 'graph_vlabel Signal Strength'
37	echo 'graph_category network'
38	echo 'signal_strength.label Signal Strength'
39	exit 0
40fi
41#############################
42# Illegal User
43#############################
44VAL=`gcom -d /dev/ttyUSB2 sig | sed 's/[Signal Quality: ]//g' | sed 's/,/./g'`
45echo -en "signal_strength.value $VAL"
46echo -n
47