summaryrefslogtreecommitdiffstats
path: root/net_if
diff options
context:
space:
mode:
Diffstat (limited to 'net_if')
-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);