pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/52230: net/nagios-plugin's check_rpc doesn't correctly parse NetBSD's rpcinfo's output



>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;



Home | Main Index | Thread Index | Old Index