From 218f9d3399a49a52df8f371713b13180494c107b Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 10 Jan 2013 22:13:51 +0100 Subject: add some comments --- net_if | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/net_if b/net_if index 8dee003..4b392b9 100755 --- a/net_if +++ b/net_if @@ -26,6 +26,12 @@ sub msg ($@) { exit $exit; } +# Check the status of the given network interface and return +# three lists the interfaces sorted by status (up, down, error). +# This resolves interfaces groups, but only return the interfaces +# that are up. +# +# parameter: list of interfaces sub get_if_status (@) { my (@up, @down, @error); @@ -60,6 +66,9 @@ sub get_if_status (@) { return (\@up, \@down, \@error); } +# Get the byte conters for incomming and outgoing packages. +# +# parameter: interface name sub get_if_stats ($) { my $if = shift; my $stats = {}; @@ -84,6 +93,8 @@ sub get_if_stats ($) { return $stats; } +# Print nagios compatible message containing the number of interfaces +# and performance data containing the byte counter for the interfaces. sub print_stats ($) { my $stats = shift; my ($count, $perfdata); -- cgit v1.2.3-1-g7c22