diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-10 22:13:51 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-10 22:13:51 +0100 |
commit | 218f9d3399a49a52df8f371713b13180494c107b (patch) | |
tree | d843c3b87f90c6288aba23f87ea0d9aaa36d9c5b | |
parent | 824e8aee6addbd53d0ccb41515d936b475e955ce (diff) | |
download | net_if-218f9d3399a49a52df8f371713b13180494c107b.tar.gz net_if-218f9d3399a49a52df8f371713b13180494c107b.tar.bz2 net_if-218f9d3399a49a52df8f371713b13180494c107b.zip |
add some comments
-rwxr-xr-x | net_if | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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); |