
Hello community, here is the log from the commit of package nagios checked in at Fri May 4 17:36:53 CEST 2007. -------- --- nagios/nagios.changes 2007-03-12 13:28:16.000000000 +0100 +++ /mounts/work_src_done/STABLE/nagios/nagios.changes 2007-05-04 16:54:51.822475000 +0200 @@ -1,0 +2,13 @@ +Fri May 4 16:54:26 CEST 2007 - tsieden@suse.de + +- update to nagios version 2.9 + * Fix for incorrect performance data file write/append mode options + * Fix for current status of hosts with no host check command defined + * SIGSEGV signals should now be logged again (broken in 2.8) + * Configure script fix for no mail program found/installed on system + * Configure script option bug fixes for cygwin and embedded perl + * Command definitions and host/service plugin perfdata with HTML should now be escaped in CGIs + * Patch for incorrect time down percentage in availability CGI + * Updated init script to fix a race condition during restarts + +------------------------------------------------------------------- Old: ---- nagios-2.8.tar.bz2 New: ---- nagios-2.9.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nagios.spec ++++++ --- /var/tmp/diff_new_pack.A26796/_old 2007-05-04 17:36:30.000000000 +0200 +++ /var/tmp/diff_new_pack.A26796/_new 2007-05-04 17:36:30.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package nagios (Version 2.8) +# spec file for package nagios (Version 2.9) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -13,7 +13,7 @@ Name: nagios BuildRequires: apache2-devel freetype2-devel gd-devel iputils libapr-util1-devel libjpeg-devel libpng-devel mailx pcre-devel xorg-x11-devel Summary: The Nagios Network Monitor -Version: 2.8 +Version: 2.9 Release: 1 URL: http://www.nagios.org/ License: GNU General Public License (GPL) @@ -192,6 +192,16 @@ %config(noreplace) %{apache2_sysconfdir}/conf.d/* %changelog +* Fri May 04 2007 - tsieden@suse.de +- update to nagios version 2.9 + * Fix for incorrect performance data file write/append mode options + * Fix for current status of hosts with no host check command defined + * SIGSEGV signals should now be logged again (broken in 2.8) + * Configure script fix for no mail program found/installed on system + * Configure script option bug fixes for cygwin and embedded perl + * Command definitions and host/service plugin perfdata with HTML should now be escaped in CGIs + * Patch for incorrect time down percentage in availability CGI + * Updated init script to fix a race condition during restarts * Mon Mar 12 2007 - tsieden@suse.de - update to nagios version 2.8 * Bug fix for calculating notification interval with service escalations ++++++ nagios-2.8.tar.bz2 -> nagios-2.9.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/base/checks.c new/nagios-2.9/base/checks.c --- old/nagios-2.8/base/checks.c 2007-03-01 20:15:10.000000000 +0100 +++ new/nagios-2.9/base/checks.c 2007-04-10 16:50:22.000000000 +0200 @@ -3,7 +3,7 @@ * CHECKS.C - Service and host check functions for Nagios * * Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org) - * Last Modified: 03-01-2006 + * Last Modified: 04-10-2006 * * License: * @@ -523,6 +523,15 @@ svc_msg.exited_ok=FALSE; svc_msg.early_timeout=FALSE; } + else if(WEXITSTATUS(pclose_result)==0 && WIFSIGNALED(pclose_result)){ + snprintf(svc_msg.output,sizeof(svc_msg.output)-1,"(Plugin received signal %d!)\n",WTERMSIG(pclose_result)); + svc_msg.output[sizeof(svc_msg.output)-1]='\x0'; + svc_msg.exited_ok=TRUE; + svc_msg.early_timeout=FALSE; + /* like bash */ + pclose_result=128+WTERMSIG(pclose_result); + svc_msg.return_code=pclose_result; + } /* write check result to message queue */ write_svc_message(&svc_msg); @@ -2424,7 +2433,7 @@ printf("\tNo host check command specified, so no check will be done (host state assumed to be unchanged)!\n"); #endif - return HOST_UP; + return hst->current_state; } /* grab the host macros */ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/base/nagios.c new/nagios-2.9/base/nagios.c --- old/nagios-2.8/base/nagios.c 2007-03-08 17:12:05.000000000 +0100 +++ new/nagios-2.9/base/nagios.c 2007-04-10 17:08:32.000000000 +0200 @@ -3,12 +3,12 @@ * NAGIOS.C - Core Program Code For Nagios * * Program: Nagios - * Version: 2.8 + * Version: 2.9 * License: GPL * Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org) * * First Written: 01-28-1999 (start of development) - * Last Modified: 03-08-2007 + * Last Modified: 04-10-2007 * * Description: * @@ -142,7 +142,7 @@ int sigshutdown=FALSE; int sigrestart=FALSE; -static char *sigs[]={"EXIT","HUP","INT","QUIT","ILL","TRAP","ABRT","BUS","FPE","KILL","USR1","SEGV","USR2","PIPE","ALRM","TERM","STKFLT","CHLD","CONT","STOP","TSTP","TTIN","TTOU","URG","XCPU","XFSZ","VTALRM","PROF","WINCH","IO","PWR","UNUSED","ZERR","DEBUG",(char *)NULL}; +char *sigs[]={"EXIT","HUP","INT","QUIT","ILL","TRAP","ABRT","BUS","FPE","KILL","USR1","SEGV","USR2","PIPE","ALRM","TERM","STKFLT","CHLD","CONT","STOP","TSTP","TTIN","TTOU","URG","XCPU","XFSZ","VTALRM","PROF","WINCH","IO","PWR","UNUSED","ZERR","DEBUG",(char *)NULL}; int caught_signal=FALSE; int sig_id=0; @@ -715,18 +715,13 @@ event_execution_loop(); /* 03/01/2007 EG Moved from sighandler() to prevent FUTEX locking problems under NPTL */ + /* 03/21/2007 EG SIGSEGV signals are still logged in sighandler() so we don't loose them */ /* did we catch a signal? */ if(caught_signal==TRUE){ - if(sig_id<0) - sig_id=-sig_id; - - for(x=0;sigs[x]!=(char *)NULL;x++); - sig_id%=x; - if(sig_id==SIGHUP) snprintf(buffer,sizeof(buffer),"Caught SIGHUP, restarting...\n"); - else + else if(sig_id!=SIGSEGV) snprintf(buffer,sizeof(buffer),"Caught SIG%s, shutting down...\n",sigs[sig_id]); buffer[sizeof(buffer)-1]='\x0'; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/base/nagiostats.c new/nagios-2.9/base/nagiostats.c --- old/nagios-2.8/base/nagiostats.c 2007-03-08 17:12:05.000000000 +0100 +++ new/nagios-2.9/base/nagiostats.c 2007-04-10 17:08:32.000000000 +0200 @@ -3,11 +3,11 @@ * NAGIOSTATS.C - Displays Nagios Statistics * * Program: Nagiostats - * Version: 2.8 + * Version: 2.9 * License: GPL * Copyright (c) 2003-2007 Ethan Galstad (nagios@nagios.org) * - * Last Modified: 03-08-2007 + * Last Modified: 04-10-2007 * * License: * diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/base/utils.c new/nagios-2.9/base/utils.c --- old/nagios-2.8/base/utils.c 2007-03-01 20:15:11.000000000 +0100 +++ new/nagios-2.9/base/utils.c 2007-04-10 16:50:22.000000000 +0200 @@ -3,7 +3,7 @@ * UTILS.C - Miscellaneous utility functions for Nagios * * Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org) - * Last Modified: 03-01-2007 + * Last Modified: 04-10-2007 * * License: * @@ -76,6 +76,7 @@ extern int sigshutdown; extern int sigrestart; +extern char **sigs; extern int caught_signal; extern int sig_id; @@ -2836,8 +2837,15 @@ /* report an error if we couldn't close the command */ if(status==-1) result=STATE_CRITICAL; - else + else { result=WEXITSTATUS(status); + if(result==0 && WIFSIGNALED(status)){ + /* like bash */ + result=128+WTERMSIG(status); + snprintf(buffer,sizeof(buffer)-1,"(Command received signal %d!)\n",WTERMSIG(status)); + buffer[sizeof(buffer)-1]='\x0'; + } + } /* write the output back to the parent process */ write(fd[1],buffer,strlen(buffer)+1); @@ -3377,6 +3385,8 @@ /* handle signals */ void sighandler(int sig){ + char buffer[MAX_INPUT_BUFFER]; + int x=0; /* if shutdown is already true, we're in a signal trap loop! */ /* changed 09/07/06 to only exit on segfaults */ @@ -3388,8 +3398,24 @@ if(sig<0) sig=-sig; + for(x=0;sigs[x]!=(char *)NULL;x++); + sig%=x; + sig_id=sig; + /* log errors about segfaults now, as we might not get a chance to later */ + /* all other signals are logged at a later point in main() to prevent problems with NPTL */ + if(sig==SIGSEGV){ + snprintf(buffer,sizeof(buffer),"Caught SIG%s, shutting down...\n",sigs[sig]); + buffer[sizeof(buffer)-1]='\x0'; + +#ifdef DEBUG2 + printf("%s\n",buffer); +#endif + + write_to_all_logs(buffer,NSLOG_PROCESS_INFO); + } + /* we received a SIGHUP, so restart... */ if(sig==SIGHUP) sigrestart=TRUE; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/cgi/avail.c new/nagios-2.9/cgi/avail.c --- old/nagios-2.8/cgi/avail.c 2007-01-03 03:50:42.000000000 +0100 +++ new/nagios-2.9/cgi/avail.c 2007-04-09 04:59:15.000000000 +0200 @@ -3,7 +3,7 @@ * AVAIL.C - Nagios Availability CGI * * Copyright (c) 2000-2007 Ethan Galstad (nagios@nagios.org) - * Last Modified: 01-02-2007 + * Last Modified: 04-08-2007 * * License: * @@ -3417,7 +3417,7 @@ printf("<td class='logEntries%s'>%s</td>",bgclass,end_date_time); printf("<td class='logEntries%s'>%s</td>",bgclass,duration); printf("<td class='logEntries%s'>%s%s</td>",ebgclass,entry_type,state_type); - printf("<td class='logEntries%s'>%s</td>",bgclass,(temp_as->state_info==NULL)?"":temp_as->state_info); + printf("<td class='logEntries%s'>%s</td>",bgclass,(temp_as->state_info==NULL)?"":html_encode(temp_as->state_info)); printf("</tr>\n"); } @@ -4038,7 +4038,7 @@ /* down times */ printf("<tr CLASS='dataOdd'><td CLASS='hostDOWN' rowspan=3>DOWN</td>"); - printf("<td CLASS='dataOdd'>Unscheduled</td><td CLASS='dataOdd'>%s</td><td CLASS='dataOdd'>%2.3f%%</td><td class='dataOdd'>%2.3f%%</td></tr>\n",time_down_unscheduled_string,percent_time_down_unscheduled,percent_time_down_known); + printf("<td CLASS='dataOdd'>Unscheduled</td><td CLASS='dataOdd'>%s</td><td CLASS='dataOdd'>%2.3f%%</td><td class='dataOdd'>%2.3f%%</td></tr>\n",time_down_unscheduled_string,percent_time_down_unscheduled,percent_time_down_unscheduled_known); printf("<tr CLASS='dataOdd'><td CLASS='dataOdd'>Scheduled</td><td CLASS='dataOdd'>%s</td><td CLASS='dataOdd'>%2.3f%%</td><td class='dataOdd'>%2.3f%%</td></tr>\n",time_down_scheduled_string,percent_time_down_scheduled,percent_time_down_scheduled_known); printf("<tr CLASS='hostDOWN'><td CLASS='hostDOWN'>Total</td><td CLASS='hostDOWN'>%s</td><td CLASS='hostDOWN'>%2.3f%%</td><td class='hostDOWN'>%2.3f%%</td></tr>\n",time_down_string,percent_time_down,percent_time_down_known); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/cgi/cgiutils.c new/nagios-2.9/cgi/cgiutils.c --- old/nagios-2.8/cgi/cgiutils.c 2006-11-13 19:40:34.000000000 +0100 +++ new/nagios-2.9/cgi/cgiutils.c 2007-04-10 16:50:22.000000000 +0200 @@ -2,8 +2,8 @@ * * CGIUTILS.C - Common utilities for Nagios CGIs * - * Copyright (c) 1999-2006 Ethan Galstad (nagios@nagios.org) - * Last Modified: 11-12-2006 + * Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org) + * Last Modified: 04-10-2007 * * License: * @@ -1366,8 +1366,9 @@ y++; } +#ifdef NOT_SO_SURE_ABOUT_THIS /* spaces are encoded as non-breaking spaces */ - else if((char)input[x]<=(char)' '){ + else if((char)input[x]==(char)' '){ encoded_html_string[y]='\x0'; if((int)strlen(encoded_html_string)<(output_len-6)){ @@ -1375,6 +1376,25 @@ y+=6; } } +#endif + + else if((char)input[x]==(char)'<'){ + + encoded_html_string[y]='\x0'; + if((int)strlen(encoded_html_string)<(output_len-4)){ + strcat(encoded_html_string,"<"); + y+=4; + } + } + + else if((char)input[x]==(char)'>'){ + + encoded_html_string[y]='\x0'; + if((int)strlen(encoded_html_string)<(output_len-4)){ + strcat(encoded_html_string,">"); + y+=4; + } + } /* for simplicity, everything else gets represented by its numeric value */ else{ @@ -1394,6 +1414,16 @@ +/* strips dangerous HTML from plugin output */ +char * strip_plugin_html(char *input){ + + /* TODO */ + + return input; + } + + + /* determines the log file we should use (from current time) */ void get_log_archive_to_use(int archive,char *buffer,int buffer_length){ struct tm *t; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/cgi/extinfo.c new/nagios-2.9/cgi/extinfo.c --- old/nagios-2.8/cgi/extinfo.c 2006-10-09 17:59:02.000000000 +0200 +++ new/nagios-2.9/cgi/extinfo.c 2007-04-10 16:50:22.000000000 +0200 @@ -2,8 +2,8 @@ * * EXTINFO.C - Nagios Extended Information CGI * - * Copyright (c) 1999-2006 Ethan Galstad (nagios@nagios.org) - * Last Modified: 10-09-2006 + * Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org) + * Last Modified: 04-10-2007 * * License: * @@ -995,9 +995,9 @@ printf("<TR><TD CLASS='dataVar'>Host Status:</td><td CLASS='dataVal'><DIV CLASS='%s'> %s %s </DIV></td></tr>\n",bg_class,state_string,(temp_hoststatus->problem_has_been_acknowledged==TRUE)?"(Has been acknowledged)":""); - printf("<TR><TD CLASS='dataVar'>Status Information:</td><td CLASS='dataVal'>%s</td></tr>\n",(temp_hoststatus->plugin_output==NULL)?"":temp_hoststatus->plugin_output); + printf("<TR><TD CLASS='dataVar'>Status Information:</td><td CLASS='dataVal'>%s</td></tr>\n",(temp_hoststatus->plugin_output==NULL)?"":strip_plugin_html(temp_hoststatus->plugin_output)); - printf("<TR><TD CLASS='dataVar'>Performance Data:</td><td CLASS='dataVal'>%s</td></tr>\n",(temp_hoststatus->perf_data==NULL)?"":temp_hoststatus->perf_data); + printf("<TR><TD CLASS='dataVar'>Performance Data:</td><td CLASS='dataVal'>%s</td></tr>\n",(temp_hoststatus->perf_data==NULL)?"":html_encode(temp_hoststatus->perf_data)); printf("<TR><TD CLASS='dataVar'>Current Attempt:</TD><TD CLASS='dataVal'>%d/%d</TD></TR>\n",temp_hoststatus->current_attempt,temp_hoststatus->max_attempts); @@ -1305,9 +1305,9 @@ } printf("<TR><TD CLASS='dataVar'>Current Status:</TD><TD CLASS='dataVal'><DIV CLASS='%s'> %s %s </DIV></TD></TR>\n",bg_class,state_string,(temp_svcstatus->problem_has_been_acknowledged==TRUE)?"(Has been acknowledged)":""); - printf("<TR><TD CLASS='dataVar'>Status Information:</TD><TD CLASS='dataVal'>%s</TD></TR>\n",(temp_svcstatus->plugin_output==NULL)?"":temp_svcstatus->plugin_output); + printf("<TR><TD CLASS='dataVar'>Status Information:</TD><TD CLASS='dataVal'>%s</TD></TR>\n",(temp_svcstatus->plugin_output==NULL)?"":strip_plugin_html(temp_svcstatus->plugin_output)); - printf("<TR><TD CLASS='dataVar'>Performance Data:</td><td CLASS='dataVal'>%s</td></tr>\n",(temp_svcstatus->perf_data==NULL)?"":temp_svcstatus->perf_data); + printf("<TR><TD CLASS='dataVar'>Performance Data:</td><td CLASS='dataVal'>%s</td></tr>\n",(temp_svcstatus->perf_data==NULL)?"":html_encode(temp_svcstatus->perf_data)); printf("<TR><TD CLASS='dataVar'>Current Attempt:</TD><TD CLASS='dataVal'>%d/%d</TD></TR>\n",temp_svcstatus->current_attempt,temp_svcstatus->max_attempts); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/cgi/history.c new/nagios-2.9/cgi/history.c --- old/nagios-2.8/cgi/history.c 2006-03-21 22:31:46.000000000 +0100 +++ new/nagios-2.9/cgi/history.c 2007-04-10 16:50:22.000000000 +0200 @@ -2,8 +2,8 @@ * * HISTORY.C - Nagios History CGI * - * Copyright (c) 1999-2006 Ethan Galstad (nagios@nagios.org) - * Last Modified: 03-21-2006 + * Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org) + * Last Modified: 04-10-2007 * * This CGI program will display the history for the specified host. * If no host is specified, the history for all hosts will be displayed. @@ -901,7 +901,7 @@ if(display_frills==TRUE) printf("<img align='left' src='%s%s' alt='%s' title='%s'>",url_images_path,image,image_alt,image_alt); - printf("[%s] %s<br clear='all'>\n",date_time,temp_buffer); + printf("[%s] %s<br clear='all'>\n",date_time,strip_plugin_html(temp_buffer)); found_line=TRUE; } } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/cgi/notifications.c new/nagios-2.9/cgi/notifications.c --- old/nagios-2.8/cgi/notifications.c 2006-10-09 17:59:02.000000000 +0200 +++ new/nagios-2.9/cgi/notifications.c 2007-04-10 16:50:22.000000000 +0200 @@ -2,8 +2,8 @@ * * NOTIFICATIONS.C - Nagios Notifications CGI * - * Copyright (c) 1999-2006 Ethan Galstad (nagios@nagios.org) - * Last Modified: 10-09-2006 + * Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org) + * Last Modified: 04-10-2007 * * This CGI program will display the notification events for * a given host or contact or for all contacts/hosts. @@ -714,7 +714,7 @@ printf("<td CLASS='notifications%s'>%s</td>\n",(odd)?"Even":"Odd",date_time); printf("<td CLASS='notifications%s'><a href='%s?type=contacts#%s'>%s</a></td>\n",(odd)?"Even":"Odd",CONFIG_CGI,url_encode(contact_name),contact_name); printf("<td CLASS='notifications%s'><a href='%s?type=commands#%s'>%s</a></td>\n",(odd)?"Even":"Odd",CONFIG_CGI,url_encode(method_name),method_name); - printf("<td CLASS='notifications%s'>%s</td>\n",(odd)?"Even":"Odd",temp_buffer); + printf("<td CLASS='notifications%s'>%s</td>\n",(odd)?"Even":"Odd",strip_plugin_html(temp_buffer)); printf("</tr>\n"); } } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/cgi/showlog.c new/nagios-2.9/cgi/showlog.c --- old/nagios-2.8/cgi/showlog.c 2006-03-21 22:31:46.000000000 +0100 +++ new/nagios-2.9/cgi/showlog.c 2007-04-10 16:50:22.000000000 +0200 @@ -2,8 +2,8 @@ * * SHOWLOG.C - Nagios Log File CGI * - * Copyright (c) 1999-2006 Ethan Galstad (nagios@nagios.org) - * Last Modified: 03-21-2006 + * Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org) + * Last Modified: 04-10-2007 * * This CGI program will display the contents of the Nagios * log file. @@ -513,7 +513,7 @@ if(display_frills==TRUE) printf("<img align='left' src='%s%s' alt='%s' title='%s'>",url_images_path,image,image_alt,image_alt); - printf("[%s] %s<br clear='all'>\n",date_time,(temp_buffer==NULL)?"":temp_buffer); + printf("[%s] %s<br clear='all'>\n",date_time,(temp_buffer==NULL)?"":strip_plugin_html(temp_buffer)); } printf("</DIV></P>\n"); @@ -530,50 +530,3 @@ return OK; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/cgi/status.c new/nagios-2.9/cgi/status.c --- old/nagios-2.8/cgi/status.c 2007-01-03 03:50:42.000000000 +0100 +++ new/nagios-2.9/cgi/status.c 2007-04-10 16:50:22.000000000 +0200 @@ -3,7 +3,7 @@ * STATUS.C - Nagios Status CGI * * Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org) - * Last Modified: 01-02-2007 + * Last Modified: 04-10-2007 * * License: * @@ -1729,7 +1729,7 @@ printf("<TD CLASS='status%s' nowrap>%s</TD>\n",status_bg_class,date_time); printf("<TD CLASS='status%s' nowrap>%s</TD>\n",status_bg_class,state_duration); printf("<TD CLASS='status%s'>%d/%d</TD>\n",status_bg_class,temp_status->current_attempt,temp_status->max_attempts); - printf("<TD CLASS='status%s'>%s </TD>\n",status_bg_class,(temp_status->plugin_output==NULL)?"":temp_status->plugin_output); + printf("<TD CLASS='status%s'>%s </TD>\n",status_bg_class,(temp_status->plugin_output==NULL)?"":strip_plugin_html(temp_status->plugin_output)); printf("</TR>\n"); @@ -2113,7 +2113,7 @@ printf("<TD CLASS='status%s'>%s</TD>\n",status_class,status); printf("<TD CLASS='status%s' nowrap>%s</TD>\n",status_bg_class,date_time); printf("<TD CLASS='status%s' nowrap>%s</TD>\n",status_bg_class,state_duration); - printf("<TD CLASS='status%s'>%s </TD>\n",status_bg_class,(temp_status->plugin_output==NULL)?"":temp_status->plugin_output); + printf("<TD CLASS='status%s'>%s </TD>\n",status_bg_class,(temp_status->plugin_output==NULL)?"":strip_plugin_html(temp_status->plugin_output)); printf("</TR>\n"); } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/Changelog new/nagios-2.9/Changelog --- old/nagios-2.8/Changelog 2007-03-08 17:12:05.000000000 +0100 +++ new/nagios-2.9/Changelog 2007-04-10 17:08:32.000000000 +0200 @@ -3,6 +3,19 @@ ##################### +2.9 - 04/10/3007 +---------------- +* Fix for incorrect performance data file write/append mode options +* Fix for current status of hosts with no host check command defined +* SIGSEGV signals should now be logged again (broken in 2.8) +* Configure script fix for no mail program found/installed on system +* Configure script option bug fixes for cygwin and embedded perl +* Command definitions and host/service plugin perfdata with HTML should now be escaped in CGIs +* Patch for incorrect time down percentage in availability CGI +* Updated init script to fix a race condition during restarts + + + 2.8 - 03/08/2007 ------------------ * Bug fix for calculating notification interval with service escalations diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/configure new/nagios-2.9/configure --- old/nagios-2.8/configure 2007-03-08 17:12:05.000000000 +0100 +++ new/nagios-2.9/configure 2007-04-10 17:08:32.000000000 +0200 @@ -1311,9 +1311,9 @@ PKG_NAME=nagios -PKG_VERSION="2.8" +PKG_VERSION="2.9" PKG_HOME_URL="http://www.nagios.org/" -PKG_REL_DATE="03-08-2007" +PKG_REL_DATE="04-10-2007" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do @@ -4884,6 +4884,9 @@ fi fi +if test x$MAIL_PROG=x; then + MAIL_PROG="/bin/mail" +fi init_dir=/etc/rc.d/init.d @@ -6236,20 +6239,11 @@ if test "${enable_embedded_perl+set}" = set; then enableval="$enable_embedded_perl" - cat >>confdefs.h <<_ACEOF -#define EMBEDDEDPERL 1 -_ACEOF + USEPERL=$enableval - PERLLIBS="`perl -MExtUtils::Embed -e ldopts`" - PERLDIR="`perl -MConfig -e 'print $Config{installsitearch}'`" - CFLAGS="${CFLAGS} `perl -MExtUtils::Embed -e ccopts`" - USEPERL=yes - INSTALLPERLSTUFF=yes; - PERLXSI_O=perlxsi.o - OBJS="${OBJS} ${PERLXSI_O}" - echo "creating base/perlxsi.c" - perl -MExtUtils::Embed -e xsinit -- -o base/perlxsi.c +else + USEPERL=no fi; PERLCACHE=no; @@ -6258,11 +6252,7 @@ if test "${with_perlcache+set}" = set; then withval="$with_perlcache" - cat >>confdefs.h <<\_ACEOF -#define DO_CLEAN "0" -_ACEOF - - PERLCACHE=yes; + PERLCACHE=$withval else @@ -6276,10 +6266,35 @@ fi; if test x$USEPERL = xyes; then + + cat >>confdefs.h <<_ACEOF +#define EMBEDDEDPERL 1 +_ACEOF + + PERLLIBS="`perl -MExtUtils::Embed -e ldopts`" + PERLDIR="`perl -MConfig -e 'print $Config{installsitearch}'`" + CFLAGS="${CFLAGS} `perl -MExtUtils::Embed -e ccopts`" + USEPERL=yes + INSTALLPERLSTUFF=yes; + PERLXSI_O=perlxsi.o + OBJS="${OBJS} ${PERLXSI_O}" + echo "creating base/perlxsi.c" + perl -MExtUtils::Embed -e xsinit -- -o base/perlxsi.c + echo "Embedded Perl interpreter will be compiled in..." - if test x$PERLCACHE = xyes; then + + if test x$PERLCACHE = xyes; then + cat >>confdefs.h <<\_ACEOF +#define DO_CLEAN "0" +_ACEOF + + PERLCACHE=yes; echo "Internally compiled Perl scripts will be cached..." else + cat >>confdefs.h <<\_ACEOF +#define DO_CLEAN "1" +_ACEOF + echo "Internally compiled Perl scripts will NOT be cached..." fi fi @@ -6297,15 +6312,19 @@ nagios_name=nagios nagiostats_name=nagiostats +cygwin=no # Check whether --enable-cygwin or --disable-cygwin was given. if test "${enable_cygwin+set}" = set; then enableval="$enable_cygwin" + cygwin=$enableval + +fi; +if test x$cygwin = xyes; then CFLAGS="${CFLAGS} -DCYGWIN" nagios_name=nagios.exe; nagiostats_name=nagiostats.exe; - -fi; +fi diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/configure.in new/nagios-2.9/configure.in --- old/nagios-2.8/configure.in 2007-03-08 17:12:05.000000000 +0100 +++ new/nagios-2.9/configure.in 2007-04-10 17:08:32.000000000 +0200 @@ -9,9 +9,9 @@ AC_PREFIX_DEFAULT(/usr/local/nagios) PKG_NAME=nagios -PKG_VERSION="2.8" +PKG_VERSION="2.9" PKG_HOME_URL="http://www.nagios.org/" -PKG_REL_DATE="03-08-2007" +PKG_REL_DATE="04-10-2007" dnl Figure out how to invoke "install" and what install options to use. AC_PROG_INSTALL @@ -153,6 +153,10 @@ if test MAIL_PROG=no; then AC_PATH_PROG(MAIL_PROG,mail) fi +dnl Fix for systems that don't (yet) have mail/mailx installed... +if test x$MAIL_PROG=x; then + MAIL_PROG="/bin/mail" +fi AC_SUBST(MAIL_PROG) dnl Check for location of init scripts @@ -561,22 +565,13 @@ USEPERL=no; INSTALLPERLSTUFF=no; AC_ARG_ENABLE(embedded-perl,--enable-embedded-perl will enable embedded Perl interpreter,[ - AC_DEFINE_UNQUOTED(EMBEDDEDPERL) - PERLLIBS="`perl -MExtUtils::Embed -e ldopts`" - PERLDIR="`perl -MConfig -e 'print $Config{installsitearch}'`" - CFLAGS="${CFLAGS} `perl -MExtUtils::Embed -e ccopts`" - USEPERL=yes - INSTALLPERLSTUFF=yes; - PERLXSI_O=perlxsi.o - OBJS="${OBJS} ${PERLXSI_O}" - echo "creating base/perlxsi.c" - perl -MExtUtils::Embed -e xsinit -- -o base/perlxsi.c - ]) + USEPERL=$enableval + ] + ,USEPERL=no) PERLCACHE=no; AC_ARG_WITH(perlcache,--with-perlcache turns on cacheing of internally compiled Perl scripts,[ - AC_DEFINE(DO_CLEAN,"0") - PERLCACHE=yes; + PERLCACHE=$withval ] ,[ AC_DEFINE(DO_CLEAN,"1") @@ -585,10 +580,27 @@ dnl Is embedded Perl being compiled in? if test x$USEPERL = xyes; then + + AC_DEFINE_UNQUOTED(EMBEDDEDPERL) + PERLLIBS="`perl -MExtUtils::Embed -e ldopts`" + PERLDIR="`perl -MConfig -e 'print $Config{installsitearch}'`" + CFLAGS="${CFLAGS} `perl -MExtUtils::Embed -e ccopts`" + USEPERL=yes + INSTALLPERLSTUFF=yes; + PERLXSI_O=perlxsi.o + OBJS="${OBJS} ${PERLXSI_O}" + echo "creating base/perlxsi.c" + perl -MExtUtils::Embed -e xsinit -- -o base/perlxsi.c + echo "Embedded Perl interpreter will be compiled in..." + + dnl Is caching enabled? if test x$PERLCACHE = xyes; then + AC_DEFINE(DO_CLEAN,"0") + PERLCACHE=yes; echo "Internally compiled Perl scripts will be cached..." else + AC_DEFINE(DO_CLEAN,"1") echo "Internally compiled Perl scripts will NOT be cached..." fi fi @@ -605,11 +617,15 @@ dnl Option for compiling under CYGWIN nagios_name=nagios nagiostats_name=nagiostats +cygwin=no AC_ARG_ENABLE(cygwin,--enable-cygwin enables building under the CYGWIN environment,[ + cygwin=$enableval + ]) +if test x$cygwin = xyes; then CFLAGS="${CFLAGS} -DCYGWIN" nagios_name=nagios.exe; nagiostats_name=nagiostats.exe; - ]) +fi AC_SUBST(nagios_name) AC_SUBST(nagiostats_name) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/daemon-init.in new/nagios-2.9/daemon-init.in --- old/nagios-2.8/daemon-init.in 2005-11-11 00:14:26.000000000 +0100 +++ new/nagios-2.9/daemon-init.in 2007-04-09 19:43:30.000000000 +0200 @@ -32,12 +32,6 @@ status_nagios () { - if test ! -f $NagiosRunFile; then - echo "No lock file found in $NagiosRunFile" - return 1 - fi - - NagiosPID=`head -n 1 $NagiosRunFile` if test -x $NagiosCGI/daemonchk.cgi; then if $NagiosCGI/daemonchk.cgi -l $NagiosRunFile; then return 0 @@ -45,7 +39,7 @@ return 1 fi else - if ps -p $NagiosPID; then + if ps -p $NagiosPID > /dev/null 2>&1; then return 0 else return 1 @@ -55,18 +49,34 @@ return 1 } +printstatus_nagios() +{ + + if status_nagios $1 $2; then + echo "nagios (pid $NagiosPID) is running..." + else + echo "nagios is not running" + fi +} + killproc_nagios () { + kill $2 $NagiosPID + +} + + +pid_nagios () +{ + if test ! -f $NagiosRunFile; then echo "No lock file found in $NagiosRunFile" - return 1 + exit 1 fi NagiosPID=`head -n 1 $NagiosRunFile` - kill $2 $NagiosPID - } @@ -111,7 +121,7 @@ case "$1" in start) - echo "Starting network monitor: nagios" + echo -n "Starting nagios:" $NagiosBin -v $NagiosCfgFile > /dev/null 2>&1; if [ $? -eq 0 ]; then su - $NagiosUser -c "touch $NagiosVarDir/nagios.log $NagiosRetentionFile" @@ -120,8 +130,7 @@ chown $NagiosUser:$NagiosGroup $NagiosRunFile $NagiosBin -d $NagiosCfgFile if [ -d $NagiosLockDir ]; then touch $NagiosLockDir/$NagiosLockFile; fi - #sleep 1 - #status_nagios nagios + echo " done." exit 0 else echo "CONFIG ERROR! Start aborted. Check your Nagios configuration." @@ -130,7 +139,9 @@ ;; stop) - echo "Stopping network monitor: nagios" + echo -n "Stopping nagios: " + + pid_nagios killproc_nagios nagios # now we have to wait for nagios to exit and remove its @@ -138,10 +149,10 @@ # happen, and then the exiting nagios will remove the # new NagiosRunFile, allowing multiple nagios daemons # to (sooner or later) run - John Sellens - echo -n 'Waiting for nagios to exit .' + #echo -n 'Waiting for nagios to exit .' for i in 1 2 3 4 5 6 7 8 9 10 ; do if status_nagios > /dev/null; then - echo -n ' .' + echo -n '.' sleep 1 else break @@ -149,16 +160,17 @@ done if status_nagios > /dev/null; then echo '' - echo 'Warning - running nagios did not exit in time' + echo 'Warning - nagios did not exit in a timely manner' else - echo ' done.' + echo 'done.' fi rm -f $NagiosStatusFile $NagiosTempFile $NagiosRunFile $NagiosLockDir/$NagiosLockFile $NagiosCommandFile ;; status) - status_nagios nagios + pid_nagios + printstatus_nagios nagios ;; restart) @@ -183,7 +195,7 @@ if test ! -f $NagiosRunFile; then $0 start else - NagiosPID=`head -n 1 $NagiosRunFile` + pid_nagios if status_nagios > /dev/null; then printf "Reloading nagios configuration..." killproc_nagios nagios -HUP diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/html/main.html new/nagios-2.9/html/main.html --- old/nagios-2.8/html/main.html 2007-03-08 17:12:05.000000000 +0100 +++ new/nagios-2.9/html/main.html 2007-04-10 17:08:32.000000000 +0200 @@ -35,8 +35,8 @@ <P> <div align=center> -<div align=center CLASS="version">Version 2.8</div> -<div align=center CLASS="releaseDate">March 08, 2007</div> +<div align=center CLASS="version">Version 2.9</div> +<div align=center CLASS="releaseDate">April 10, 2007</div> </div> </P> diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/include/cgiutils.h.in new/nagios-2.9/include/cgiutils.h.in --- old/nagios-2.8/include/cgiutils.h.in 2006-01-20 18:34:53.000000000 +0100 +++ new/nagios-2.9/include/cgiutils.h.in 2007-04-10 16:50:23.000000000 +0200 @@ -1,8 +1,8 @@ /************************************************************************ * * CGIUTILS.H - Header file for common CGI functions - * Copyright (c) 1999-2006 Ethan Galstad (nagios@nagios.org) - * Last Modified: 01-20-2006 + * Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org) + * Last Modified: 04-10-2007 * * License: * @@ -470,6 +470,7 @@ char * url_encode(char *); /* encodes a string in proper URL format */ char * html_encode(char *); /* encodes a string in HTML format (for what the user sees) */ +char * strip_plugin_html(char *); /* strips dangerous HTML from plugin output */ void get_time_breakdown(unsigned long,int *,int *,int *,int *); /* given total seconds, get days, hours, minutes, seconds */ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/include/common.h new/nagios-2.9/include/common.h --- old/nagios-2.8/include/common.h 2007-03-08 17:12:05.000000000 +0100 +++ new/nagios-2.9/include/common.h 2007-04-10 17:08:32.000000000 +0200 @@ -21,8 +21,8 @@ ************************************************************************/ -#define PROGRAM_VERSION "2.8" -#define PROGRAM_MODIFICATION_DATE "03-08-2007" +#define PROGRAM_VERSION "2.9" +#define PROGRAM_MODIFICATION_DATE "04-10-2007" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/module/Makefile.in new/nagios-2.9/module/Makefile.in --- old/nagios-2.8/module/Makefile.in 2005-11-26 08:05:36.000000000 +0100 +++ new/nagios-2.9/module/Makefile.in 2007-03-14 13:54:20.000000000 +0100 @@ -1,7 +1,7 @@ ################################### # Makefile for NEB examples # -# Last Modified: 08-15-2003 +# Last Modified: 03-13-2007 ################################### @@ -25,14 +25,8 @@ all: helloworld.o -mod1.o: mod1.c - $(CC) $(CFLAGS) -o mod1.o mod1.c $(LDFLAGS) $(LIBS) - -mod2.o: mod2.c - $(CC) $(CFLAGS) -o mod2.o mod2.c $(LDFLAGS) $(LIBS) - helloworld.o: helloworld.c - $(CC) $(CFLAGS) -o helloworld.o helloworld.c $(LDFLAGS) $(LIBS) + $(CC) $(CFLAGS) -o helloworld.o -c helloworld.c $(LDFLAGS) $(LIBS) clean: rm -f helloworld.o diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/nagios.spec new/nagios-2.9/nagios.spec --- old/nagios-2.8/nagios.spec 2007-03-08 17:12:05.000000000 +0100 +++ new/nagios-2.9/nagios.spec 2007-04-10 17:08:32.000000000 +0200 @@ -1,5 +1,5 @@ %define name nagios -%define version 2.8 +%define version 2.9 %define release 1.fc4.test %define nsusr nagios %define nsgrp nagios diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/update-version new/nagios-2.9/update-version --- old/nagios-2.8/update-version 2007-03-08 17:12:05.000000000 +0100 +++ new/nagios-2.9/update-version 2007-04-10 17:08:32.000000000 +0200 @@ -10,10 +10,10 @@ fi # Current version number -CURRENTVERSION=2.8 +CURRENTVERSION=2.9 # Last date -LASTDATE=03-08-2007 +LASTDATE=04-10-2007 if [ "x$1" = "x" ] then diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/nagios-2.8/xdata/xpddefault.c new/nagios-2.9/xdata/xpddefault.c --- old/nagios-2.8/xdata/xpddefault.c 2005-11-16 09:49:35.000000000 +0100 +++ new/nagios-2.9/xdata/xpddefault.c 2007-03-12 20:47:28.000000000 +0100 @@ -2,8 +2,8 @@ * * XPDDEFAULT.C - Default performance data routines * - * Copyright (c) 2000-2004 Ethan Galstad (nagios@nagios.org) - * Last Modified: 12-05-2004 + * Copyright (c) 2000-2007 Ethan Galstad (nagios@nagios.org) + * Last Modified: 03-12-2007 * * License: * @@ -297,14 +297,14 @@ xpddefault_service_perfdata_file=strdup(value); else if(!strcmp(variable,"host_perfdata_file_mode")){ - if(!strstr(value,"w")) + if(strstr(value,"w")) xpddefault_host_perfdata_file_append=FALSE; else xpddefault_host_perfdata_file_append=TRUE; } else if(!strcmp(variable,"service_perfdata_file_mode")){ - if(!strstr(value,"w")) + if(strstr(value,"w")) xpddefault_service_perfdata_file_append=FALSE; else xpddefault_service_perfdata_file_append=TRUE; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de