OBS User unknown 2007-02-08 07:57:37 +00:00 committed by Git OBS Bridge
parent 2f24b61ae1
commit 3d4ff95e64
12 changed files with 78 additions and 179 deletions

View File

@ -1,66 +0,0 @@
--- common.c
+++ common.c
@@ -28,7 +28,7 @@
#include <dirent.h>
#include <sys/types.h>
#include <sys/ioctl.h>
-#include <sys/param.h> /* for HZ */
+#define HZ (sysconf(_SC_CLK_TCK))
/*
* For PAGE_SIZE (which may be itself a call to getpagesize()).
--- iostat.c
+++ iostat.c
@@ -32,7 +32,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/utsname.h>
-#include <sys/param.h> /* for HZ */
+#define HZ (sysconf(_SC_CLK_TCK))
#include "iostat.h"
#include "common.h"
--- mpstat.c
+++ mpstat.c
@@ -28,7 +28,7 @@
#include <errno.h>
#include <ctype.h>
#include <sys/utsname.h>
-#include <sys/param.h> /* for HZ */
+#define HZ (sysconf(_SC_CLK_TCK))
#include "mpstat.h"
#include "common.h"
--- sa_common.c
+++ sa_common.c
@@ -29,7 +29,7 @@
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ioctl.h>
-#include <sys/param.h> /* for HZ */
+#define HZ (sysconf(_SC_CLK_TCK))
#include "sa.h"
#include "common.h"
--- sadf.c
+++ sadf.c
@@ -26,7 +26,7 @@
#include <unistd.h>
#include <time.h>
#include <errno.h>
-#include <sys/param.h> /* for HZ */
+#define HZ (sysconf(_SC_CLK_TCK))
#include "sadf.h"
#include "sa.h"
--- sar.c
+++ sar.c
@@ -25,7 +25,7 @@
#include <unistd.h>
#include <time.h>
#include <errno.h>
-#include <sys/param.h> /* for HZ */
+#define HZ (sysconf(_SC_CLK_TCK))
#include "sa.h"
#include "common.h"

View File

@ -1,11 +0,0 @@
--- contrib/isag/isag
+++ contrib/isag/isag
@@ -267,7 +267,7 @@
# specific paths and programs
set sar_data_path "/var/log/sa"
-set sar_data_mask "sa\[0-9\]\[0-9\]"
+set sar_data_mask "sa.\[0-9\]\[0-9\]\[0-9\]\[0-9\]_\[0-9\]\[0-9\]_\[0-9\]\[0-9\]"
set sar "/usr/bin/sar"
#set sar "/home/sarrep/source/sysstat-3.3.6/sar"

View File

@ -1,85 +0,0 @@
--- sa1.in
+++ sa1.in
@@ -2,16 +2,23 @@
# SA_LIB_DIR/sa1.sh
# (C) 1999-2005 Sebastien Godard (sysstat <at> wanadoo.fr)
#
+set -e
umask 0022
+DATE=`date +.%Y_%m_%d`
ENDIR=SA_LIB_DIR
+DFILE=/var/log/sa/sa${DATE}
+LOCKFILE=/var/log/sa/sadc.LOCK
+
cd ${ENDIR}
+lockfile -r2 -30 $LOCKFILE 2>/dev/null
+trap "rm -f $LOCKFILE" EXIT
+
if [ $# = 0 ]
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
# outfile has been specified as '-' on the command line...
- exec ${ENDIR}/sadc -F -L 1 1 -
+ ${ENDIR}/sadc -F -L 1 1 ${DFILE}
else
- exec ${ENDIR}/sadc -F -L $* -
+ ${ENDIR}/sadc -F -L $* ${DFILE}
fi
-
--- sa2.in
+++ sa2.in
@@ -11,12 +11,26 @@
[ ${HISTORY} -gt 28 ] && HISTORY=28
S_TIME_FORMAT=ISO ; export S_TIME_FORMAT
umask 0022
-DATE=`date YESTERDAY +%d`
-RPT=SA_DIR/sar${DATE}
-ENDIR=BIN_DIR
-DFILE=SA_DIR/sa${DATE}
-[ -f "$DFILE" ] || exit 0
+ENDIR=/usr/bin
+LOCKFILE=/var/log/sa/sadc.LOCK
+
cd ${ENDIR}
-${ENDIR}/sar $* -f ${DFILE} > ${RPT}
-find SA_DIR \( -name 'sar??' -o -name 'sa??' \) -mtime +"${HISTORY}" -exec rm -f {} \;
+if ! lockfile -r6 -600 $LOCKFILE 2>/dev/null; then
+ if test `find $LOCKFILE -mmin +180 2>/dev/null`; then
+ rm -f $LOCKFILE
+ logger -p cron.alert "$0: detected an old lockfile \"$LOCKFILE\"."
+ fi
+fi
+trap "rm -f $LOCKFILE" EXIT
+#
+# look for sa files newer than 7 days
+#
+for DFILE in `find /var/log/sa -name 'sa.*' -mtime -"${HISTORY}"` ; do
+ RPT=/var/log/sa/sar.${DFILE##*.}
+ # if sa is newer than sar, regenerate sar
+ if test ! -e ${RPT} -o ${DFILE} -nt ${RPT} ; then
+ ${ENDIR}/sar $* -f ${DFILE} > ${RPT}
+ fi
+done
+find SA_DIR \( -name 'sar.????_??_??' -o -name 'sa.????_??_??' \) -mtime +"${HISTORY}" -exec rm -f {} \;
--- sar.c
+++ sar.c
@@ -1574,7 +1574,7 @@
else {
get_localtime(&loc_time);
snprintf(from_file, MAX_FILE_LEN,
- "%s/sa%02d", SA_DIR, loc_time.tm_mday);
+ "%s/sa.%d_%02d_%02d", SA_DIR, loc_time.tm_year + 1900, loc_time.tm_mon + 1, loc_time.tm_mday);
from_file[MAX_FILE_LEN - 1] = '\0';
}
}
@@ -1695,7 +1695,7 @@
((interval < 0) && !from_file[0] && !to_file[0])) {
get_localtime(&loc_time);
snprintf(from_file, MAX_FILE_LEN,
- "%s/sa%02d", SA_DIR, loc_time.tm_mday);
+ "%s/sa.%d_%02d_%02d", SA_DIR, loc_time.tm_year + 1900, loc_time.tm_mon + 1, loc_time.tm_mday);
from_file[MAX_FILE_LEN - 1] = '\0';
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:de2190436605e04faa660eca5cc3dac8bc8a5062783a944b915ebe740712d339
size 120127

