Skip to content

Commit

Permalink
check_openrc.pl: add performance data
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Fischl <[email protected]>
  • Loading branch information
antonfischl1980 committed May 11, 2022
1 parent efa870a commit 29fb46b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion check_openrc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ END
my $code = OK;
my $message = "";
my $extmessage = "Running services: " . join(', ', @started);
my $perfdata="|count_started=" . scalar(@started) . " count_stopped=" . scalar(@stopped) . " count_crashed=" . scalar(@crashed);

if ( scalar(@stopped) > 0 ) {
$code = $np->opts->get("stopped-critical") ? CRITICAL : WARNING;
Expand All @@ -107,4 +108,4 @@ END
$message .= "CRASHED " . join(', ', @crashed);
}

$np->nagios_exit($code, $message . "\n" . $extmessage);
$np->nagios_exit($code, $message . $perfdata . "\n" . $extmessage);

0 comments on commit 29fb46b

Please sign in to comment.