mirror of
https://github.com/nikdoof/huawei-hg612-munin.git
synced 2025-12-25 16:49:24 +00:00
Initial Commit
This commit is contained in:
58
plugins/hg612_max_speed
Executable file
58
plugins/hg612_max_speed
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/sh
|
||||
# -*- sh -*-
|
||||
|
||||
statsfile="/etc/munin/huawei/output.txt"
|
||||
|
||||
: << =cut
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Line Stats - Plugin to get Huawei HG612 line stats
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
Fetches attainable line speed vs actual line speed
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Adam Smith
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
GPL
|
||||
|
||||
=head1 MAGIC MARKERS
|
||||
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
=cut
|
||||
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo "graph_title Maximum Attainable Speed"
|
||||
echo 'graph_args --base 1000'
|
||||
echo 'graph_vlabel Max Speed (bps)'
|
||||
echo 'graph_category hg612'
|
||||
echo 'graph_scale yes'
|
||||
echo 'graph_order downstream upstream'
|
||||
echo 'downstream.label Downstream'
|
||||
echo 'downstream.draw AREA'
|
||||
echo 'upstream.label Upstream'
|
||||
echo 'upstream.draw AREA'
|
||||
exit 0
|
||||
fi;
|
||||
|
||||
echo -n "downstream.value "
|
||||
echo $(grep Upstream $statsfile | grep Max | head -n 1 | awk '{ print $10 }')000
|
||||
|
||||
echo -n "upstream.value "
|
||||
echo $(grep Upstream $statsfile | grep Max | head -n 1 | awk '{ print $5 }')000
|
||||
|
||||
exit 0
|
||||
fi
|
||||
Reference in New Issue
Block a user