View File

@ -0,0 +1,46 @@
--- sa1.in
+++ sa1.in
@@ -21,16 +21,22 @@
rm -f ${CURRENTFILE}
ln -s ${CURRENTDIR}/${CURRENTFILE} ${CURRENTFILE}
fi
+set -e
umask 0022
ENDIR=SA_LIB_DIR
+LOCKFILE=/var/log/sa/sadc.LOCK
cd ${ENDIR}
+
+lockfile -r2 -30 $LOCKFILE 2>/dev/null
+trap "rm -f $LOCKFILE" EXIT
+
if [ $# = 0 ]
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
# outfile has been specified as '-' on the command line...
- exec ${ENDIR}/sadc -F -L 1 1 -
+ ${ENDIR}/sadc -F -L 1 1 -
else
- exec ${ENDIR}/sadc -F -L $* -
+ ${ENDIR}/sadc -F -L $* -
fi
--- sa2.in
+++ sa2.in
@@ -36,6 +36,16 @@
DFILE=${CURRENTDIR}/${CURRENTFILE}
[ -f "$DFILE" ] || exit 0
cd ${ENDIR}
+
+LOCKFILE=/var/log/sa/sadc.LOCK
+if ! lockfile -r6 -600 $LOCKFILE 2>/dev/null; then
+ if test `find $LOCKFILE -mmin +180 2>/dev/null`; then
+ rm -f $LOCKFILE
+ logger -p cron.alert "$0: detected an old lockfile \"$LOCKFILE\"."
+ fi
+fi
+trap "rm -f $LOCKFILE" EXIT
+
${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 {} \;

3
sysstat-7.0.4.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0cf2592dfe23795d14f9844200698378a68a6145fadbf3ba5c77688a4e1fc0b0
size 124768

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Feb 7 14:44:11 CET 2007 - prusnak@suse.cz
- update to 7.0.4
* fixed incorrect NFS client and server statistics for sar
* added hotplug CPU support to sar and mpstat
* added iostat NFS statistics
- dropped obsoleted patches:
* sysstat-6.0.2-hz.diff
-------------------------------------------------------------------
Thu Dec 7 14:21:48 CET 2006 - prusnak@suse.cz

View File

@ -1,7 +1,7 @@
#
# spec file for package sysstat (Version 6.0.2)
# spec file for package sysstat (Version 7.0.4)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@ -10,11 +10,12 @@
Name: sysstat
Version: 6.0.2
Release: 36
Version: 7.0.4
Release: 1
PreReq: %insserv_prereq %fillup_prereq
Requires: gnuplot
Requires: procmail
Requires: gettext
Autoreqprov: on
Group: System/Monitoring
License: GNU General Public License (GPL)
@ -22,13 +23,11 @@ URL: http://perso.wanadoo.fr/sebastien.godard/
Summary: Sar and Iostat Commands for Linux
Source0: %{name}-%{version}.tar.bz2
Source1: %{name}-SuSE.tar.gz
Patch0: %{name}-%{version}.diff
Patch0: %{name}-%{version}-sa1sa2lock.diff
Patch1: %{name}-%{version}-msg.diff
Patch2: %{name}-%{version}-mask.diff
Patch3: %{name}-%{version}-config.diff
Patch4: %{name}-%{version}-pagesize.diff
Patch5: %{name}-%{version}-sysconfdir.diff
Patch6: %{name}-%{version}-hz.diff
Patch2: %{name}-%{version}-config.diff
Patch3: %{name}-%{version}-pagesize.diff
Patch4: %{name}-%{version}-sysconfdir.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -52,8 +51,6 @@ Authors:
%patch2
%patch3
%patch4
%patch5
%patch6
%build
make CFLAGS="$RPM_OPT_FLAGS -Wall" LFLAGS="-L. -lsyscom"
@ -96,14 +93,22 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) /etc/init.d/sysstat
%doc CHANGES COPYING CREDITS FAQ README TODO sysstat-%{version}.lsm
%doc %{_mandir}/man?/*
%dir /etc/sysstat
%dir %{_sysconfdir}/sysstat
%{_sysconfdir}/sysstat/sysstat
%{_bindir}/*
%{_sbindir}/*
%{_datadir}/locale/*/LC_MESSAGES/sysstat.mo
/usr/lib/sa
/usr/lib/sa/sa2
/var/log/sa
%changelog -n sysstat
* Wed Feb 07 2007 - prusnak@suse.cz
- update to 7.0.4
* fixed incorrect NFS client and server statistics for sar
* added hotplug CPU support to sar and mpstat
* added iostat NFS statistics
- dropped obsoleted patches:
* sysstat-6.0.2-hz.diff
* Thu Dec 07 2006 - prusnak@suse.cz
- added procmail to Requires [#226503]
* Tue Aug 08 2006 - ro@suse.de