1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Plugin-Gallery: Better 2nd level headings

This commit is contained in:
dipohl 2017-02-24 05:01:30 +01:00
parent 349edaf819
commit 6ffdebec0d
17 changed files with 9 additions and 9 deletions

62
plugins/router/beboxstats Executable file
View file

@ -0,0 +1,62 @@
#!/usr/bin/perl -w
use strict;
my ($Args) = @ARGV;
my $expecter = "/path/to/beboxstats.expect";
if ($Args) {
# work out line to grab
if ($Args eq 'autoconf') {
# Check the expect script that polls the router exists
unless ( -e $expecter ) {
print "no (Can't find expect script. Check value of \$expecter: $expecter)\n";
} else {
print "yes\n";
}
} elsif ($Args eq 'config') { # print out plugin parameters
printf("
graph_title bebox line stats
graph_vlabel deciBels
graph_category network
graph_info This graph shows the various line parameters
attenuationdownstream.label Downstream Attenuation
attenuationupstream.label Upstream Attenuation
margindownstream.label Downstream Noise Margin
marginupstream.label Upstream Noise Margin
outputpowerdownstream.label Downstream Output Power
outputpowerupstream.label Upstream Output Power
margindownstream.type GAUGE
outputpowerupstream.type GAUGE
attenuationdownstream.type GAUGE
marginupstream.type GAUGE
outputpowerdownstream.type GAUGE
attenuationupstream.type GAUGE
");
# .label is the Key on the graph
} else {
printf("Usage: $0
No arguments: print line stats
autoconf: print 'yes'
config: print config info for Munin\n");
}
} else {
# if no arguments, just fetch the data and print it out
my @insplitted = split(' ', `$expecter | grep dB`);
print "margindownstream.value $insplitted[3]\n";
print "marginupstream.value $insplitted[4]\n";
print "attenuationdownstream.value $insplitted[8]\n";
print "attenuationupstream.value $insplitted[9]\n";
print "outputpowerdownstream.value $insplitted[13]\n";
print "outputpowerupstream.value $insplitted[14]\n";
}

View file

@ -0,0 +1,25 @@
#!/usr/bin/expect -f
# script to log on to a BeBox router [ST Speedtouch 780] and gather line stats
# set timeout for response from router to 30 seconds
set timeout 30
set router "host.or.ip.of.router"
set port "23"
set username "Administrator"
set password "routerpassword"
# telnet to $router on $port
spawn telnet $router $port
expect "Username :"
send "$username\r"
expect "Password :"
send "$password\r"
expect "}=>"
send "adsl info expand=enabled\r"
expect "}=>"
send "exit\r"

50
plugins/router/beboxsync Executable file
View file

@ -0,0 +1,50 @@
#!/usr/bin/perl -w
# (C) Alex Dekker <me@ale.cx>
# License is GPL
use strict;
my ($Args) = @ARGV;
my $expecter = "/path/to/beboxstats.expect";
if ($Args) {
# work out line to grab
if ($Args eq 'autoconf') {
# Check the expect script that polls the router exists
unless ( -e $expecter ) {
print "no (Can't find expect script. Check value of \$expecter: $expecter)\n";
} else {
print "yes\n";
}
} elsif ($Args eq 'config') { # print out plugin parameters
printf("
graph_title bebox sync stats
graph_vlabel ATM kbps
graph_category network
graph_info This graph shows line sync speed
syncdownstream.label Downstream Sync Speed
syncupstream.label Upstream Sync Speed
syncdownstream.type GAUGE
syncupstream.type GAUGE
");
# .label is the Key on the graph
} else {
printf("Usage: $0
No arguments: print line stats
autoconf: print 'yes'
config: print config info for Munin\n");
}
} else {
# if no arguments, just fetch the data and print it out
my @insplitted = split(' ', `$expecter | grep stream`);
print "syncdownstream.value $insplitted[3]\n";
print "syncupstream.value $insplitted[7]\n";
}

56
plugins/router/speedport_300 Executable file
View file

@ -0,0 +1,56 @@
#!/bin/bash
#
#
# Munin plugin to show the up- / download stream of the actual
# internet connection by reading the top_status.htm from the
# Speedport 300
#
#
# Don't forget zu fill in the following lines into the munin-node
# - ormally at /etc/muni/plugin-conf.d/ - an than restart munin
#
# [speedport_300]
# user root
# Jo Hartmann (Version 08.0912)
# Personal config Section Begin ##
router="192.168.0.111"
# Personal config section End ####
# Standard Config Section Begin ##
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title DSL Up- / Downstream'
echo 'graph_args --base 1000 -l 0'
echo 'graph_scale no'
echo 'graph_vlabel Up- / Downstream in kBit/s'
echo 'graph_category network'
echo 'download.label Downstream'
echo 'upload.label Upstream'
echo 'graph_info Information from the top_status.htm of the Speedport 300'
exit 0
fi
# Standard Config Section End ####
# Measure Section Begin ##########
up_down=($(wget -q -O - $router/top_status.htm | grep "+'kBit" | awk -F"(" '{print $2}'))
down=${up_down[0]%+*}
up=${up_down[1]%+*}
if [ "$down" = "" ]; then
echo download.value 0
else
echo download.value ${up_down[0]%+*}
fi
if [ "$up" = "" ]; then
echo upload.value 0
else
echo upload.value ${up_down[1]%+*}
fi
# Measure Section End ############