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 $temp_disk_list = "/tmp/smart.drivedb.list";
|
||||
my @disks = ();
|
||||
my %olderr = {};
|
||||
|
||||
|
@ -21,9 +22,14 @@ my $CACHEFILE = "$ENV{'XYMONTMP'}/$ENV{'MACHINEDOTS'}.smart.cache";
|
|||
|
||||
&load_config("$ENV{'XYMONTMP'}/logfetch.$ENV{'MACHINEDOTS'}.cfg");
|
||||
|
||||
if (-e $temp_disk_list) {
|
||||
# Should use the existing file
|
||||
}
|
||||
else {
|
||||
# Create a file with the list of disks
|
||||
system("ls -1 /dev/sd* > /tmp/smart.drivedb.list") == 0
|
||||
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
|
||||
unless (@disks) {
|
||||
|
|
Loading…
Reference in New Issue