#!/usr/bin/env perl # # Munin plugin for monitoring - Bandwidth Livebox # # Written by Maxence Bitterli # # antispam@dga-studio.org - http://www.websweet.fr # # First release (v0.1) 2009-05-15 # Last release (v0.1) 2009-05-15 # if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { print "graph_title Reseau Jarvis\n"; print "graph_vlabel Trafic en MegaOctet depuis le dernier reboot\n"; print "graph_category Livebox\n"; print "download.label Reçu\n"; print "upload.label Emis\n"; print "graph_args --base 1000\n"; } else { $cmd = `perl /home/scripts/adsl_livebox_traffic.pl`; #Valeur Upload $lenUpload = length($cmd); $posDebutUpload = index($cmd, 'RX bytes'); $vUpload = substr($cmd, $posDebutUpload+9, $lenUpload); $posFinUpload = index($vUpload, ' '); $vUpload = substr($cmd, $posDebutUpload+9, $posFinUpload); print "upload.value ".$vUpload ."\n"; #Valeur Download $lenDownload = length($cmd); $posDebutDownload = index($cmd, 'TX bytes'); $vDownload = substr($cmd, $posDebutDownload+9, $lenDownload); $posFinDownload = index($vDownload, ' '); $vDownload = substr($cmd, $posDebutDownload+9, $posFinDownload); print "download.value ".$vDownload ."\n"; }