Hello community, here is the log from the commit of package sysstat checked in at Wed Apr 18 01:00:01 CEST 2007. -------- --- sysstat/sysstat.changes 2007-03-13 11:54:09.000000000 +0100 +++ /mounts/work_src_done/STABLE/sysstat/sysstat.changes 2007-04-17 16:10:31.000000000 +0200 @@ -1,0 +2,15 @@ +Tue Apr 17 15:07:33 CEST 2007 - prusnak@suse.cz + +- splitted isag utility to separate subpackage sysstat-isag + * users will not be forced to install gnuplot (and X stuff) if + they do not want to + +------------------------------------------------------------------- +Tue Apr 17 14:26:30 CEST 2007 - prusnak@suse.cz + +- update to 7.1.3 + * fixed bug in hotplug cpu support + * better support for keeping sar logfiles for more than one month + * code cleaned + +------------------------------------------------------------------- Old: ---- sysstat-7.1.2-msg.diff sysstat-7.1.2-pagesize.diff sysstat-7.1.2-sa1sa2lock.diff sysstat-7.1.2-sysconfdir.diff sysstat-7.1.2.tar.bz2 New: ---- sysstat-7.1.3-msg.diff sysstat-7.1.3-pagesize.diff sysstat-7.1.3-sa1sa2lock.diff sysstat-7.1.3-sysconfdir.diff sysstat-7.1.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sysstat.spec ++++++ --- /var/tmp/diff_new_pack.P28620/_old 2007-04-18 00:59:51.000000000 +0200 +++ /var/tmp/diff_new_pack.P28620/_new 2007-04-18 00:59:51.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package sysstat (Version 7.1.2) +# spec file for package sysstat (Version 7.1.3) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,10 +11,9 @@ # norootforbuild Name: sysstat -Version: 7.1.2 +Version: 7.1.3 Release: 1 PreReq: %insserv_prereq %fillup_prereq -Requires: gnuplot Requires: procmail Requires: gettext Autoreqprov: on @@ -44,6 +43,27 @@ -------- Sebastien Godard <sebastien.godard@wanadoo.fr> +%package isag +Requires: sysstat = %{version} +Requires: gnuplot tk +Group: System/Monitoring +Autoreqprov: on +Summary: Sar and Iostat Commands for Linux + +%description isag +Sar and Iostat commands for Linux. The sar command collects and reports +system activity information. The iostat command reports CPU statistics +and I/O statistics for TTY devices and disks. The information +collected by sar and iostat can be saved in a binary file for future +inspection. Both commands now support SMP machines when displaying CPU +utilization. + + + +Authors: +-------- + Sebastien Godard <sebastien.godard@wanadoo.fr> + %prep %setup -q -a 1 %patch0 @@ -52,11 +72,11 @@ %patch3 %build -export sa_lib_dir=/usr/lib/sa +export conf_dir=%{_sysconfdir}/sysstat +export sa_lib_dir=%{_libdir}/sa export cron_owner=root export LFLAGS="-L. -lsyscom" %configure \ - --sysconfdir=%{_sysconfdir}/sysstat \ --enable-nls \ --disable-smp-race \ --enable-man-group @@ -85,22 +105,43 @@ %clean rm -rf "$RPM_BUILD_ROOT" -%files -f %{name}.lang +%files %defattr(-,root,root) %attr(644,root,root) %config(noreplace) %{_sysconfdir}/sysstat/sysstat.cron %attr(644,root,root) %config(noreplace) %{_sysconfdir}/sysstat/sysstat.ioconf %attr(755,root,root) %{_sysconfdir}/init.d/sysstat %doc CHANGES COPYING CREDITS FAQ README TODO sysstat-%{version}.lsm -%doc %{_mandir}/man?/* +%doc %{_mandir}/man1/iostat* +%doc %{_mandir}/man1/mpstat* +%doc %{_mandir}/man1/sadf* +%doc %{_mandir}/man1/sar* +%doc %{_mandir}/man8/* %dir %{_sysconfdir}/sysstat %{_sysconfdir}/sysstat/sysstat -%{_bindir}/* -%{_sbindir}/* +%{_bindir}/iostat +%{_bindir}/mpstat +%{_bindir}/sadf +%{_bindir}/sar +%{_sbindir}/rcsysstat %{_datadir}/locale/*/LC_MESSAGES/sysstat.mo -/usr/lib/sa +%{_libdir}/sa /var/log/sa +%files isag +%defattr(-,root,root) +%{_bindir}/isag +%doc %{_mandir}/man1/isag* + %changelog +* Tue Apr 17 2007 - prusnak@suse.cz +- splitted isag utility to separate subpackage sysstat-isag + * users will not be forced to install gnuplot (and X stuff) if + they do not want to +* Tue Apr 17 2007 - prusnak@suse.cz +- update to 7.1.3 + * fixed bug in hotplug cpu support + * better support for keeping sar logfiles for more than one month + * code cleaned * Tue Mar 13 2007 - prusnak@suse.cz - update to 7.1.2 * autoconf support ++++++ sysstat-7.1.2-msg.diff -> sysstat-7.1.3-msg.diff ++++++ --- sysstat/sysstat-7.1.2-msg.diff 2006-04-25 19:40:42.000000000 +0200 +++ /mounts/work_src_done/STABLE/sysstat/sysstat-7.1.3-msg.diff 2007-04-17 14:14:24.000000000 +0200 @@ -1,6 +1,6 @@ --- nls/af.po +++ nls/af.po -@@ -144,8 +144,8 @@ +@@ -142,8 +142,8 @@ "[ -d ] [ -F ] [ -I ] [ -V ]\n" #: sadc.c:614 @@ -13,7 +13,7 @@ msgid "Cannot handle so many processors!\n" --- nls/de.po +++ nls/de.po -@@ -142,8 +142,8 @@ +@@ -140,8 +140,8 @@ "[ -d ] [ -F ] [ -I ] [ -V ]\n" #: sadc.c:614 @@ -26,7 +26,7 @@ msgid "Cannot handle so many processors!\n" --- nls/es.po +++ nls/es.po -@@ -144,8 +144,8 @@ +@@ -142,8 +142,8 @@ "[ -d ] [ -F ] [ -I ] [ -V ]\n" #: sadc.c:614 @@ -39,7 +39,7 @@ msgid "Cannot handle so many processors!\n" --- nls/fr.po +++ nls/fr.po -@@ -144,8 +144,8 @@ +@@ -142,8 +142,8 @@ "[ -d ] [ -F ] [ -I ] [ -V ]\n" #: sadc.c:614 @@ -52,7 +52,7 @@ msgid "Cannot handle so many processors!\n" --- nls/it.po +++ nls/it.po -@@ -142,8 +142,8 @@ +@@ -140,8 +140,8 @@ "[ -d ] [ -F ] [ -I ] [ -V ]\n" #: sadc.c:614 @@ -65,7 +65,7 @@ msgid "Cannot handle so many processors!\n" --- nls/pt.po +++ nls/pt.po -@@ -144,8 +144,8 @@ +@@ -142,8 +142,8 @@ "[ -d ] [ -F ] [ -I ] [ -V ]\n" #: sadc.c:614 @@ -78,7 +78,7 @@ msgid "Cannot handle so many processors!\n" --- sadc.c +++ sadc.c -@@ -654,7 +654,7 @@ +@@ -655,7 +655,7 @@ create_sa_file(ofd, ofile, file_stats_size, flags); return; } ++++++ sysstat-7.1.2-pagesize.diff -> sysstat-7.1.3-pagesize.diff ++++++ ++++++ sysstat-7.1.2-sa1sa2lock.diff -> sysstat-7.1.3-sa1sa2lock.diff ++++++ --- sysstat/sysstat-7.1.2-sa1sa2lock.diff 2007-03-08 15:18:20.000000000 +0100 +++ /mounts/work_src_done/STABLE/sysstat/sysstat-7.1.3-sa1sa2lock.diff 2007-04-17 14:16:17.000000000 +0200 @@ -1,6 +1,6 @@ --- sa1.in +++ sa1.in -@@ -23,16 +23,22 @@ +@@ -28,17 +28,23 @@ rm -f ${CURRENTFILE} ln -s ${CURRENTDIR}/${CURRENTFILE} ${CURRENTFILE} fi @@ -13,7 +13,8 @@ +lockfile -r2 -30 $LOCKFILE 2>/dev/null +trap "rm -f $LOCKFILE" EXIT + - if [ $# = 0 ] + [ "$1" = "--boot" ] && shift && BOOT=y || BOOT=n + if [ $# = 0 ] && [ "$BOOT" = "n" ] then # Note: Stats are written at the end of previous file *and* at the # beginning of the new one (when there is a file rotation) only if @@ -27,7 +28,7 @@ --- sa2.in +++ sa2.in -@@ -41,6 +41,16 @@ +@@ -46,6 +46,16 @@ DFILE=${CURRENTDIR}/${CURRENTFILE} [ -f "$DFILE" ] || exit 0 cd ${ENDIR} @@ -41,6 +42,6 @@ +fi +trap "rm -f $LOCKFILE" EXIT + + [ -L ${RPT} ] && rm -f ${RPT} ${ENDIR}/sar $* -f ${DFILE} > ${RPT} find ${DDIR} ( -name 'sar??' -o -name 'sa??' -o -name 'sar??.gz' -o -name 'sa??.gz' ) \ - -mtime +"${HISTORY}" -exec rm -f {} ; ++++++ sysstat-7.1.2-sysconfdir.diff -> sysstat-7.1.3-sysconfdir.diff ++++++ --- sysstat/sysstat-7.1.2-sysconfdir.diff 2007-03-13 11:45:17.000000000 +0100 +++ /mounts/work_src_done/STABLE/sysstat/sysstat-7.1.3-sysconfdir.diff 2007-04-17 14:10:47.000000000 +0200 @@ -1,58 +1,3 @@ ---- Makefile.in -+++ Makefile.in -@@ -46,7 +46,7 @@ - MAN8_DIR = $(MAN_DIR)/man8 - DOC_DIR = $(PREFIX)/doc/$(PACKAGE)-$(VERSION) - NLS_DIR = $(PREFIX)/share/locale --SYSCONFIG_DIR = /etc/sysconfig -+SYSCONFIG_DIR = @sysconfdir@ - - # Compiler flags - CFLAGS = @CFLAGS@ -Wall -Wstrict-prototypes -pipe -O2 -fno-strength-reduce ---- ioconf.h -+++ ioconf.h -@@ -20,7 +20,7 @@ - #define MAX_BLKDEV 255 - #endif - --#define IOCONF "/etc/sysconfig/sysstat.ioconf" -+#define IOCONF "/etc/sysstat/sysstat.ioconf" - - #define K_NODEV "nodev" - ---- sa1.in -+++ sa1.in -@@ -9,7 +9,7 @@ - # Autoconf support added. - # - HISTORY=0 --[ -r /etc/sysconfig/sysstat ] && . /etc/sysconfig/sysstat -+[ -r /etc/sysstat/sysstat ] && . /etc/sysstat/sysstat - if [ ${HISTORY} -gt 28 ] - then - CURRENTDIR=`date +%Y%m` ---- sa2.in -+++ sa2.in -@@ -21,7 +21,7 @@ - CURRENTRPT=sar${DATE} - HISTORY=@HISTORY@ - COMPRESSAFTER=@COMPRESSAFTER@ --[ -r /etc/sysconfig/sysstat ] && . /etc/sysconfig/sysstat -+[ -r /etc/sysstat/sysstat ] && . /etc/sysstat/sysstat - if [ ${HISTORY} -gt 28 ] - then - CURRENTDIR=`date +%Y%m` ---- sysstat.in -+++ sysstat.in -@@ -25,7 +25,7 @@ - # See how we were called. - case "$1" in - start) -- [ -r /etc/sysconfig/sysstat ] && . /etc/sysconfig/sysstat -+ [ -r /etc/sysstat/sysstat ] && . /etc/sysstat/sysstat - if [ ${HISTORY} -gt 28 ] - then - CURRENTDIR=`date +%Y%m` --- FAQ +++ FAQ @@ -397,9 +397,9 @@ ++++++ sysstat-7.1.2.tar.bz2 -> sysstat-7.1.3.tar.bz2 ++++++ ++++ 1769 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/build/compress-man new/sysstat-7.1.3/build/compress-man --- old/sysstat-7.1.2/build/compress-man 1970-01-01 01:00:00.000000000 +0100 +++ new/sysstat-7.1.3/build/compress-man 2007-03-22 15:46:27.000000000 +0100 @@ -0,0 +1,5 @@ + +Answer y if you want sysstat manual pages to be compressed (using bzip2 or +gzip) when they are installed. +Default answer is n here. + diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/build/conf_dir new/sysstat-7.1.3/build/conf_dir --- old/sysstat-7.1.2/build/conf_dir 1970-01-01 01:00:00.000000000 +0100 +++ new/sysstat-7.1.3/build/conf_dir 2007-03-22 10:10:00.000000000 +0100 @@ -0,0 +1,6 @@ + +This is the directory where sysstat configuration files will +be installed. Default location is /etc/sysconfig. The directory +will be automatically created during installation stage if +necessary. Press Enter to accept this default location. + diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/CHANGES new/sysstat-7.1.3/CHANGES --- old/sysstat-7.1.2/CHANGES 2007-03-03 15:14:58.000000000 +0100 +++ new/sysstat-7.1.3/CHANGES 2007-03-26 20:48:23.000000000 +0200 @@ -1,5 +1,26 @@ Changes: +2007/03/27: Version 7.1.3 - Sebastien Godard (sysstat <at> wanadoo.fr) + WARNING: Daily data files format has changed, and is *not* + compatible with the previous one! [0x216b] + * Hotplug CPU support: Fixed a bug that happened when sar tried + to read a datafile created while a least one processor was + disabled. + * Better support for keeping sar logfiles for more than one month + (several bugs fixed in sa1 and sa2 scripts). + * Fixed a small bug in sa2 script, where obsolete log files would not + be deleted if system activity directory was a symbolic link to + some other directory. + * The new variable "conf_dir" now enables the user to specify sysstat + configuration directory. This variable is used by "configure". + * Added option "--enable-compress-manpg" to "configure" to enable the + user to compress manual pages during installation. + * Removed some 'packed' attributes in sa.h and iostat.h that + generated warnings with gcc 4.1.1. + * isag (Interactive System Activity Grapher) improved. + * CREDITS file updated. + * Code cleaned. + 2007/03/04: Version 7.1.2 - Sebastien Godard (sysstat <at> wanadoo.fr) WARNING: Daily data files format has changed, and is *not* compatible with the previous one! [0x216a] diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/common.c new/sysstat-7.1.3/common.c --- old/sysstat-7.1.2/common.c 2007-03-03 15:23:05.000000000 +0100 +++ new/sysstat-7.1.3/common.c 2007-03-26 20:36:42.000000000 +0200 @@ -1,6 +1,6 @@ /* * sar, sadc, sadf, mpstat and iostat common routines. - * (C) 1999-2006 by Sebastien GODARD (sysstat <at> wanadoo.fr) + * (C) 1999-2007 by Sebastien GODARD (sysstat <at> wanadoo.fr) * *************************************************************************** * This program is free software; you can redistribute it and/or modify it * diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/common.h new/sysstat-7.1.3/common.h --- old/sysstat-7.1.2/common.h 2007-03-03 15:23:05.000000000 +0100 +++ new/sysstat-7.1.3/common.h 2007-03-26 20:36:42.000000000 +0200 @@ -1,6 +1,6 @@ /* * sysstat: System performance tools for Linux - * (C) 1999-2006 by Sebastien Godard (sysstat <at> wanadoo.fr) + * (C) 1999-2007 by Sebastien Godard (sysstat <at> wanadoo.fr) */ #ifndef _COMMON_H diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/configure.in new/sysstat-7.1.3/configure.in --- old/sysstat-7.1.2/configure.in 2007-02-25 14:13:53.000000000 +0100 +++ new/sysstat-7.1.3/configure.in 2007-03-25 10:21:43.000000000 +0200 @@ -4,7 +4,7 @@ # Modified by Sebastien Godard (sysstat <at> wanadoo.fr) # Initialization of $PACKAGE_VERSION and $PACKAGE_NAME variables -AC_INIT(sysstat, 7.1.2) +AC_INIT(sysstat, 7.1.3) # Ensure that a recent enough version of Autoconf is being used AC_PREREQ(2.53) @@ -48,14 +48,14 @@ AC_CHECK_PROG(CHOWN, chown, chown) AC_CHECK_PROG(INSTALL, install, install) AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt) -AC_CHECK_PROG(GZIP, gzip, gzip, gzip) +AC_CHECK_PROGS(ZIP, bzip2 gzip, gzip, /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin) INSTALL_DATA="${INSTALL} -m 644" AC_SUBST(INSTALL_DATA) INSTALL_BIN="${INSTALL} -m 755" AC_SUBST(INSTALL_BIN) -AC_PATH_PROGS(PATH_CP, cp, cp, /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin ) -AC_PATH_PROGS(PATH_CHKCONFIG, chkconfig, chkconfig, /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin ) +AC_PATH_PROGS(PATH_CP, cp, cp, /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin) +AC_PATH_PROGS(PATH_CHKCONFIG, chkconfig, chkconfig, /bin /etc /sbin /usr/bin /usr/etc /usr/sbin /usr/ucb /usr/local/bin /usr/local/etc /usr/local/sbin) # Check libraries @@ -113,10 +113,12 @@ # --disable-man-group ignore man_group variable value # --enable-install-cron tell sysstat to install cron scripts # --enable-clean-sa-dir clean system activity directory +# --enable-compress-manpg compress manual pages # # Some influential environment variables: # sa_lib_dir sadc, sa1 and sa2 directory # sa_dir system activity daily datafiles directory +# conf_dir sysstat configuration directory (default is /etc/sysconfig) # history number of daily datafiles to keep (default value is 7) # compressafter number of days after which datafiles are compressed # man_group group for man pages @@ -173,6 +175,20 @@ fi AC_SUBST(SA_DIR) +# Set configuration directory +AC_MSG_CHECKING(sysstat configuration directory) +AC_ARG_VAR([conf_dir],[sysstat configuration directory]) +if test x$conf_dir != x""; then + SYSCONFIG_DIR=$conf_dir +else + SYSCONFIG_DIR=/etc/sysconfig +fi +AC_MSG_RESULT($SYSCONFIG_DIR) +if test ! -d $SYSCONFIG_DIR; then + echo "INFO: Directory ${SYSCONFIG_DIR} will be created during installation stage." +fi +AC_SUBST(SYSCONFIG_DIR) + # National Language Support AC_MSG_CHECKING(National Language Support) AC_ARG_ENABLE(nls, @@ -283,6 +299,21 @@ AC_MSG_RESULT($AUX_IMG) AC_SUBST(IGNORE_MAN_GROUP) +# Compress manual pages? +AC_MSG_CHECKING(whether manual pages should be compressed) +AC_ARG_ENABLE(compress-manpg, + AC_HELP_STRING([--enable-compress-manpg], + [compress sysstat manual pages]), + AUX_MPG=$enableval,AUX_MPG=no) +if test $AUX_MPG != "yes"; then + COMPRESS_MANPG=n + AUX_MPG=no +else + COMPRESS_MANPG=y +fi +AC_MSG_RESULT($AUX_MPG) +AC_SUBST(COMPRESS_MANPG) + # Check whether sa directory should be cleaned AC_MSG_CHECKING(whether system activity directory should be cleaned) AC_ARG_ENABLE(clean-sa-dir, @@ -366,6 +397,7 @@ AC_CONFIG_FILES([crontab:crontab.sample]) # File must be renamed AC_CONFIG_FILES([sysstat.sysconfig]) AC_CONFIG_FILES([version.h:version.in]) # File must be renamed +AC_CONFIG_FILES([sysconfig.h:sysconfig.in]) # File must be renamed AC_CONFIG_FILES([sysstat.cron.daily]) AC_CONFIG_FILES([sysstat.cron.hourly]) AC_CONFIG_FILES([sysstat.crond]) @@ -378,7 +410,8 @@ Sysstat version: $PACKAGE_VERSION Installation prefix: $prefix rc directory: ${RC_DIR} - init directory: ${INIT_DIR} + Init directory: ${INIT_DIR} + Configuration directory: ${SYSCONFIG_DIR} Compiler: $CC Compiler flags: $CFLAGS diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/contrib/isag/isag new/sysstat-7.1.3/contrib/isag/isag --- old/sysstat-7.1.2/contrib/isag/isag 2006-04-15 07:46:41.000000000 +0200 +++ new/sysstat-7.1.3/contrib/isag/isag 2007-03-25 17:35:10.000000000 +0200 @@ -248,6 +248,10 @@ destroy $w } +proc err_msg {title text} { + tk_messageBox -icon error -type ok -message $text -title $title +} + proc out_msg {title text} { toplevel .msg_box @@ -276,7 +280,7 @@ # following check added: Thu Mar 18 21:44:52 GMT+1 2004 if { 1 != [file executable $sar]} { - out_msg "Error" "File: $sar does not exist" + err_msg "Error" "File: $sar does not exist" exit } @@ -377,9 +381,18 @@ # this variable is set thru: data Chooser (see: Concept Guide) set sag_if_archive "" +# full path to archive file for sa data: either $sar_data_path/sa?? or +# $fgnr_tmpdir/sa_data (if the former file was compressed) +set sag_if_archive_uncompressed "" + # last_graph contains last drawing function as letter set last_graph "" + +# path to the newest sa data file. Set by fill_file_menu, used by the main +# procedure to autoload the file on program's startup +set sag_latest_file "" + # sar switches as names for object-instances (final and curent) #set prog_swtch [list b B c n q r R u v w W y] set prog_swtch [list b B c q r R u v w W] @@ -490,25 +503,93 @@ # Functions which are responsible for data source selection and processing # funcs are referred from GUI proc fill_file_menu {} { - global sar_data_path sar_data_mask + global sar_data_path sar_data_mask sag_latest_file + + set max_timestamp 0 + set directories [lsort -decreasing [glob -nocomplain -directory $sar_data_path -type d [0-9][0-9][0-9][0-9][0-9][0-9]]] - set fp [open "| sh -c "ls $sar_data_path/$sar_data_mask""] menu .file.menu.m -tearoff false - while {[gets $fp line] != -1} { - set l [string last "/" $line] - set line [string range $line [expr $l + 1] end] - .file.menu.m add command -label "$line" -command "set_file $line" - - } - catch {close $fp} + + foreach directory [concat $directories $sar_data_path ] { + set files [glob -nocomplain -directory $directory -type f $sar_data_mask ] + # add compressed files too + set files [concat $files [glob -nocomplain -directory $directory -type f $sar_data_mask.gz ]] + + if { 0 == [llength $files] } { + continue + } + + if { $directory == $sar_data_path } { + set menudir ".file.menu.m" + + # Sort files according to theirs modification times descending + + # i) create temporary list of items in form `timestamp:file' + set tmpfiles [list] + foreach file $files { + # skip symbolic links + if { "link" == [ file type $file]} { continue } + set timestamp [file mtime $file] + set tmpfiles [linsert $tmpfiles end "$timestamp:$file"] + } + + # ii) sort the temporary list + set tmpfiles [lsort -decreasing $tmpfiles] + # iii) remove timestamps to get back the file list + set files [list] + foreach file $tmpfiles { + set l [string first ":" $file] + set files [linsert $files end [string range $file [expr $l+1] end]] + } + } else { + # sort file list by file name, descending + set files [ lsort -decreasing $files ] + set l [string last "/" $directory] + set dir [string range $directory [expr $l + 1] end] + + # create submenu for the $dir directory + set menudir ".file.menu.m.dir$dir" + menu $menudir -tearoff 0 + .file.menu.m add cascade -label $dir -menu $menudir + } + + + # Fill menu with files + foreach file $files { + set l [string length $sar_data_path] + set basefile [string range $file [expr $l + 1] end] + set l [string last "/" $basefile] + set label [string range $basefile [expr $l + 1] end] + set label [string map { .gz "" } $label] + + $menudir add command -label "$label" -command "set_file $basefile" + set timestamp [file mtime $file] + # ignore files small then 4kB to avoid "No data found" error + if { ($timestamp > $max_timestamp) && ([file size $file] > 4096) } { + set sag_latest_file $basefile + set max_timestamp $timestamp + } + } } +} + proc set_file {name} { - global sag_if_archive last_graph + global sar_data_path sag_if_archive sag_if_archive_uncompressed last_graph fngr_tmpdir set sag_if_archive $name .file.lbl configure -text "Data Source: $name" + set l [string last "." $sag_if_archive] + if { [string range $sag_if_archive $l end] == ".gz" } { + # uncompress file to sa_data located in the temporary dir + set sag_if_archive_uncompressed "$fngr_tmpdir/sa_data" + exec zcat "$sar_data_path/$sag_if_archive" > $sag_if_archive_uncompressed + } else { + set sag_if_archive_uncompressed "$sar_data_path/$sag_if_archive" + } + + if {"" != $last_graph} { new_chart $last_graph } @@ -618,6 +699,11 @@ bind all <Alt-x> "exit_program" bind all <F5> "set isag_gr_scale_old 0;redraw_graph" + +# acction to do when user closes isag with the window managers's close button +wm protocol . WM_DELETE_WINDOW exit_program + + ############################################################################### # # this function normalizes max val and sets scale and so on. @@ -891,6 +977,8 @@ close $fp } +set fngr_tmpdir [exec mktemp -d "/tmp/isag.XXXXXX"] + # $Source: /var/CVSROOT/cvs/i-sag/isag/isag.Other.Funcs.m4,v $ ############################################################################### @@ -1143,14 +1231,14 @@ ############################################################################### proc sag_prepare_datafile {l} { - global sar sar_data_path sag_if_archive sag_if_out_tokens \ - sag_opt_whole_day sag_if_last_time sar_elim + global sar sar_data_path sag_if_archive_uncompressed sag_if_out_tokens \ + sag_opt_whole_day sag_if_last_time sar_elim fngr_tmpdir set sag_if_last_time "" - set fp [open "|$sar -$l -f $sar_data_path/$sag_if_archive" "r"] + set fp [open "|$sar -$l -f $sag_if_archive_uncompressed" "r"] - set fgrname [exec mktemp "/tmp/isag.XXXXXX"] + set fgrname "$fngr_tmpdir/data.$l" set fpgr [open $fgrname w] @@ -1211,11 +1299,10 @@ global sag_if_archive isag_title sh sar grep sar_data_path gnuplot \ sag_gr_scale val_cur val_max view_n sag_if_cmd xlabel sag_if_out_tokens \ ylabel y2label plotstr has_negative \ - sag_if_last_time sag_opt_grid sag_opt_whole_day + sag_if_last_time sag_opt_grid sag_opt_whole_day fngr_tmpdir last_graph - if {$sag_if_archive == ""} { - out_msg "Error" "No data source selected for: $view_n($l)" + err_msg "Error" "No data source selected for: $view_n($l)" return } @@ -1234,7 +1321,7 @@ } else { set yrange "[0:$val_cur($l)]" } - set fngr [exec mktemp "/tmp/isag.XXXXXX"] + set fngr "$fngr_tmpdir/draw.$l" create_gnuplot_file tkcanvas tk $fngr "$view_n($l)" \ "$xlabel" \ "$ylabel($l)" $y2label($l) \ @@ -1251,7 +1338,8 @@ file delete $fngr } else { .graph.canv delete all - out_msg "Datafile: sag_if_archive" "No data to show" + err_msg "Datafile: $sag_if_archive" "No data to show" + .graph.canv delete all } file delete $fgrname @@ -1300,7 +1388,7 @@ global sag_if_archive isag_title sh sar grep sar_data_path gnuplot \ sag_gr_scale val_cur val_max view_n sag_if_cmd xlabel sag_if_out_tokens \ ylabel y2label plotstr has_negative \ - sag_if_last_time sag_opt_grid sag_opt_whole_day last_graph + sag_if_last_time sag_opt_grid sag_opt_whole_day last_graph fngr_tmpdir set l $last_graph @@ -1328,7 +1416,7 @@ set yrange "" } - set fngr [exec mktemp "/tmp/isag.XXXXXX"] + set fngr "$fngr_tmpdir/jpeg.$l" create_gnuplot_file jpeg jpg $fngr "$view_n($l)" \ "$xlabel" \ "$ylabel($l)" $y2label($l) \ @@ -1339,11 +1427,18 @@ file delete $fngr.gp file delete $fngr - file rename -force $fngr.jpg $sag_if_archive.$l.jpg + set filename [tk_getSaveFile -title "Save Picture" \ + -initialfile [string map { / _ } $sag_if_archive].$l.jpg \ + -filetypes {{{JPEG Images} {.jpg}} {{All files} *}} ] + if { "" != $filename } { + file rename -force $fngr.jpg $filename + } else { + file delete $fngr.jpg + } } else { .graph.canv delete all - out_msg "Datafile: sag_if_archive" "No data to show" + err_msg "Datafile: $sag_if_archive" "No data to show" } file delete "$fgrname" @@ -1395,12 +1490,17 @@ } } +if { "" != $sag_latest_file } { + catch { set_file $sag_latest_file } +} + # # Finishing a program and writting of config file # proc exit_program {} { global isag_cfg_file prog_swtch val_max val_cur last_graph \ - sag_opt_whole_day sag_opt_grid + sag_opt_whole_day sag_opt_grid \ + fngr_tmpdir set fp [open $isag_cfg_file w] @@ -1419,6 +1519,7 @@ close $fp + file delete -force -- "$fngr_tmpdir" destroy . exit } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/CREDITS new/sysstat-7.1.3/CREDITS --- old/sysstat-7.1.2/CREDITS 2007-02-25 16:10:39.000000000 +0100 +++ new/sysstat-7.1.3/CREDITS 2007-03-27 19:51:08.000000000 +0200 @@ -99,6 +99,11 @@ Ivana Varekova <varekova [at] redhat.com> added support for iostat NFS statistics. Ivana also added support for autoconf. + Nils Philippsen <nphilipp [at] redhat.com> made history configurable. + + Robert Luberda <robert [at] debian.org> brought a few improvements + to sysstat's code, and also reported several bugs. + I would also thank the following people for their hints or bug reports (in alphabetical order): @@ -125,7 +130,6 @@ Ilya Katsnelson <ilya.katsnelson@mot[...].com> Byeong-taek Lee <btlee@psy[...].kr> Ivo Letzas <letzas@for[...].nu> - Robert Luberda <robert@deb[...].org> Neculai Macarie <macarie.neculai@nex[...].com> Robert Macaulay <Robert_Macaulay@Del[...].com> Pierre Machard <pmachard@deb[...].org> @@ -158,6 +162,7 @@ Stephen Tweedie <sct@red[...].com> Thomas Weber <TWEBER@de.[...].com> Yongjun Wei <yjwei@nan[...].com> + Stefan Wild <SWILD@de.[...].com> Holger Wolf <Holger.Wolf@de.[...].com> Urban Widmark <urban@sve[...].se> Peter Zaitsev <pz@spy[...].ru> diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/iconfig new/sysstat-7.1.3/iconfig --- old/sysstat-7.1.2/iconfig 2007-02-15 19:40:08.000000000 +0100 +++ new/sysstat-7.1.3/iconfig 2007-03-23 14:23:01.000000000 +0100 @@ -13,6 +13,8 @@ echo You can enter a ? to display a help message at any time... echo +# Syntax: Ask <QUESTION> <PARM> <TEXT_FILE> + # Installation directory PREFIX=`${ASK} 'Installation directory:' "--prefix" "prefix"` if [ "${PREFIX}" != "" ]; then @@ -31,6 +33,12 @@ SA_DIR="sa_dir=${SA_DIR} " fi +# sysstat configuration directory +SYSCONFIG_DIR=`${ASK} 'sysstat configuration directory:' "conf_dir" "conf_dir"` +if [ "${SYSCONFIG_DIR}" != "" ]; then + SYSCONFIG_DIR="conf_dir=${SYSCONFIG_DIR} " +fi + # Clean sa directory CLEAN_SA_DIR=`${ASK} 'Clean system activity directory? (y/n)' "--enable-clean-sa-dir" "clean-sa-dir"` if [ "${CLEAN_SA_DIR}" = "y" ]; then @@ -112,9 +120,20 @@ fi fi -echo "./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${CLEAN_SA_DIR}${NLS}${SMPRACE} \ -${YESTERDAY}${HISTORY}${COMPRESSAFTER}${MAN}${IGNORE_MAN}${CRON}" +# Compress manual pages +COMPRESSMANPG=`${ASK} 'Compress manual pages? (y/n)' "--enable-compress-manpg" "compress-manpg"` +if [ "${COMPRESSMANPG}" = "y" ]; then + COMPRESSMANPG="--enable-compress-manpg " +else + COMPRESSMANPG="" + echo "Parameter --enable-compress-manpg is NOT set" +fi + +echo +echo "./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \ +${SMPRACE}${YESTERDAY}${HISTORY}${COMPRESSAFTER}${MAN}${IGNORE_MAN}${CRON}${COMPRESSMANPG}" +echo -./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${CLEAN_SA_DIR}${NLS}${SMPRACE} \ -${YESTERDAY}${HISTORY}${COMPRESSAFTER}${MAN}${IGNORE_MAN}${CRON} +./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \ +${SMPRACE}${YESTERDAY}${HISTORY}${COMPRESSAFTER}${MAN}${IGNORE_MAN}${CRON}${COMPRESSMANPG} diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/ioconf.h new/sysstat-7.1.3/ioconf.h --- old/sysstat-7.1.2/ioconf.h 2007-03-03 15:23:05.000000000 +0100 +++ new/sysstat-7.1.3/ioconf.h 2007-03-26 20:36:42.000000000 +0200 @@ -8,6 +8,8 @@ #ifndef _IOCONF_H #define _IOCONF_H +#include "sysconfig.h" + #define IOC_NAMELEN 31 #define IOC_DESCLEN 63 #define IOC_DEVLEN 47 @@ -20,8 +22,6 @@ #define MAX_BLKDEV 255 #endif -#define IOCONF "/etc/sysconfig/sysstat.ioconf" - #define K_NODEV "nodev" #define IS_WHOLE(maj,min) ((min % ioconf[maj]->blkp->pcount) == 0) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/iostat.c new/sysstat-7.1.3/iostat.c --- old/sysstat-7.1.2/iostat.c 2007-03-03 15:23:05.000000000 +0100 +++ new/sysstat-7.1.3/iostat.c 2007-03-26 20:36:42.000000000 +0200 @@ -1,6 +1,6 @@ /* * iostat: report CPU and I/O statistics - * (C) 1998-2006 by Sebastien GODARD (sysstat <at> wanadoo.fr) + * (C) 1998-2007 by Sebastien GODARD (sysstat <at> wanadoo.fr) * *************************************************************************** * This program is free software; you can redistribute it and/or modify it * @@ -981,7 +981,7 @@ util = S_VALUE(ioj->tot_ticks, ioi->tot_ticks, itv); svctm = tput ? util / tput : 0.0; /* - * kernel gives ticks already in milliseconds for all platforms + * Kernel gives ticks already in milliseconds for all platforms * => no need for further scaling. */ await = nr_ios ? @@ -1011,7 +1011,7 @@ await, /* The ticks output is biased to output 1000 ticks per second */ svctm, - /* Again: ticks in milliseconds */ + /* Again: Ticks in milliseconds */ util / 10.0); } @@ -1163,7 +1163,7 @@ if (dlist_idx && !HAS_SYSFS(flags)) { /* * With sysfs, only stats for the requested devices are read. - * With /proc/{diskstats,partitions}, stats for every devices + * With /proc/{diskstats,partitions}, stats for every device * are read. Thus we need to check if stats for current device * are to be displayed. */ @@ -1173,7 +1173,7 @@ break; } if (dev == dlist_idx) - /* Device not found in list: don't display it */ + /* Device not found in list: Don't display it */ continue; } @@ -1231,8 +1231,7 @@ /* *************************************************************************** - * Main loop: read I/O stats from the relevant sources, - * and display them. + * Main loop: Read I/O stats from the relevant sources and display them. *************************************************************************** */ void rw_io_stat_loop(int flags, long int count, struct tm *rectime) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/iostat.h new/sysstat-7.1.3/iostat.h --- old/sysstat-7.1.2/iostat.h 2007-03-03 15:23:05.000000000 +0100 +++ new/sysstat-7.1.3/iostat.h 2007-03-26 20:36:42.000000000 +0200 @@ -125,7 +125,7 @@ struct io_hdr_stats { unsigned int active __attribute__ ((aligned (4))); unsigned int used __attribute__ ((packed)); - char name[MAX_NAME_LEN] __attribute__ ((packed)); + char name[MAX_NAME_LEN]; }; #define IO_HDR_STATS_SIZE (sizeof(struct io_hdr_stats)) @@ -135,7 +135,7 @@ /* Indicate whether its partitions are to be displayed or not */ int disp_part __attribute__ ((aligned (4))); /* Device name */ - char dev_name[MAX_NAME_LEN] __attribute__ ((packed)); + char dev_name[MAX_NAME_LEN]; }; #define IO_DLIST_SIZE (sizeof(struct io_dlist)) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/mpstat.c new/sysstat-7.1.3/mpstat.c --- old/sysstat-7.1.2/mpstat.c 2007-03-03 15:23:05.000000000 +0100 +++ new/sysstat-7.1.3/mpstat.c 2007-03-26 20:36:42.000000000 +0200 @@ -1,6 +1,6 @@ /* * mpstat: per-processor statistics - * (C) 2000-2006 by Sebastien GODARD (sysstat <at> wanadoo.fr) + * (C) 2000-2007 by Sebastien GODARD (sysstat <at> wanadoo.fr) * *************************************************************************** * This program is free software; you can redistribute it and/or modify it * diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/sa1.in new/sysstat-7.1.3/sa1.in --- old/sysstat-7.1.2/sa1.in 2007-02-07 20:45:15.000000000 +0100 +++ new/sysstat-7.1.3/sa1.in 2007-03-25 16:26:40.000000000 +0200 @@ -2,21 +2,26 @@ # @SA_LIB_DIR@/sa1 # (C) 1999-2007 Sebastien Godard (sysstat <at> wanadoo.fr) # -# 2007-01-21: Sebastien Godard (sysstat <at> wanadoo.fr) -# Modified to handle multiple months history. -# Original idea from John Caruso <caruso@paradiso.umuc.edu> -# 2007/02/07: Ivana Varekova <varekova@redhat.com> -# Autoconf support added. +# sa1: Collect and store binary data in system activity data file. # HISTORY=0 -[ -r /etc/sysconfig/sysstat ] && . /etc/sysconfig/sysstat +SYSCONFIG_DIR=@SYSCONFIG_DIR@ +[ -r ${SYSCONFIG_DIR}/sysstat ] && . ${SYSCONFIG_DIR}/sysstat if [ ${HISTORY} -gt 28 ] then CURRENTDIR=`date +%Y%m` - CURRENTFILE=sa`date +%d` + DATE=`date +%d` + CURRENTFILE=sa${DATE} DDIR=@SA_DIR@ cd ${DDIR} || exit 1 [ -d ${CURRENTDIR} ] || mkdir -p ${CURRENTDIR} + # If ${CURRENTFILE} exists and is a regular file, then make sure + # the file was modified this day (and not e.g. month ago) + # and move it to ${CURRENTDIR} + [ ! -L ${CURRENTFILE} ] && + [ -f ${CURRENTFILE} ] && + [ "`date +%Y%m%d -r ${CURRENTFILE}`" = "${CURRENTDIR}${DATE}" ] && + mv -f ${CURRENTFILE} ${CURRENTDIR}/${CURRENTFILE} touch ${CURRENTDIR}/${CURRENTFILE} # Remove the "compatibility" link and recreate it to point to # the (new) current file @@ -26,7 +31,8 @@ umask 0022 ENDIR=@SA_LIB_DIR@ cd ${ENDIR} -if [ $# = 0 ] +[ "$1" = "--boot" ] && shift && BOOT=y || BOOT=n +if [ $# = 0 ] && [ "$BOOT" = "n" ] then # Note: Stats are written at the end of previous file *and* at the # beginning of the new one (when there is a file rotation) only if diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/sa2.in new/sysstat-7.1.3/sa2.in --- old/sysstat-7.1.2/sa2.in 2007-02-11 18:27:47.000000000 +0100 +++ new/sysstat-7.1.3/sa2.in 2007-03-25 18:06:16.000000000 +0200 @@ -2,31 +2,36 @@ # @SA_LIB_DIR@/sa2 # (C) 1999-2007 Sebastien Godard (sysstat <at> wanadoo.fr) # -# Changes: -# 2004-01-22i: Nils Philippsen <nphilipp@redhat.com> -# Make history configurable. -# 2007-01-21: Sebastien Godard (sysstat <at> wanadoo.fr) -# Support for multiple months history. -# 2007-02-07: Ivana Varekova <varekova@redhat.com> -# Autoconf support added. +# sa2: Write a daily report # S_TIME_FORMAT=ISO ; export S_TIME_FORMAT umask 0022 prefix=@prefix@ exec_prefix=@exec_prefix@ -DDIR=@SA_DIR@ +# Add a trailing slash so that 'find' can go through this directory if it's a symlink +DDIR=@SA_DIR@/ +SYSCONFIG_DIR=@SYSCONFIG_DIR@ YESTERDAY=@YESTERDAY@ DATE=`date ${YESTERDAY} +%d` CURRENTFILE=sa${DATE} CURRENTRPT=sar${DATE} HISTORY=@HISTORY@ COMPRESSAFTER=@COMPRESSAFTER@ -[ -r /etc/sysconfig/sysstat ] && . /etc/sysconfig/sysstat +[ -r ${SYSCONFIG_DIR}/sysstat ] && . ${SYSCONFIG_DIR}/sysstat if [ ${HISTORY} -gt 28 ] then - CURRENTDIR=`date +%Y%m` + CURRENTDIR=`date ${YESTERDAY} +%Y%m` cd ${DDIR} || exit 1 - [ -d ${CURRENTDIR} ] || exit 0 + [ -d ${CURRENTDIR} ] || mkdir -p ${CURRENTDIR} + # Check if ${CURRENTFILE} is the correct file created at ${DATE} + # Note: using `-ge' instead of `=' since the file could have + # the next day time stamp because of the file rotating feature of sadc + [ -f ${CURRENTFILE} ] && + [ "`date +%Y%m%d -r ${CURRENTFILE}`" -ge "${CURRENTDIR}${DATE}" ] || exit 0 + # If the file is a regular file, then move it to ${CURRENTDIR} + [ ! -L ${CURRENTFILE} ] && + mv -f ${CURRENTFILE} ${CURRENTDIR}/${CURRENTFILE} && + ln -s ${CURRENTDIR}/${CURRENTFILE} ${CURRENTFILE} touch ${CURRENTDIR}/${CURRENTRPT} # Remove the "compatibility" link and recreate it to point to # the (new) current file @@ -41,11 +46,16 @@ DFILE=${CURRENTDIR}/${CURRENTFILE} [ -f "$DFILE" ] || exit 0 cd ${ENDIR} +[ -L ${RPT} ] && rm -f ${RPT} ${ENDIR}/sar $* -f ${DFILE} > ${RPT} find ${DDIR} ( -name 'sar??' -o -name 'sa??' -o -name 'sar??.gz' -o -name 'sa??.gz' ) \ -mtime +"${HISTORY}" -exec rm -f {} ; find ${DDIR} ( -name 'sar??' -o -name 'sa??' ) -type f -mtime +"${COMPRESSAFTER}" \ -exec gzip -9 {} ; > /dev/null 2>&1 +# Remove broken links +for f in `find ${DDIR} ( -name 'sar??' -o -name 'sa??' ) -type l`; do + [ -e $f ] || rm -f $f +done cd ${DDIR} rmdir [0-9]????? > /dev/null 2>&1 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/sa_common.c new/sysstat-7.1.3/sa_common.c --- old/sysstat-7.1.2/sa_common.c 2007-03-03 15:23:05.000000000 +0100 +++ new/sysstat-7.1.3/sa_common.c 2007-03-26 20:36:42.000000000 +0200 @@ -1,6 +1,6 @@ /* * sar and sadf common routines. - * (C) 1999-2006 by Sebastien GODARD (sysstat <at> wanadoo.fr) + * (C) 1999-2007 by Sebastien GODARD (sysstat <at> wanadoo.fr) * *************************************************************************** * This program is free software; you can redistribute it and/or modify it * @@ -177,22 +177,19 @@ *************************************************************************** */ int next_slice(unsigned long long uptime_ref, unsigned long long uptime, - struct file_hdr *file_hdr, int reset, long interval) + int reset, long interval) { unsigned long file_interval, entry; static unsigned long long last_uptime = 0; - int min, max, pt1, pt2, cpu_nr; + int min, max, pt1, pt2; double f; + /* uptime is expressed in jiffies (basis of 1 processor) */ if (!last_uptime || reset) last_uptime = uptime_ref; - cpu_nr = file_hdr->sa_proc; - if (!cpu_nr) - cpu_nr = 1; - /* Interval cannot be greater than 0xffffffff here */ - f = (((double) ((uptime - last_uptime) & 0xffffffff)) / cpu_nr) / HZ; + f = ((double) ((uptime - last_uptime) & 0xffffffff)) / HZ; file_interval = (unsigned long) f; if ((f * 10) - (file_interval * 10) >= 5) file_interval++; /* Rounding to correct value */ @@ -212,7 +209,7 @@ * (Pn * Iu) or (P'n * Iu) belongs to In * with Pn = En / Iu and P'n = En / Iu + 1 */ - f = (((double) ((uptime - uptime_ref) & 0xffffffff)) / cpu_nr) / HZ; + f = ((double) ((uptime - uptime_ref) & 0xffffffff)) / HZ; entry = (unsigned long) f; if ((f * 10) - (entry * 10) >= 5) entry++; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/sadc.c new/sysstat-7.1.3/sadc.c --- old/sysstat-7.1.2/sadc.c 2007-03-03 15:23:05.000000000 +0100 +++ new/sysstat-7.1.3/sadc.c 2007-03-26 20:36:42.000000000 +0200 @@ -1568,11 +1568,15 @@ * Init uptime0. So if /proc/uptime cannot fill it, * this will be done by /proc/stat. * If cpu_nr = 1, force /proc/stat to fill it. + * If cpu_nr = 0, uptime0 and uptime are equal. + * NB: uptime0 is always filled. */ file_stats.uptime0 = 0; if (cpu_nr > 1) readp_uptime(&(file_stats.uptime0)); read_proc_stat(*flags); + if (!cpu_nr) + file_stats.uptime0 = file_stats.uptime; read_proc_meminfo(); read_proc_loadavg(); read_proc_vmstat(); @@ -1619,6 +1623,8 @@ * Init file_stats structure. Every record of other structures * is set when reading corresponding stat file (records are set * to 0 if there are not enough data to fill the structure). + * Exception for individual CPU's structures which must not be + * init'ed to keep values for CPU before they were disabled. */ memset(&file_stats, 0, FILE_STATS_SIZE); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/sadf.c new/sysstat-7.1.3/sadf.c --- old/sysstat-7.1.2/sadf.c 2007-03-03 15:23:05.000000000 +0100 +++ new/sysstat-7.1.3/sadf.c 2007-03-26 20:36:42.000000000 +0200 @@ -1,6 +1,6 @@ /* * sadf: system activity data formatter - * (C) 1999-2006 by Sebastien GODARD (sysstat <at> wanadoo.fr) + * (C) 1999-2007 by Sebastien GODARD (sysstat <at> wanadoo.fr) * *************************************************************************** * This program is free software; you can redistribute it and/or modify it * @@ -966,7 +966,7 @@ char cur_time[26]; /* Check time (1) */ - if (!next_slice(file_stats[2].uptime, file_stats[curr].uptime, &file_hdr, + if (!next_slice(file_stats[2].uptime0, file_stats[curr].uptime0, reset, interval)) /* Not close enough to desired interval */ return 0; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/sa.h new/sysstat-7.1.3/sa.h --- old/sysstat-7.1.2/sa.h 2007-03-03 15:23:05.000000000 +0100 +++ new/sysstat-7.1.3/sa.h 2007-03-26 20:36:42.000000000 +0200 @@ -1,6 +1,6 @@ /* * sar/sadc: report system activity - * (C) 1999-2006 by Sebastien Godard (sysstat <at> wanadoo.fr) + * (C) 1999-2007 by Sebastien Godard (sysstat <at> wanadoo.fr) */ #ifndef _SA_H @@ -18,7 +18,7 @@ * System activity daily file magic number * (will vary when file format changes) */ -#define SA_MAGIC 0x216a +#define SA_MAGIC 0x216b /* Define activities */ @@ -244,20 +244,20 @@ * No need to save DST (daylight saving time) flag, since it is not taken * into account by the strftime() function used to print the timestamp. */ - unsigned char sa_day __attribute__ ((packed)); - unsigned char sa_month __attribute__ ((packed)); - unsigned char sa_year __attribute__ ((packed)); + unsigned char sa_day; + unsigned char sa_month; + unsigned char sa_year; /* * Size of a long integer. Useful to know the architecture on which * the datafile was created. */ - char sa_sizeof_long __attribute__ ((packed)); + char sa_sizeof_long; /* Operating system name */ - char sa_sysname[UTSNAME_LEN] __attribute__ ((packed)); + char sa_sysname[UTSNAME_LEN]; /* Machine hostname */ - char sa_nodename[UTSNAME_LEN] __attribute__ ((packed)); + char sa_nodename[UTSNAME_LEN]; /* Operating system release number */ - char sa_release[UTSNAME_LEN] __attribute__ ((packed)); + char sa_release[UTSNAME_LEN]; }; #define FILE_HDR_SIZE (sizeof(struct file_hdr)) @@ -266,7 +266,7 @@ /* --- LONG LONG --- */ /* Machine uptime (multiplied by the # of proc) */ unsigned long long uptime __attribute__ ((aligned (16))); - /* Uptime reduced to one processor. Set *only* on SMP machines */ + /* Uptime reduced to one processor. Always set, even on UP machines */ unsigned long long uptime0 __attribute__ ((aligned (16))); unsigned long long context_swtch __attribute__ ((aligned (16))); unsigned long long cpu_user __attribute__ ((aligned (16))); @@ -338,14 +338,14 @@ unsigned int nfsd_getattcnt __attribute__ ((packed)); /* --- CHAR --- */ /* Record type: R_STATS or R_DUMMY */ - unsigned char record_type __attribute__ ((packed)); + unsigned char record_type; /* * Time stamp: hour, minute and second. * Used to determine TRUE time (immutable, non locale dependent time). */ - unsigned char hour /* (0-23) */ __attribute__ ((packed)); - unsigned char minute /* (0-59) */ __attribute__ ((packed)); - unsigned char second /* (0-59) */ __attribute__ ((packed)); + unsigned char hour; /* (0-23) */ + unsigned char minute; /* (0-59) */ + unsigned char second; /* (0-59) */ }; #define FILE_STATS_SIZE (sizeof(struct file_stats)) @@ -379,8 +379,8 @@ unsigned long cstime __attribute__ ((packed)); unsigned long cnswap __attribute__ ((packed)); unsigned int processor __attribute__ ((packed)); - unsigned char flag __attribute__ ((packed)); - unsigned char pad[3] __attribute__ ((packed)); + unsigned char flag; + unsigned char pad[3]; }; #define PID_STATS_SIZE (sizeof(struct pid_stats)) @@ -530,7 +530,7 @@ extern void init_bitmap(unsigned char [], unsigned char, unsigned int); extern void init_stats(struct file_stats [], unsigned int [][NR_IRQS]); extern int next_slice(unsigned long long, unsigned long long, - struct file_hdr *, int, long); + int, long); extern int parse_sar_opt(char * [], int, unsigned int *, unsigned int *, int, unsigned char [], unsigned char []); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/sar.c new/sysstat-7.1.3/sar.c --- old/sysstat-7.1.2/sar.c 2007-03-03 15:23:04.000000000 +0100 +++ new/sysstat-7.1.3/sar.c 2007-03-26 20:36:42.000000000 +0200 @@ -1,6 +1,6 @@ /* * sar: report system activity - * (C) 1999-2006 by Sebastien GODARD (sysstat <at> wanadoo.fr) + * (C) 1999-2007 by Sebastien GODARD (sysstat <at> wanadoo.fr) * *************************************************************************** * This program is free software; you can redistribute it and/or modify it * @@ -268,6 +268,33 @@ /* *************************************************************************** + * Determine if a stat line header has to be displayed + *************************************************************************** +*/ +void check_line_hdr(int *dis_hdr) +{ + int nr_opt; + + /* Get number of options entered on the command line */ + nr_opt = count_bits(&sar_actflag, sizeof(unsigned int)); + + if ((nr_opt > 1) || + ((GET_NET_DEV(sar_actflag) || GET_NET_EDEV(sar_actflag)) && (file_hdr.sa_iface > 1)) || + (GET_DISK(sar_actflag) && (file_hdr.sa_nr_disk > 1))) + *dis_hdr = 1; + else if (GET_ONE_IRQ(sar_actflag)) { + if (count_bits(irq_bitmap, sizeof(irq_bitmap)) > 1) + *dis_hdr = 1; + } + else if ((GET_IRQ(sar_actflag) || GET_CPU(sar_actflag)) && WANT_PER_PROC(flags)) { + if (count_bits(cpu_bitmap, sizeof(cpu_bitmap)) > 1) + *dis_hdr = 1; + } +} + + +/* + *************************************************************************** * Set timestamp string *************************************************************************** */ @@ -891,8 +918,8 @@ /* Check time (1) */ if (read_from_file) { - if (!next_slice(file_stats[2].uptime, file_stats[curr].uptime, - &file_hdr, reset, interval)) + if (!next_slice(file_stats[2].uptime0, file_stats[curr].uptime0, + reset, interval)) /* Not close enough to desired interval */ return 0; } @@ -1440,7 +1467,7 @@ short curr = 1, dis = 1; unsigned long lines = 0; unsigned int rows = 23; - int nr_opt, dis_hdr = 0; + int dis_hdr = 0; /* Read stats header */ read_header_data(); @@ -1469,28 +1496,8 @@ exit(1); } - /* Get number of options entered on the command line */ - nr_opt = count_bits(&sar_actflag, sizeof(unsigned int)); - - /* Determine if stats line header has to be displayed */ - if ((nr_opt > 1) || - ((GET_NET_DEV(sar_actflag) || GET_NET_EDEV(sar_actflag)) && (file_hdr.sa_iface > 1)) || - (GET_DISK(sar_actflag) && (file_hdr.sa_nr_disk > 1))) - dis_hdr = 1; - else if (GET_ONE_IRQ(sar_actflag)) { - int nr_irq; - - nr_irq = count_bits(irq_bitmap, sizeof(irq_bitmap)); - if (nr_irq > 1) - dis_hdr = 1; - } - else if ((GET_IRQ(sar_actflag) || GET_CPU(sar_actflag)) && WANT_PER_PROC(flags)) { - int nr_cpu; - - nr_cpu = count_bits(cpu_bitmap, sizeof(cpu_bitmap)); - if (nr_cpu > 1) - dis_hdr = 1; - } + /* Determine if a stat line header has to be displayed */ + check_line_hdr(&dis_hdr); lines = rows = get_win_height(); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/sysconfig.in new/sysstat-7.1.3/sysconfig.in --- old/sysstat-7.1.2/sysconfig.in 1970-01-01 01:00:00.000000000 +0100 +++ new/sysstat-7.1.3/sysconfig.in 2007-03-22 09:13:15.000000000 +0100 @@ -0,0 +1,12 @@ +/* + * sysstat: System performance tools for Linux + * (C) 1999-2007 by Sebastien Godard (sysstat <at> wanadoo.fr) + */ + +#ifndef _SYSCONFIG_H +#define _SYSCONFIG_H + +/* sysstat configuration directory */ +#define IOCONF "@SYSCONFIG_DIR@/sysstat.ioconf" + +#endif /* _SYSCONFIG_H */ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/sysstat-7.1.2.lsm new/sysstat-7.1.3/sysstat-7.1.2.lsm --- old/sysstat-7.1.2/sysstat-7.1.2.lsm 2007-03-03 15:21:29.000000000 +0100 +++ new/sysstat-7.1.3/sysstat-7.1.2.lsm 1970-01-01 01:00:00.000000000 +0100 @@ -1,33 +0,0 @@ -Begin4 -Title: sysstat - the sar, sadf, mpstat and iostat commands for Linux -Version: 7.1.2 -Entered-date: 2007-03-04 -Description: The sysstat package contains the sar, sadf, mpstat, iostat - and sa tools for Linux. - The sar command collects and reports system activity - information. The iostat command reports CPU utilization - and I/O statistics for disks. The mpstat command reports - global and per-processor statistics. The sadf command - is used to display data collected by sar in various - formats (XML, database-friendly, etc.). - The information collected by sar can be saved in a file - in a binary format for future inspection. - The statistics reported by sar concern I/O transfer rates, - paging activity, process-related activities, interrupts, - network activity, memory and swap space utilization, CPU - utilization, kernel activities and TTY statistics, among - others. Both UP and SMP machines are fully supported. - NB: Send bugs, patches, suggestions and/or questions to - (sysstat [at] wanadoo.fr) and not to the address below! - URL: http://perso.orange.fr/sebastien.godard/ -Keywords: system administration, sar, sadf, iostat, mpstat, system accounting, performance, tuning -Author: sebastien.godard@wanadoo.fr (Sebastien Godard) -Maintained-by: sebastien.godard@wanadoo.fr (Sebastien Godard) -Primary-site: http://perso.orange.fr/sebastien.godard/ - 194kB sysstat-7.1.2.tar.gz - 155kB sysstat-7.1.2.tar.bz2 - 197kB sysstat-7.1.2-1.src.rpm - 151kB sysstat-7.1.2-1.i586.rpm -Alternate-site: ibiblio.org /pub/linux/system/status -Copying-policy: GPL -End diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/sysstat-7.1.2.spec new/sysstat-7.1.3/sysstat-7.1.2.spec --- old/sysstat-7.1.2/sysstat-7.1.2.spec 2007-03-03 15:21:45.000000000 +0100 +++ new/sysstat-7.1.3/sysstat-7.1.2.spec 1970-01-01 01:00:00.000000000 +0100 @@ -1,76 +0,0 @@ -Summary: SAR, SADF, MPSTAT and IOSTAT for Linux -Name: sysstat -Version: 7.1.2 -Release: 1 -License: GPL -Group: Applications/System -Source0: %{name}-%{version}.tar.gz -URL: http://perso.orange.fr/sebastien.godard -Packager: Damien Faure <damien-jn.faure@bull.net> -BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(id -u -n) -Requires: gettext - -%description -The sysstat package contains the sar, sadf, mpstat, iostat and sa -tools for Linux. -The sar command collects and reports system activity information. -The sadf command may be used to display data collected by sar in -various formats (CSV, XML, etc.). -The iostat command reports CPU utilization and I/O statistics for disks. -The mpstat command reports global and per-processor statistics. -The information collected by sar can be saved in a file in a binary -format for future inspection. The statistics reported by sar concern -I/O transfer rates, paging activity, process-related activities, -interrupts, network activity, memory and swap space utilization, CPU -utilization, kernel activities and TTY statistics, among others. Both -UP and SMP machines are fully supported. - -%prep -%setup - -%build -./configure --prefix=%{_prefix} \ - sa_lib_dir=%{_libdir}/sa \ - --mandir=%{_mandir} \ - DESTDIR=$RPM_BUILD_ROOT -make - -%install -rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT/var/log/sa - -make install - -mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d -install -m 755 sysstat $RPM_BUILD_ROOT/etc/rc.d/init.d/sysstat -mkdir -p $RPM_BUILD_ROOT/etc/sysconfig -install -m 644 sysstat.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/sysstat -install -m 644 sysstat.ioconf $RPM_BUILD_ROOT/etc/sysconfig/sysstat.ioconf -mkdir -p $RPM_BUILD_ROOT/etc/cron.d -install -m 644 sysstat.crond.sample $RPM_BUILD_ROOT/etc/cron.d/sysstat -mkdir -p $RPM_BUILD_ROOT/etc/rc2.d -cd $RPM_BUILD_ROOT/etc/rc2.d && ln -sf ../init.d/sysstat S03sysstat -mkdir -p $RPM_BUILD_ROOT/etc/rc3.d -cd $RPM_BUILD_ROOT/etc/rc3.d && ln -sf ../init.d/sysstat S03sysstat -mkdir -p $RPM_BUILD_ROOT/etc/rc5.d -cd $RPM_BUILD_ROOT/etc/rc5.d && ln -sf ../init.d/sysstat S03sysstat - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(644,root,root,755) -%doc %{_prefix}/doc/sysstat-%{version}/* -%attr(755,root,root) %{_bindir}/* -%attr(755,root,root) %{_libdir}/sa/* -%attr(644,root,root) %{_mandir}/man*/* -%attr(644,root,root) %{_datadir}/locale/*/LC_MESSAGES/sysstat.mo -%attr(755,root,root) %dir /var/log/sa -%attr(755,root,root) /etc/rc.d/init.d/sysstat -%attr(644,root,root) /etc/sysconfig/sysstat -%attr(644,root,root) /etc/sysconfig/sysstat.ioconf -%attr(755,root,root) /etc/rc2.d/S03sysstat -%attr(755,root,root) /etc/rc3.d/S03sysstat -%attr(755,root,root) /etc/rc5.d/S03sysstat -%config(noreplace) %attr(0644,root,root) /etc/cron.d/sysstat - diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/sysstat-7.1.3.lsm new/sysstat-7.1.3/sysstat-7.1.3.lsm --- old/sysstat-7.1.2/sysstat-7.1.3.lsm 1970-01-01 01:00:00.000000000 +0100 +++ new/sysstat-7.1.3/sysstat-7.1.3.lsm 2007-03-26 20:46:06.000000000 +0200 @@ -0,0 +1,33 @@ +Begin4 +Title: sysstat - the sar, sadf, mpstat and iostat commands for Linux +Version: 7.1.3 +Entered-date: 2007-03-27 +Description: The sysstat package contains the sar, sadf, mpstat, iostat + and sa tools for Linux. + The sar command collects and reports system activity + information. The iostat command reports CPU utilization + and I/O statistics for disks. The mpstat command reports + global and per-processor statistics. The sadf command + is used to display data collected by sar in various + formats (XML, database-friendly, etc.). + The information collected by sar can be saved in a file + in a binary format for future inspection. + The statistics reported by sar concern I/O transfer rates, + paging activity, process-related activities, interrupts, + network activity, memory and swap space utilization, CPU + utilization, kernel activities and TTY statistics, among + others. Both UP and SMP machines are fully supported. + NB: Send bugs, patches, suggestions and/or questions to + (sysstat [at] wanadoo.fr) and not to the address below! + URL: http://perso.orange.fr/sebastien.godard/ +Keywords: system administration, sar, sadf, iostat, mpstat, system accounting, performance, tuning +Author: sebastien.godard@wanadoo.fr (Sebastien Godard) +Maintained-by: sebastien.godard@wanadoo.fr (Sebastien Godard) +Primary-site: http://perso.orange.fr/sebastien.godard/ + 196kB sysstat-7.1.3.tar.gz + 157kB sysstat-7.1.3.tar.bz2 + 200kB sysstat-7.1.3-1.src.rpm + 151kB sysstat-7.1.3-1.i586.rpm +Alternate-site: ibiblio.org /pub/linux/system/status +Copying-policy: GPL +End diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/sysstat-7.1.3.spec new/sysstat-7.1.3/sysstat-7.1.3.spec --- old/sysstat-7.1.2/sysstat-7.1.3.spec 1970-01-01 01:00:00.000000000 +0100 +++ new/sysstat-7.1.3/sysstat-7.1.3.spec 2007-03-26 20:40:05.000000000 +0200 @@ -0,0 +1,76 @@ +Summary: SAR, SADF, MPSTAT and IOSTAT for Linux +Name: sysstat +Version: 7.1.3 +Release: 1 +License: GPL +Group: Applications/System +Source0: %{name}-%{version}.tar.gz +URL: http://perso.orange.fr/sebastien.godard +Packager: Damien Faure <damien-jn.faure@bull.net> +BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(id -u -n) +Requires: gettext + +%description +The sysstat package contains the sar, sadf, mpstat, iostat and sa +tools for Linux. +The sar command collects and reports system activity information. +The sadf command may be used to display data collected by sar in +various formats (CSV, XML, etc.). +The iostat command reports CPU utilization and I/O statistics for disks. +The mpstat command reports global and per-processor statistics. +The information collected by sar can be saved in a file in a binary +format for future inspection. The statistics reported by sar concern +I/O transfer rates, paging activity, process-related activities, +interrupts, network activity, memory and swap space utilization, CPU +utilization, kernel activities and TTY statistics, among others. Both +UP and SMP machines are fully supported. + +%prep +%setup + +%build +./configure --prefix=%{_prefix} \ + sa_lib_dir=%{_libdir}/sa \ + --mandir=%{_mandir} \ + DESTDIR=$RPM_BUILD_ROOT +make + +%install +rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT/var/log/sa + +make install + +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +install -m 755 sysstat $RPM_BUILD_ROOT/etc/rc.d/init.d/sysstat +mkdir -p $RPM_BUILD_ROOT/etc/sysconfig +install -m 644 sysstat.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/sysstat +install -m 644 sysstat.ioconf $RPM_BUILD_ROOT/etc/sysconfig/sysstat.ioconf +mkdir -p $RPM_BUILD_ROOT/etc/cron.d +install -m 644 sysstat.crond.sample $RPM_BUILD_ROOT/etc/cron.d/sysstat +mkdir -p $RPM_BUILD_ROOT/etc/rc2.d +cd $RPM_BUILD_ROOT/etc/rc2.d && ln -sf ../init.d/sysstat S03sysstat +mkdir -p $RPM_BUILD_ROOT/etc/rc3.d +cd $RPM_BUILD_ROOT/etc/rc3.d && ln -sf ../init.d/sysstat S03sysstat +mkdir -p $RPM_BUILD_ROOT/etc/rc5.d +cd $RPM_BUILD_ROOT/etc/rc5.d && ln -sf ../init.d/sysstat S03sysstat + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(644,root,root,755) +%doc %{_prefix}/doc/sysstat-%{version}/* +%attr(755,root,root) %{_bindir}/* +%attr(755,root,root) %{_libdir}/sa/* +%attr(644,root,root) %{_mandir}/man*/* +%attr(644,root,root) %{_datadir}/locale/*/LC_MESSAGES/sysstat.mo +%attr(755,root,root) %dir /var/log/sa +%attr(755,root,root) /etc/rc.d/init.d/sysstat +%attr(644,root,root) /etc/sysconfig/sysstat +%attr(644,root,root) /etc/sysconfig/sysstat.ioconf +%attr(755,root,root) /etc/rc2.d/S03sysstat +%attr(755,root,root) /etc/rc3.d/S03sysstat +%attr(755,root,root) /etc/rc5.d/S03sysstat +%config(noreplace) %attr(0644,root,root) /etc/cron.d/sysstat + diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sysstat-7.1.2/sysstat.in new/sysstat-7.1.3/sysstat.in --- old/sysstat-7.1.2/sysstat.in 2007-02-07 20:47:45.000000000 +0100 +++ new/sysstat-7.1.3/sysstat.in 2007-03-25 16:22:32.000000000 +0200 @@ -2,46 +2,22 @@ # # chkconfig: 235 03 97 # @INIT_DIR@/sysstat -# (C) 2000-2007 Sebastien Godard <sebastien.godard@wanadoo.fr> +# (C) 2000-2007 Sebastien Godard (sysstat <at> wanadoo.fr) # # Description: Insert a dummy record in current daily data file. # This indicates that the counters have restarted from 0. # -# 2004/10/10 - Sebastien Godard (sysstat <at> wanadoo.fr) -# Now returns real exit code. -# 2006/07/05 - Sebastien Godard (sysstat <at> wanadoo.fr) -# Added support for chkconfig. -# 2007/01/21 - Sebastien Godard (sysstat <at> wanadoo.fr) -# Added support for multiple months history. -# 2007/02/07 - Ivana Varekova <varekova@redhat.com> -# Autoconf support added. -# RETVAL=0 -HISTORY=0 +SYSCONFIG_DIR=@SYSCONFIG_DIR@ # Remove flag indicating that sadc was successfully launched rm -f /tmp/sysstat.run # See how we were called. case "$1" in start) - [ -r /etc/sysconfig/sysstat ] && . /etc/sysconfig/sysstat - if [ ${HISTORY} -gt 28 ] - then - CURRENTDIR=`date +%Y%m` - CURRENTFILE=sa`date +%d` - DDIR=@SA_DIR@ - cd ${DDIR} || exit 1 - [ -d ${CURRENTDIR} ] || mkdir -p ${CURRENTDIR} - touch ${CURRENTDIR}/${CURRENTFILE} - # Remove the "compatibility" link and recreate it to - # point to the (new) current file - rm -f ${CURRENTFILE} - ln -s ${CURRENTDIR}/${CURRENTFILE} ${CURRENTFILE} - @REM_CHOWN@ @CRON_OWNER@ ${CURRENTDIR} ${CURRENTFILE} ${CURRENTDIR}/${CURRENTFILE} - fi echo -n "Calling the system activity data collector (sadc): " - @SU_C_OWNER@ @QUOTE@ @SA_LIB_DIR@/sadc -F -L - && touch /tmp/sysstat.run @QUOTE@ + @SU_C_OWNER@ @QUOTE@ @SA_LIB_DIR@/sa1 --boot && touch /tmp/sysstat.run @QUOTE@ # Try to guess if sadc was successfully launched. The difficulty # here is that the exit code is lost when the above command is ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org