From 65acfdc8b408dad17779fc686b14b3532e55476c Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 11 Jan 2013 04:00:32 +0100 Subject: capture all interfaces (not only up interfaces) To support nagiosgrapher each time the performance data for all interfaces should be emited (even if they are down). So capture all existing interfaces that are specified on the command line or that are part of an interface group. --- net_if | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/net_if b/net_if index f2f1d31..265ad80 100755 --- a/net_if +++ b/net_if @@ -28,14 +28,14 @@ sub msg ($@) { } # 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. +# three lists of the interfaces sorted by status (all, down, error). +# This does resolves interfaces groups automaticaly and returns +# the member interfaces. # # parameter: # list of interfaces sub get_if_status (@) { - my (@up, @down, @error); + my (@all, @down, @error); while (@_) { # untaint interface name @@ -59,19 +59,15 @@ sub get_if_status (@) { while () { # parse ifconfig output: if ($_ =~ m/^([-a-v0-9]+): flags=([0-9]+){$if} = get_if_stats($if); } -- cgit v1.2.3-1-g7c22