Create a file with the list of disks to test
This commit is contained in:
parent
c954b608b6
commit
ddd9191af9
|
@ -13,6 +13,7 @@ use Data::Dumper;
|
||||||
|
|
||||||
my $bb = new Hobbit('smart');
|
my $bb = new Hobbit('smart');
|
||||||
|
|
||||||
|
my $temp_disk_list = "/tmp/smart.drivedb.list";
|
||||||
my @disks = ();
|
my @disks = ();
|
||||||
my %olderr = {};
|
my %olderr = {};
|
||||||
|
|
||||||
|
@ -21,9 +22,14 @@ my $CACHEFILE = "$ENV{'XYMONTMP'}/$ENV{'MACHINEDOTS'}.smart.cache";
|
||||||
|
|
||||||
&load_config("$ENV{'XYMONTMP'}/logfetch.$ENV{'MACHINEDOTS'}.cfg");
|
&load_config("$ENV{'XYMONTMP'}/logfetch.$ENV{'MACHINEDOTS'}.cfg");
|
||||||
|
|
||||||
# Create a file with the list of disks
|
if (-e $temp_disk_list) {
|
||||||
system("ls -1 /dev/sd* > /tmp/smart.drivedb.list") == 0
|
# Should use the existing file
|
||||||
or die "system command to create smart.drivedb.list failed: $?";
|
}
|
||||||
|
else {
|
||||||
|
# Create a file with the list of disks
|
||||||
|
system("ls -1 /dev/sd* | grep -vE '[0-9]' > /tmp/smart.drivedb.list") == 0
|
||||||
|
or die "system command to create smart.drivedb.list failed: $?";
|
||||||
|
}
|
||||||
|
|
||||||
# fallback to disk detection if nothing defined in the config
|
# fallback to disk detection if nothing defined in the config
|
||||||
unless (@disks) {
|
unless (@disks) {
|
||||||
|
|
Loading…
Reference in New Issue