Do not skip 'removable' devices in disco_block_device, some real disks show a removable flag

tags/zabbix-agent-addons-0.2.20-1
Daniel Berteaud 11 years ago
parent e4489a71fb
commit 1e991ce9e2
  1. 8
      zabbix_scripts/disco_block_devices

@ -8,15 +8,7 @@ closedir($dh);
my $json;
@{$json->{data}} = ();
foreach my $block (@blocks){
my $removable = 0;
my $size = 1;
if ( -e "/sys/block/$block/removable"){
open REMOVABLE, "/sys/block/$block/removable";
$removable = join "", <REMOVABLE>;
close REMOVABLE;
chomp($removable);
next if ($removable eq '1');
}
if ( -e "/sys/block/$block/size"){
open SIZE, "/sys/block/$block/size";
$size = join "", <SIZE>;

Loading…
Cancel
Save