Skip to content

Commit

Permalink
BP: add perfdata for equals function
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Nov 8, 2024
1 parent 24e3a58 commit ed6d16a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ sub equals {
if($number !~ m/^\-?(\d+|\d+\.\d+)%?$/mx) {
return(3, 'threshold must be numeric');
}
my $desc = '= '.$number;
$number = _expand_percent($number, $total);
if($good == 0 and $bad == 0) {
return(3, 'no dependent nodes');
Expand All @@ -379,7 +380,8 @@ sub equals {
if($good == $number) {
$state = 0;
}
return($state, '= '.$number, Thruk::Utils::Filter::state2text($state).' - '.$good.'/'.($good+$bad).' nodes are available');
my $perfdata = sprintf('good=%d;%f;%f;0;%d', $good, $number, $number, $total);
return($state, $desc, Thruk::Utils::Filter::state2text($state).' - '.$good.'/'.($good+$bad).' nodes are available|'.$perfdata);
}

##########################################################
Expand Down

0 comments on commit ed6d16a

Please sign in to comment.