You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

123 lines
4.3 KiB

Index: base/checks.c
--- base/checks.c.orig 2006-02-16 05:47:55 +0100
+++ base/checks.c 2006-06-01 10:34:34 +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;
Index: base/logging.c
--- base/logging.c.orig 2005-12-13 01:42:45 +0100
+++ base/logging.c 2006-06-01 10:34:34 +0200
@@ -208,6 +208,7 @@
/* write something to the syslog facility */
int write_to_syslog(char *buffer, unsigned long data_type){
+static int logopen = 0;
#ifdef DEBUG0
printf("write_to_syslog() start\n");
@@ -225,6 +226,12 @@
if(!(data_type & syslog_options))
return OK;
+ /* OSSP fsl identification */
+ if (!logopen) {
+ openlog("nagios", LOG_NDELAY, LOG_USER);
+ logopen = 1;
+ }
+
/* write the buffer to the syslog facility */
syslog(LOG_USER|LOG_INFO,"%s",buffer);
Index: base/utils.c
--- base/utils.c.orig 2006-05-20 20:37:29 +0200
+++ base/utils.c 2006-06-01 10:34:34 +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,11 +2871,11 @@
#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){
- snprintf(buffer,sizeof(buffer)-1,"Warning: Attempting to execute the command \"%s\" resulted in a return code of %d. Make sure the script or binary you are trying to execute actually exists...\n",cmd,result);
+ snprintf(buffer,sizeof(buffer)-1,"Warning: Attempting to execute the command \"%s\" (timeout %ds) resulted in a return code of %d. Make sure the script or binary you are trying to execute actually exists...\n",cmd,timeout,result);
buffer[sizeof(buffer)-1]='\x0';
write_to_logs_and_console(buffer,NSLOG_RUNTIME_WARNING,TRUE);
}
Index: nagios-plugins-1.4.3/configure
--- nagios-plugins-1.4.3/configure.orig 2006-04-19 05:52:19 +0200
+++ nagios-plugins-1.4.3/configure 2006-06-01 10:34:34 +0200
@@ -25122,8 +25122,8 @@
fi
if test "$ac_cv_lib_ldap_main" = "yes"; then
- LDAPLIBS="-lldap -llber"\
- LDAPINCLUDE="-I/usr/include/ldap"
+ LDAPLIBS="-lldap -llber -lssl -lcrypto"
+ LDAPINCLUDE="-I$prefix/include"
@@ -29844,17 +29844,10 @@
echo "$as_me:$LINENO: checking for ICMP ping syntax" >&5
echo $ECHO_N "checking for ICMP ping syntax... $ECHO_C" >&6
-ac_cv_ping_packets_first=no
-ac_cv_ping_has_timeout=no
if test -n "$with_ping_command"
then
echo "$as_me:$LINENO: result: (command-line) $with_ping_command" >&5
echo "${ECHO_T}(command-line) $with_ping_command" >&6
- if test -n "$ac_cv_ping_packets_first"
- then
- ac_cv_ping_packets_first=yes
- ac_cv_ping_has_timeout=yes
- fi
elif [ "z$ac_cv_uname_s" = "zUnixWare" ] && \
$PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \