mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Add autoconf support
This commit is contained in:
parent
98afc91e34
commit
ab215a5436
1 changed files with 19 additions and 4 deletions
|
@ -3,13 +3,18 @@
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
modem-nvg510 - Plugin to monitor Motorola/Arris NVG510 DSL modem stats
|
modem-nvg510 - Plugin to monitor Motorola/Arris NVG510 DSL modem stats (AT&T ADSL2+)
|
||||||
|
|
||||||
=head1 CONFIGURATION
|
=head1 CONFIGURATION
|
||||||
|
|
||||||
[modem-nvg510]
|
[modem-nvg510]
|
||||||
env.url http://192.168.1.254/cgi-bin/dslstatistics.ha
|
env.url http://192.168.1.254/cgi-bin/dslstatistics.ha
|
||||||
|
|
||||||
|
=head1 MAGIC MARKERS
|
||||||
|
|
||||||
|
#%# family=auto
|
||||||
|
#%# capabilities=autoconf
|
||||||
|
|
||||||
=head1 AUTHOR
|
=head1 AUTHOR
|
||||||
|
|
||||||
Samuel Smith <esaym (snail) cpan.org>
|
Samuel Smith <esaym (snail) cpan.org>
|
||||||
|
@ -43,9 +48,19 @@ use constant {
|
||||||
crc_up => 29,
|
crc_up => 29,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
if(defined $ARGV[0] and $ARGV[0] eq 'autoconf'){
|
if(defined $ARGV[0] and $ARGV[0] eq 'autoconf'){
|
||||||
print "yes\n";
|
my $url = $ENV{url} || "http://192.168.1.254/cgi-bin/dslstatistics.ha";
|
||||||
exit;
|
my $html = HTTP::Tiny->new(timeout => 1 )->get($url);
|
||||||
|
|
||||||
|
if($html->{success} && $html->{content} =~ m{Broadband Status}){
|
||||||
|
print "yes\n";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
print "no\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
exit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(defined $ARGV[0] and $ARGV[0] eq "config"){
|
if(defined $ARGV[0] and $ARGV[0] eq "config"){
|
||||||
|
@ -135,7 +150,7 @@ lof_up.type DERIVE
|
||||||
lof_up.min 0
|
lof_up.min 0
|
||||||
|;
|
|;
|
||||||
|
|
||||||
exit;
|
exit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue