diff --git a/xymon/plugins/client/ext/smart b/xymon/plugins/client/ext/smart index dcb3411..b26421b 100755 --- a/xymon/plugins/client/ext/smart +++ b/xymon/plugins/client/ext/smart @@ -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"); -# Create a file with the list of disks -system("ls -1 /dev/sd* > /tmp/smart.drivedb.list") == 0 - or die "system command to create smart.drivedb.list failed: $?"; +if (-e $temp_disk_list) { + # Should use the existing file +} +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 unless (@disks) {