diff --git a/plugins/other/femon b/plugins/other/femon index 7b3bb20b..bcdec56a 100755 --- a/plugins/other/femon +++ b/plugins/other/femon @@ -18,6 +18,7 @@ # Author: Nicolas Knotzer # # v1.0 02/10/2011 +# v1.1 20/10/2011 - Prints OSError.strerror in verbose mode, uses rsplit instead of split for parsing femon output # # Copyright (c) 2011 Nicolas Knotzer. # @@ -48,7 +49,7 @@ statefiledir='/var/lib/munin/plugin-state' import os, sys, string, subprocess from math import log -plugin_version="1.0" +plugin_version="1.1" def verboselog(s): global plugin_name @@ -116,10 +117,11 @@ def print_dvb_adapter_values(dvb_adapter) : verboselog('Reading values from '+dvb_adapter[0]) femon_output=subprocess.check_output([os.getenv('femonpath','/usr/bin/femon'), '-H', '-c 1', '-a '+dvb_adapter[0].replace('adapter','')]) verboselog(femon_output) - except : + except OSError, e: verboselog('Cannot access femon values! Check user rights or proper femon installation.') + verboselog('Error: '+e.strerror) sys.exit(1) - splitstr=femon_output.split ('|') + splitstr=femon_output.rsplit ('|',5) print ('str.value '+splitstr[1].replace('signal','').strip(' %')) print ('snr.value '+splitstr[2].replace('snr','').strip(' %')) print ('ber.value '+splitstr[3].replace('ber','').strip(' ')) @@ -257,7 +259,7 @@ B use this to build the service links for this wildcard-pl =head1 VERSION -Version 1.0 +Version 1.1 =head1 BUGS