From: Stephen L Johnson Date: Tue, 7 Aug 2001 18:41:05 +0000 (+0000) Subject: Converted to use new Spong::SafeExec module X-Git-Tag: spong-2_4_6~5 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1d1bc165de79b17ad894b5521bb706dba2f9874;p=spong.git Converted to use new Spong::SafeExec module --- diff --git a/src/lib/Spong/Network/plugins/check_dns b/src/lib/Spong/Network/plugins/check_dns index 0522de7..eab9eb6 100755 --- a/src/lib/Spong/Network/plugins/check_dns +++ b/src/lib/Spong/Network/plugins/check_dns @@ -5,7 +5,7 @@ $PLUGINS{'dns'} = \&check_dns; # and ask that server to resolve it's own name. If it can do that, then we # assume it is ok - If it can't then something is wrong. -# $Id: check_dns,v 1.2 2000/09/13 18:20:36 sljohnson Exp $ +# $Id: check_dns,v 1.3 2001/08/07 18:41:05 sljohnson Exp $ sub check_dns { my( $host ) = @_; @@ -21,8 +21,7 @@ sub check_dns { "queries.\n" ); } - - system($cmd); + safe_exec($cmd,15); if ( ($? >> 8) == 0 ) { $color = "green"; diff --git a/src/lib/Spong/Network/plugins/check_nfs b/src/lib/Spong/Network/plugins/check_nfs index 1ed191c..b93ea8a 100755 --- a/src/lib/Spong/Network/plugins/check_nfs +++ b/src/lib/Spong/Network/plugins/check_nfs @@ -5,14 +5,18 @@ $PLUGINS{'nfs'} = \&check_nfs; # the portmapper at the remote host. It checks to make sure the nfs, and # mountd services are responding. +# $Id: check_nfs,v 1.2 2001/08/07 18:41:05 sljohnson Exp $ + +use Spong::SafeExec qw(safe_exec); + sub check_nfs { my( $host ) = @_; my( $color, $summary, $message, $rpcok ) = ( "green", "", "", 1 ); my( $msg1, $msg2 ); - $msg1 = `$RPCINFO $host nfs 2>&1`; + $msg1 = safe_exec("$RPCINFO $host nfs 2>&1",30); if( $msg1 !~ /ready and waiting/ ) { $rpcok = 0; } - $msg2 = `$RPCINFO $host mountd 2>&1`; + $msg2 = safe_exec("$RPCINFO $host mountd 2>&1",30); if( $msg2 !~ /ready and waiting/ ) { $rpcok = 0; } $message = "$msg1\n$msg2"; diff --git a/src/lib/Spong/Network/plugins/check_ntp b/src/lib/Spong/Network/plugins/check_ntp index 54e7df9..9bc0f17 100755 --- a/src/lib/Spong/Network/plugins/check_ntp +++ b/src/lib/Spong/Network/plugins/check_ntp @@ -6,6 +6,8 @@ $PLUGINS{'ntp'} = \&check_ntp; # second, it is a yellow status. If the host is not synchonized, it is red # status +# $Id: check_ntp,v 1.5 2001/08/07 18:41:05 sljohnson Exp $ + use Spong::SafeExec qw(safe_exec); sub check_ntp {