From beadda263421eed522cc4e6010abe3ce080372c1 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 17 Apr 2013 16:52:38 +0200 Subject: [PATCH] Fix network interface discovery script --- zabbix_scripts/disco_net_interface | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/zabbix_scripts/disco_net_interface b/zabbix_scripts/disco_net_interface index d73b58d..458767d 100644 --- a/zabbix_scripts/disco_net_interface +++ b/zabbix_scripts/disco_net_interface @@ -7,13 +7,8 @@ my @nics = grep { $_ !~ m/^\./ } readdir($dh); closedir($dh); my $json; foreach my $nic (@nics){ - # Untaint $nic and makes sure the name looks OK - next unless ($nic =~ m/^(\w+[\.:]?\d+)$/); + next unless ($nic =~ m/^(\w+[\.:]?(\d+)?)$/); $nic = $1; - next if ( - # skip non links - !-l "/sys/class/net/$nic" - ); push @{$json->{data}}, { "{#IFNAME}" => $nic}; } print to_json($json) if (defined $json->{data});