mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-28 11:54:52 +00:00
Extract tarballs committed to git as plugins.
This commit is contained in:
parent
2dad4c6f70
commit
038c3ce96b
15 changed files with 352 additions and 0 deletions
50
plugins/beboxsync/beboxsync
Executable file
50
plugins/beboxsync/beboxsync
Executable 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 = "/home/alex/bin/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 other
|
||||
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[11]\n";
|
||||
print "syncupstream.value $insplitted[15]\n";
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue