Fix a typo in disco_block_device so that removable devices are excluded

tags/zabbix-agent-addons-0.2.20-1
Daniel Berteaud 12 years ago
parent e85d56f105
commit f88be7264b
  1. 14
      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 "", <REMOUVABLE>;
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 "", <REMOVABLE>;
close REMOVABLE;
chomp($removable);
next if ($removable eq '1');
}
my $dev = '/dev/' . $block;
push @{$json->{data}}, { "{#BLOCKDEVICE}" => $dev };

Loading…
Cancel
Save