summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-01-10 22:13:51 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-10 22:13:51 +0100
commit218f9d3399a49a52df8f371713b13180494c107b (patch)
treed843c3b87f90c6288aba23f87ea0d9aaa36d9c5b
parent824e8aee6addbd53d0ccb41515d936b475e955ce (diff)
downloadnet_if-218f9d3399a49a52df8f371713b13180494c107b.tar.gz
net_if-218f9d3399a49a52df8f371713b13180494c107b.tar.bz2
net_if-218f9d3399a49a52df8f371713b13180494c107b.zip
add some comments
-rwxr-xr-xnet_if11
1 files changed, 11 insertions, 0 deletions
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);