From f88be7264b24485093dfc876f9d9fcb2fad29c68 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 16 Apr 2013 13:23:26 +0200 Subject: [PATCH] Fix a typo in disco_block_device so that removable devices are excluded --- zabbix_scripts/disco_block_devices | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zabbix_scripts/disco_block_devices b/zabbix_scripts/disco_block_devices index 857a029..b75ba2f 100644 --- a/zabbix_scripts/disco_block_devices +++ b/zabbix_scripts/disco_block_devices @@ -7,13 +7,13 @@ my @blocks = grep { $_ !~ m/^\./ } readdir($dh); closedir($dh); my $json; foreach my $block (@blocks){ - my $remouvable = 0; - if ( -e "/sys/block/$block/remouvable"){ - open REMOUVABLE, "/sys/block/$block/remouvable"; - $remouvable = join "", ; - close REMOUVABLE; - chomp($remouvable); - next if ($remouvable eq '1'); + my $removable = 0; + if ( -e "/sys/block/$block/removable"){ + open REMOVABLE, "/sys/block/$block/removable"; + $removable = join "", ; + close REMOVABLE; + chomp($removable); + next if ($removable eq '1'); } my $dev = '/dev/' . $block; push @{$json->{data}}, { "{#BLOCKDEVICE}" => $dev };