diff --git a/bin/rrd-extractstats.pl b/bin/rrd-extractstats.pl index 9a824ab..a729720 100755 --- a/bin/rrd-extractstats.pl +++ b/bin/rrd-extractstats.pl @@ -43,7 +43,7 @@ $|=1; my $i :shared = 0; my $num_workers = 1; -if (($ENV{'THREADS'} =~ /^\d+$/) and ($ENV{'THREADS'} > 0)) { +if (($ENV{'THREADS'}) and ($ENV{'THREADS'} =~ /^\d+$/) and ($ENV{'THREADS'} > 0)) { $num_workers = $ENV{'THREADS'}; } print("Using " . $num_workers . " threads.\n");