packages: nagios/nagios.spec, nagios/archivelog-timeformat.patch (NEW) - sa...

glen glen at pld-linux.org
Sun Dec 5 12:36:00 CET 2010


Author: glen                         Date: Sun Dec  5 11:36:00 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- sane (sortable) archive filename

---- Files affected:
packages/nagios:
   nagios.spec (1.158 -> 1.159) , archivelog-timeformat.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/nagios/nagios.spec
diff -u packages/nagios/nagios.spec:1.158 packages/nagios/nagios.spec:1.159
--- packages/nagios/nagios.spec:1.158	Thu Nov 25 14:49:35 2010
+++ packages/nagios/nagios.spec	Sun Dec  5 12:35:54 2010
@@ -12,7 +12,7 @@
 Summary(pt_BR.UTF-8):	Programa para monitoração de máquinas e serviços
 Name:		nagios
 Version:	3.2.3
-Release:	3
+Release:	4
 License:	GPL v2+
 Group:		Networking
 Source0:	http://downloads.sourceforge.net/nagios/%{name}-%{version}.tar.gz
@@ -35,7 +35,8 @@
 Patch4:		%{name}-cmd-typo.patch
 Patch5:		config.patch
 Patch6:		%{name}-googlemap.patch
-Patch7:		nagios-doc-usermacros.patch
+Patch7:		%{name}-doc-usermacros.patch
+Patch8:		archivelog-timeformat.patch
 URL:		http://www.nagios.org/
 BuildRequires:	autoconf
 BuildRequires:	automake
@@ -201,6 +202,7 @@
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
+%patch8 -p1
 
 find -name .cvsignore -o -name .gitignore | xargs rm
 
@@ -228,6 +230,11 @@
 	s,=nagiosadmin,=*,g
 ' sample-config/*.cfg.in
 
+# fixup paths in doc
+%{__sed} -i -e '
+	s,/usr/local/nagios/var/archives/,/var/log/nagios/archives/,
+' html/docs/configmain.html
+
 %build
 cp -f /usr/share/automake/config.sub .
 %{__aclocal}
@@ -488,6 +495,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.159  2010/12/05 11:35:54  glen
+- sane (sortable) archive filename
+
 Revision 1.158  2010/11/25 13:49:35  glen
 - drop comments.dat, downtime.dat (unused)
 

================================================================
Index: packages/nagios/archivelog-timeformat.patch
diff -u /dev/null packages/nagios/archivelog-timeformat.patch:1.1
--- /dev/null	Sun Dec  5 12:36:00 2010
+++ packages/nagios/archivelog-timeformat.patch	Sun Dec  5 12:35:54 2010
@@ -0,0 +1,26 @@
+set sane format for archived logs, so the files would be sortable
+ideally this should came from config (date_format=iso8601)
+
+--- nagios-3.2.3/base/logging.c~	2009-05-22 03:55:21.000000000 +0300
++++ nagios-3.2.3/base/logging.c	2010-12-04 23:33:52.112688537 +0200
+@@ -397,8 +397,7 @@
+ 	stat_result = stat(log_file, &log_file_stat);
+ 
+ 	/* get the archived filename to use */
+-	asprintf(&log_archive,"%s%snagios-%02d-%02d-%d-%02d.log",log_archive_path,(log_archive_path[strlen(log_archive_path)-1]=='/')?"":"/",t->tm_mon+1,t->tm_mday,t->tm_year+1900,t->tm_hour);
+-
++	asprintf(&log_archive,"%s%snagios-%04d-%02d-%02d-%02d.log",log_archive_path,(log_archive_path[strlen(log_archive_path)-1]=='/')?"":"/", t->tm_year+1900, t->tm_mon+1,t->tm_mday,t->tm_hour); 
+ 	/* rotate the log file */
+ 	rename_result=my_rename(log_file,log_archive);
+ 
+--- nagios-3.2.3/cgi/cgiutils.c~	2010-12-04 21:34:34.000000000 +0200
++++ nagios-3.2.3/cgi/cgiutils.c	2010-12-04 23:34:28.915968009 +0200
+@@ -1604,7 +1604,7 @@
+ 	t=localtime(&this_scheduled_log_rotation);
+ 
+ 	/* use the time that the log rotation occurred to figure out the name of the log file */
+-	snprintf(buffer,buffer_length,"%snagios-%02d-%02d-%d-%02d.log",log_archive_path,t->tm_mon+1,t->tm_mday,t->tm_year+1900,t->tm_hour);
++	snprintf(buffer,buffer_length,"%snagios-%04d-%02d-%02d-%02d.log",log_archive_path,t->tm_year+1900,t->tm_mon+1,t->tm_mday,t->tm_hour);
+ 	buffer[buffer_length-1]='\x0';
+ 
+ 	return;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/nagios/nagios.spec?r1=1.158&r2=1.159&f=u



More information about the pld-cvs-commit mailing list