Store files to Xymon's tmp dir (with var XYMONTMP)

This commit is contained in:
Jeremy Gardais 2020-02-28 14:30:44 +01:00
parent e55b2d990f
commit 4d90168df5
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@ use Data::Dumper;
my $bb = new Hobbit('smart');
my $temp_disk_list = "/tmp/smart.drivedb.list";
my $temp_disk_list = "$ENV{'XYMONTMP'}/$ENV{'MACHINEDOTS'}.smart.drivedb.list";
my @disks = ();
my %olderr = {};
@ -36,8 +36,8 @@ if (-e $temp_disk_list) {
}
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: $?";
system("ls -1 /dev/sd* | grep -vE '[0-9]' > $temp_disk_list") == 0
or die "system command to create $temp_disk_list failed: $?";
}
# fallback to disk detection if nothing defined in the config