OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 21-Apr-2006 09:19:01
Branch: HEAD Handle: 2006042108190000
Modified files:
openpkg-src/nagios nagios.patch nagios.spec
Log:
I'm still trying to track down why to the hell Nagios thinks the
plugins return 127 on exit although they work fine on the command line
Summary:
Revision Changes Path
1.5 +62 -0 openpkg-src/nagios/nagios.patch
1.52 +1 -1 openpkg-src/nagios/nagios.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/nagios/nagios.patch
============================================================================
$ cvs diff -u -r1.4 -r1.5 nagios.patch
--- openpkg-src/nagios/nagios.patch 20 Apr 2006 19:51:08 -0000 1.4
+++ openpkg-src/nagios/nagios.patch 21 Apr 2006 07:19:00 -0000 1.5
@@ -54,3 +54,65 @@
elif [ "z$ac_cv_uname_s" = "zUnixWare" ] && \
$PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
+Index: base/utils.c
+--- base/utils.c.orig 2006-04-07 23:45:33 +0200
++++ base/utils.c 2006-04-20 22:52:43 +0200
+@@ -2806,7 +2806,7 @@
+ /* report an error if we couldn't run the command */
+ if(fp==NULL){
+
+- strncpy(buffer,"(Error: Could not execute
command)\n",sizeof(buffer)-1);
++ snprintf(buffer,sizeof(buffer)-1,"(Error: Could not
execute command \"%s\"", cmd);
+ buffer[sizeof(buffer)-1]='\x0';
+
+ /* write the error back to the parent process */
+@@ -2817,7 +2817,8 @@
+ else{
+
+ /* default return string in case nothing was returned */
+- strcpy(buffer,"(No output!)");
++ snprintf(buffer,sizeof(buffer)-1,"(No output from
command \"%s\"", cmd);
++ buffer[sizeof(buffer)-1]='\x0';
+
+ /* read in the first line of output from the command */
+ fgets(buffer,sizeof(buffer)-1,fp);
+@@ -2833,7 +2834,7 @@
+ if(status==-1)
+ result=STATE_CRITICAL;
+ else
+- result=WEXITSTATUS(status);
++ result=(WIFEXITED(status) ? WEXITSTATUS(status)
: -1);
+
+ /* write the output back to the parent process */
+ write(fd[1],buffer,strlen(buffer)+1);
+@@ -2870,7 +2871,7 @@
+ #endif
+
+ /* get the exit code returned from the program */
+- result=WEXITSTATUS(status);
++ result=(WIFEXITED(status) ? WEXITSTATUS(status) : -1);
+
+ /* check for possibly missing scripts/binaries/etc */
+ if(result==126 || result==127){
+Index: base/checks.c
+--- base/checks.c.orig 2006-02-16 05:47:55 +0100
++++ base/checks.c 2006-04-20 22:52:42 +0200
+@@ -483,7 +483,8 @@
+ _exit(STATE_UNKNOWN);
+
+ /* default return string in case nothing was returned */
+- strcpy(plugin_output,"(No output!)");
++ snprintf(plugin_output,sizeof(plugin_output)-1,"(No
output from command \"%s\"", processed_command);
++ plugin_output[sizeof(plugin_output)-1]='\x0';
+
+ /* grab the plugin output and clean it */
+ fgets(plugin_output,sizeof(plugin_output)-1,fp);
+@@ -505,7 +506,7 @@
+ /* record check result info */
+
strncpy(svc_msg.output,plugin_output,sizeof(svc_msg.output)-1);
+ svc_msg.output[sizeof(svc_msg.output)-1]='\x0';
+- svc_msg.return_code=WEXITSTATUS(pclose_result);
++ svc_msg.return_code=(WIFEXITED(pclose_result) ?
WEXITSTATUS(pclose_result) : -1);
+ svc_msg.exited_ok=TRUE;
+ svc_msg.check_type=SERVICE_CHECK_ACTIVE;
+ svc_msg.finish_time=end_time;
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/nagios/nagios.spec
============================================================================
$ cvs diff -u -r1.51 -r1.52 nagios.spec
--- openpkg-src/nagios/nagios.spec 20 Apr 2006 19:51:08 -0000 1.51
+++ openpkg-src/nagios/nagios.spec 21 Apr 2006 07:19:00 -0000 1.52
@@ -37,7 +37,7 @@
Group: Network
License: GNU
Version: %{V_nagios}
-Release: 20060420
+Release: 20060421
# package options
%option with_perl yes
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]