NIS check?

Will Melick will at ilm.com
Fri Jan 17 01:04:44 CET 2003


Hmmm...is this the issue?

check_rpc.pl looks for these responses from rpcinfo:

 if ( $line =~ /program $prognum version ([0-9]*) ready and waiting/ ) {
                        $response .= " version $1";
                        $state = 'OK' unless $state ne 'OK';
                        print "1:$response \n" if $verbose;
        }
                if ( $line =~ /program $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/ ) {
                        $response3 = "";
                        $response3 = "tcp" if $opt_t;
                        $response3 = "udp" if $opt_u;
                        $state = 'CRITICAL';
                        print "3:$response3 \n" if $verbose;
                }
        }

but rpcinfo answers like this:

(normal state here for ypbind):


[nagios at river nagios]$ rpcinfo -u 10.10.77.60  ypbind 
program 100007 version 1 ready and waiting 
program 100007 version 2 ready and waiting


(failed state for ypbind):


[nagios at river nagios]$ rpcinfo -u 10.10.77.60 ypbind
rpcinfo: RPC: Program not registered
program 100007 is not available


So perhaps we should add an if statement to the perl script that sets
$state to 'CRITICAL' if it gets "rpcinfo: RPC: Program not registered"

e.g.

	}
               if ( $line =~ /rpcinfo: RPC: Program not registered/ ) {
                        $response4 = "";
			$response4 = "tcp" if $opt_t;
			$response4 = "udp" if $opt_u;
			$state = 'CRITICAL';
			print "4:$response4 \n" if $verbose;
	{		



Is it that easy?  Or am I missing something?

Thanks,
-Will



-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en




More information about the Users mailing list