Update/improve functions used to count number of FC hosts:
1) Move code used to count hosts from sa_wrap.c to its normal location
(count.c).
2) Preallocate FC host structures to take into account a possibly
dynamically registerd host. No structures are allocated only if
/sys/class/fc_host directory is not found.
Various fixes in function used to display FC/HBA statistics:
1) Only one function is necessary to display FC/HBA statistics. So
remove print_avg_fchost_stats() function.
2) At the end of the report, display average statistics per host, not a
summary.
3) Update column width used to display statistics (10 characters wide)
to be consistent with other activities display.
4) Move FCHOST column to the right because the host name length may be
greater than 10 characters.
5) Fix timestamp displayed with header line.
6) Remove extra carriage return at the end of display.
By default sa2 now generates summary for YESTERDAY
This can be overriden by setting YESTERDAY=no in the configuration.
The compile time option was removed to make it clear that this is
controlled in one place, which also led to to logic simplification
and code removal.
This change fixes the following issues:
* Previously summary was being generated at 23:53, which caused up to 7
datapoints lost if sa1 logging was set to 1 or 5 minute intervals.
* To amend the previous problem, some distributions were compiling with
YESTERDAY set as a compile-time option, but shipped the cron jobs
as-is. This caused the additional issue that the report of a day was being
delayed up to 23:53 of the next day.
* Finally there is a subtle race condition that might happen if sadc tries to
write to the file while sar is reading it to generate the summary, which
might cause corrupted sar summaries. This does not occur when reading
yesterday's files, since they are not written any more.
Reimplemented most of the functionality of "sargraph" without any XML
transformations. Tweaked the graphs to be more meaningful and more beautiful,
and enabled optional output to file.
YESTERDAY variable can now be changed in the generic configuration file.
For people logging every 1 min, generating the summary at 23:53 is not good
enough: 7 minutes of data points are lost. What is needed is to generate
the summary early in the next day. In order to generate yesterday's
summary without recompiling you can now add the following line in config:
YESTERDAY="--date=yesterday"
Sebastien GODARD [Mon, 30 Mar 2015 16:42:03 +0000 (18:42 +0200)]
Make JSON output consistent with XML one
Use only header "cpu-load" for both "sar -u" and "sar -u ALL"
statistics (header "cpu-load-all" is removed). This is what is
done in XML output. So do the same here for JSON output.
Sebastien GODARD [Sun, 29 Mar 2015 15:27:31 +0000 (17:27 +0200)]
XML output modified to enable proper validation
XML document header modified so that it can be validated against the XSD
document.
Also always use cpu-load header for CPU activity (cpu-load-all has been
removed).
Sebastien GODARD [Sun, 29 Mar 2015 15:23:30 +0000 (17:23 +0200)]
DTD and XSD documents updated
DTD and XSD documents updated so that XML data, as displayed by sadf -x,
can now be properly validated against them.
Several typos have also been corrected.
Some missing elements or attributes (for memory activity, filesystem
activity) have been added.
Sebastien GODARD [Fri, 27 Mar 2015 15:52:27 +0000 (16:52 +0100)]
Use proper length for mountp string
We read 256 chars for the mountpoint name to (try to) be sure to get it
all, and so ths statvfs() function won't fail in read_filesystem()
function.
Yet only MAX_FS_LEN chars should be saved in stats_filesystem structure.
Sebastien GODARD [Thu, 19 Mar 2015 20:22:55 +0000 (21:22 +0100)]
Call chkconfig only if $(COPY_ONLY) is set to no
Call chkconfig (or create corresponding links) only if
$(COPY_ONLY) variable is set to no.
The chkconfig command doesn't take into account the $(DESTDIR) variable
contents, trying to create links outside the $(DESTDIR) tree, which can
be considered as a way to activate sysstat service.
Sebastien GODARD [Thu, 12 Mar 2015 20:39:58 +0000 (21:39 +0100)]
pidstat: Don't stop if gtime and cgtime fields are unavailable
With some old 2.6 kernels, fields "gtime" and "cgtime" (which are
expected to be read from /proc/#/stat file) may not be present.
pidstat used to stop should this case happens.
Fix this since these fields are not mandatory for pidstat to display its
statistics.
sysstat init script may sometimes be called rc.sysstat
In some distros sysstat init script is called rc.sysstat.
So use that name with chkconfig and when uninstalling, remove links with
names like S??rc.sysstat and K??rc.sysstat.
Peter Schiffer [Wed, 11 Feb 2015 18:21:12 +0000 (19:21 +0100)]
Portable way to detect 64 bit OS in configure script
Different architectures have different format of /proc/cpuinfo and also, only
i386 and x86_64 archs support cpu flags. Using "getconf LONG_BIT" command it's
possible to detect 64 bit OS on multiple different architectures. This patch was
successfully tested on i386, x86_64, s390x, ppc64 and aarch64 archs.
Sebastien GODARD [Tue, 27 Jan 2015 11:23:50 +0000 (12:23 +0100)]
Better handling of get_activity_position() return value
Function get_activity_position() can return -1 on error, ie. when
corresponding activity hasn't been found in array.
This return code was sometimes not tested because we knew that the
activity existed. So we directly used the return code as array index.
Strengthen things now: If such an activity is not found then display an
internal error message and exit.
Sebastien GODARD [Fri, 23 Jan 2015 20:33:52 +0000 (21:33 +0100)]
Add new sadc_options variable to configure script
Add a new variable (sadc_options) used by the configure script.
This option enables the user to enter parameters that will be passed to
sadc in the sa1 script. This can typically be used to select optional
activities that should be collected by sadc.
Sebastien GODARD [Wed, 21 Jan 2015 10:02:46 +0000 (11:02 +0100)]
Update sysstat spec file
RPM spec file for sysstat package has been updated:
1) Now use --disable-file-attr option with configure to allow a non
privileged user to build the package,
2) Remove %attr directive which cannot be applied on symlinks listed in
%files section.