NetBSD Problem Report #52230
From ef@math.uni-bonn.de Fri May 12 11:37:53 2017
Return-Path: <ef@math.uni-bonn.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 4A6BC7A2AD
for <gnats-bugs@gnats.NetBSD.org>; Fri, 12 May 2017 11:37:53 +0000 (UTC)
Message-Id: <20170512113750.68E3E1BD92@trave.math.uni-bonn.de>
Date: Fri, 12 May 2017 13:37:50 +0200 (CEST)
From: ef@math.uni-bonn.de
Reply-To: ef@math.uni-bonn.de
To: gnats-bugs@gnats.NetBSD.org
Subject: net/nagios-plugin's check_rpc doesn't correctly parse NetBSD's rpcinfo's output
X-Send-Pr-Version: 3.95
>Number: 52230
>Category: pkg
>Synopsis: net/nagios-plugin's check_rpc doesn't correctly parse NetBSD's rpcinfo's output
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri May 12 11:40:00 +0000 2017
>Originator: Edgar Fuß
>Release: pkgsrc-2016Q1
>Organization:
Mathematisches Institut der Universität Bonn
>Description:
check_rpc.pl expects "program" in lowercase in rpcinfo's output while at least in the "not registered" case, it's actually capitalized on NetBSD:
rpcinfo: Program 12345 is not available (RPC: Program not registered)
This leads to check_rpc being unable to parse the output, returning UNKNOWN where it should be returning CRITICAL.
This has been reported upstream (monitoring-plugins) as issue #1488.
>How-To-Repeat:
/usr/pkg/libexec/nagios/check_rpc -u localhost 12345
>Fix:
Add patches/patch-plugins-scripts_check_rpc.pl, make makepatchsum, bump PKGREVISION.
--- plugins-scripts/check_rpc.pl.orig 2014-03-04 22:41:57.000000000 +0100
+++ plugins-scripts/check_rpc.pl 2017-05-12 12:30:11.000000000 +0200
@@ -310,18 +310,18 @@
printf "$line " if $verbose;
chomp $line;
- if ( $line =~ /program $prognum version ([0-9]*) ready and waiting/ ) {
+ if ( $line =~ /[Pp]rogram $prognum version ([0-9]*) ready and waiting/ ) {
$response .= " version $1";
$state = 'OK' unless $state ne 'UNKNOWN';
print "1:$response \n" if $verbose;
}
- if ( $line =~ /program $prognum version ([0-9]*) is not available/ ) {
+ if ( $line =~ /[Pp]rogram $prognum version ([0-9]*) is not available/ ) {
$response2 .= " version $1";
$state = 'CRITICAL';
print "2:$response2 \n" if $verbose;
}
- if ( $line =~ /program $prognum is not available/ ) {
+ if ( $line =~ /[Pp]rogram $prognum is not available/ ) {
$response3 = "";
$response3 = "tcp" if $opt_t;
$response3 = "udp" if $opt_u;
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.