diff --git a/check_files.pl b/check_files.pl index ce559be..d3d35b2 100755 --- a/check_files.pl +++ b/check_files.pl @@ -502,7 +502,7 @@ sub check_options { if (defined($o_age)) { my @agetemp = split(',',$o_age); - $o_age_warn = parse_threshold($agetemp[0]) if defined($agetemp[0]) && $agetemp[0] ne ''; + $o_age_warn = parse_threshold($agetemp[0]) if defined($agetemp[0]) && $agetemp[0] ne '' && $agetemp[0] ne '~'; $o_age_crit = parse_threshold($agetemp[1]) if defined($agetemp[1]) && $agetemp[1] ne ''; } @@ -844,7 +844,7 @@ sub open_shell_stream { $statuscode = "CRITICAL"; $statusinfo .= "," if $statusinfo; $statusinfo .= $chk; - } elsif ($chk = check_threshold($o_filesLv[$i],$nmatches[$i],$o_warnL[$i])) { + } elsif ($o_warnLv[$i] ne '~' && ($chk = check_threshold($o_filesLv[$i],$nmatches[$i],$o_warnL[$i]))) { $statuscode="WARNING" if $statuscode eq "OK"; $statusinfo .= "," if $statusinfo; $statusinfo .= $chk; @@ -854,14 +854,14 @@ sub open_shell_stream { } $perfdata .= " ". perf_name($o_filesLv[$i]) ."=". $nmatches[$i] if defined($o_perf); - if (defined($o_perf) && defined($o_warnL[$i][5]) && defined($o_critL[$i][5])) { + if (defined($o_perf) && (defined($o_warnL[$i][5]) || defined($o_critL[$i][5]))) { $perfdata .= ';' if $o_warnL[$i][5] ne '' || $o_critL[$i][5] ne ''; $perfdata .= $o_warnL[$i][5] if $o_warnL[$i][5] ne ''; $perfdata .= ';'.$o_critL[$i][5] if $o_critL[$i][5] ne ''; } } -# perffata for age +# perfdata for age if (defined($o_perf) && defined($o_age)) { $oldest_secold=0 if !defined($oldest_secold); $newest_secold=0 if !defined($newest_secold); @@ -872,7 +872,7 @@ sub open_shell_stream { $perfdata .= " age_newest=".$newest_secold."s"; } -# perffata for size +# perfdata for size if (defined($o_perf) && defined($o_size)) { $largest_filesize=0 if !defined($largest_filesize); $smallest_filesize=0 if !defined($smallest_filesize); @@ -883,7 +883,7 @@ sub open_shell_stream { $perfdata .= " size_smallest=".$smallest_filesize."o"; } -# perffata for sum of file sizes +# perfdata for sum of file sizes if (defined($o_perf) && defined($o_sumsize)) { $perfdata .= " size_sum=".$sum_filesize."o"; $perfdata .= ';' if (defined($o_sumsize_warn) && $$o_sumsize_warn[5] ne '') || (defined($o_sumsize_crit) && $$o_sumsize_crit[5] ne '');