From 29fb46b959aa9645bfd3703b13aa1fb9d0569d6b Mon Sep 17 00:00:00 2001 From: Anton Fischl Date: Wed, 11 May 2022 16:53:36 +0200 Subject: [PATCH] check_openrc.pl: add performance data Signed-off-by: Anton Fischl --- check_openrc.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check_openrc.pl b/check_openrc.pl index b4c72e1..be218d7 100755 --- a/check_openrc.pl +++ b/check_openrc.pl @@ -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; @@ -107,4 +108,4 @@ END $message .= "CRASHED " . join(', ', @crashed); } -$np->nagios_exit($code, $message . "\n" . $extmessage); +$np->nagios_exit($code, $message . $perfdata . "\n" . $extmessage);