How to install Sysstat on ParrotOs 3.9

To install Sysstat on ParrotOs 3.9

Sysstat is one of the powerful monitoring tool to track the system statistics and to troubleshoot the issues. This tutorial covers the ground on the installation procedure of sysstat tool. Some of Sysstat' s features are covered below. 


Features

  • iostat used to report all statistics about your CPU and I/O statistics for I/O devices.
  • nfsiostat-sysstat used to I/O statistics for NFS.
  • sa2 used to summaries daily report to be used with sar.
  • pidstat reports Statistics about running processes/task, CPU, memory etc.
  • sadc used to System activity data collector, used for collecting data in backend for sar.
  • sar writes Save and report details about different resources.
  • Sadf used for displaying data generated by sar in different formats.
  • mpstat writes details about CPUs.
  • cifsiostat used for statistics for CIFS.
  • sa1 writes fetch and store binary data in sadc data file. This is used with sadc.


Installing Sysstat

Before you start, make sure you download the latest and stable version of sysstat package using the link http://sebastien.godard.pagesperso-orange.fr/download.html, through the following command.

┌─[root@linuxhelp]─[~]
└──╼ #wget http://pagesperso-orange.fr/sebastien.godard/sysstat-11.0.0.tar.gz
--2018-01-12 10:47:57--  http://pagesperso-orange.fr/sebastien.godard/sysstat-11.0.0.tar.gz
Resolving pagesperso-orange.fr (pagesperso-orange.fr)... 193.252.121.242
Connecting to pagesperso-orange.fr (pagesperso-orange.fr)|193.252.121.242|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://sebastien.godard.pagesperso-orange.fr/sysstat-11.0.0.tar.gz [following]
--2018-01-12 10:48:02--  http://sebastien.godard.pagesperso-orange.fr/sysstat-11.0.0.tar.gz
Resolving sebastien.godard.pagesperso-orange.fr (sebastien.godard.pagesperso-orange.fr)... 193.252.121.242
Reusing existing connection to pagesperso-orange.fr:80.
HTTP request sent, awaiting response... 200 OK
Length: 406880 (397K) [application/x-gzip]
Saving to: ‘ sysstat-11.0.0.tar.gz’ 
sysstat-11.0.0.tar. 100%[===================> ] 397.34K  --.-KB/s    in 0.009s  
2018-01-12 10:48:06 (43.8 MB/s) - ‘ sysstat-11.0.0.tar.gz’  saved [406880/406880]

 

Once the download is done, you need to extract the tar package by running the following command.

┌─[root@linuxhelp]─[~]
└──╼ #tar -xvf sysstat-11.0.0.tar.gz
sysstat-11.0.0/
sysstat-11.0.0/cifsiostat.c
sysstat-11.0.0/FAQ
sysstat-11.0.0/ioconf.h
sysstat-11.0.0/rd_stats.h
sysstat-11.0.0/COPYING
sysstat-11.0.0/common.h
sysstat-11.0.0/sysconfig.in
sysstat-11.0.0/mpstat.h
sysstat-11.0.0/rndr_stats.h
sysstat-11.0.0/nfsiostat-sysstat.h
sysstat-11.0.0/count.c
sysstat-11.0.0/contrib/
sysstat-11.0.0/contrib/isag/
sysstat-11.0.0/contrib/isag/README-isag
sysstat-11.0.0/contrib/isag/isag.in
sysstat-11.0.0/contrib/isag/isag.1
..
.
.
.
sysstat-11.0.0/configure.in
sysstat-11.0.0/activity.c
sysstat-11.0.0/sar.c 
sysstat-11.0.0/iostat.c
sysstat-11.0.0/rd_sensors.c
sysstat-11.0.0/prealloc.in
sysstat-11.0.0/sysstat-11.0.0.spec

 

Now, move to the extracted directory by running the following command.

┌─[root@linuxhelp]─[~]
└──╼ #cd sysstat-11.0.0

 

And then you can start the sysstat compilation process by running the following command.

┌─[root@linuxhelp]─[~/sysstat-11.0.0]
└──╼ #./iconfig
Welcome to sysstat' s Interactive Configuration script!
This script enables you to set the parameters value used by ./configure.
Please enter the value for the parameters listed below.
Press Return to tell ./configure to use the default value or to try to guess the proper one.
Defaut value for yes/no questions is no (parameter is NOT set).
You can enter a ? to display a help message at any time...

Installation directory: [--prefix] 
sadc directory: [sa_lib_dir] 
System activity directory: [sa_dir]
.
.
.
. 
config.status: creating contrib/isag/isag
config.status: creating Makefile

   Sysstat version:        11.0.0
   Installation prefix:        /usr/local
   rc directory:        /etc
   Init directory:        /etc/init.d
   Systemd unit dir:        /lib/systemd/system
   Configuration directory:    /etc/sysconfig
   Man pages directory:        ${datarootdir}/man
   Compiler:            gcc

 

You can also compile sysstat package by using   ./configure command as follows.

┌─[root@linuxhelp]─[~/sysstat-11.0.0]
└──╼ # ./configure 
.
Check programs:
.
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
.
.
.
.
Sysstat version:        11.0.0
Installation prefix:        /usr/local
rc directory:        /etc
Init directory:        /etc/init.d
Systemd unit dir:        /lib/systemd/system
Configuration directory:    /etc/sysconfig
Man pages directory:        ${datarootdir}/man
Compiler:            gcc
Compiler flags:        -g -O2

 

 

Once the compilation is done, you can run the make command.  

┌─[root@linuxhelp]─[~/sysstat-11.0.0]
└──╼ #make
gcc -o sadc.o -c -g -O2 -Wall -Wstrict-prototypes -pipe -O2  -DSA_DIR=" /var/log/sa"  -DSADC_PATH=" /usr/local/lib/sa/sadc"   -DUSE_NLS -DPACKAGE=" sysstat"  -DLOCALEDIR=" /usr/local/share/locale"  sadc.c
In file included from sa.h:11:0,
                 from sadc.c:37:
sadc.c: In function ‘ sa_sys_init’ :
sadc.c:315:61: warning: ‘ *’  in boolean context, suggest ‘ & & ’  instead [-Wint-in-bool-context]
    SREALLOC(act[i]-> _buf0, void, act[i]-> msize * act[i]-> nr * act[i]-> nr2) 
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
common.h:93:16: note: in definition of macro ‘ SREALLOC’ 
            if (SIZE) {       
                ^~~~
sadc.c: In function ‘ open_ofile’ :
sadc.c:967:61: warning: ‘ *’  in boolean context, suggest ‘ & & ’  instead [-Wint-in-bool-context]
    SREALLOC(act[p]-> _buf0, void, act[p]-> msize * act[p]-> nr * act[p]-> nr2) 
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
common.h:93:16: note: in definition of macro ‘ SREALLOC’ 
            if (SIZE) {       
                ^~~~
.
.
.
.
msgfmt -o nls/fi.gmo nls/fi.po
msgfmt -o nls/nl.gmo nls/nl.po
msgfmt -o nls/ru.gmo nls/ru.po
msgfmt -o nls/zh_CN.gmo nls/zh_CN.po
msgfmt -o nls/sk.gmo nls/sk.po
msgfmt -o nls/hu.gmo nls/hu.po
msgfmt -o nls/zh_TW.gmo nls/zh_TW.po
msgfmt -o nls/pt.gmo nls/pt.po

 

And then run the make install command.

┌─[root@linuxhelp]─[~/sysstat-11.0.0]
└──╼ #make install
make: Warning: Archive ' librdsensors.a'  seems to have been created in deterministic mode. ' rd_sensors.o'  will always be updated. Please consider passing the U flag to ar to avoid the problem.
ar rv librdsensors.a rd_sensors.o
r - rd_sensors.o
make: Warning: Archive ' librdsensors.a'  seems to have been created in deterministic mode. ' rd_sensors.o'  will always be updated. Please consider passing the U flag to ar to avoid the problem.
gcc -o sadc -g -O2 -Wall -Wstrict-prototypes -pipe -O2 sadc.o act_sadc.o sa_wrap.o sa_common.o librdstats.a librdsensors.a libsyscom.a -s 
mkdir -p /usr/local/share/man/man1
mkdir -p /usr/local/share/man/man5
mkdir -p /usr/local/share/man/man8
rm -f /usr/local/share/man/man8/sa1.8*
install -m 644 -g man man/sa1.8 /usr/local/share/man/man8
rm -f /usr/local/share/man/man8/sa2.8*
install -m 644 -g man man/sa2.8 /usr/local/share/man/man8
rm -f /usr/local/share/man/man8/sadc.8*
install -m 644 -g man man/sadc.8 /usr/local/share/man/man8
rm -f /usr/local/share/man/man1/sar.1*
install -m 644 -g man man/sar.1 /usr/local/share/man/man1
rm -f /usr/local/share/man/man1/sadf.1*
.
.
.
.
install -m 644 CHANGES /usr/local/share/doc/sysstat-11.0.0
install -m 644 COPYING /usr/local/share/doc/sysstat-11.0.0
install -m 644 CREDITS /usr/local/share/doc/sysstat-11.0.0
install -m 644 README /usr/local/share/doc/sysstat-11.0.0
install -m 644 FAQ /usr/local/share/doc/sysstat-11.0.0
install -m 644 *.lsm /usr/local/share/doc/sysstat-11.0.0

 

 

By the end of the above process, the installation gets completed. You can verify your installed sysstat by checking its version. Run the following command for the same process.

┌─[root@linuxhelp]─[~/sysstat-11.0.0]
└──╼ #mpstat -V
sysstat version 11.0.0
(C) Sebastien Godard (sysstat < at>  orange.fr)

 

With this, the installation of Sysstat on ParrotOs 3.9 comes to an end. 
   

FAQ
Q
I tried to use options -s and -e with sadf. Unfortunately, I have nothing displayed at all?
A
This is because no data belong to the specified time interval! The time specified with options -s and -e is now always considered as being given in local time to be consistent with sar default output. Remember that timestamps are displayed by sadf in UTC (Coordinated Universal Time) by default. Use option -T to tell sadf to display them in local time.
Q
Does sar need a lot of resources to run?
A
No, sar doesn't need a lot of CPU to run, nor does it make your system slow, contrary to what some people think. In the first place, it only runs every ten minutes by default. Secondly, when it does run, it is over and done very quickly. Try:

$ time /usr/lib/sa/sa1
Q
What are its essential features?
A
iostat used to report all statistics about your CPU and I/O statistics for I/O devices. nfsiostat-sysstat used to I/O statistics for NFS. sa2 used to summaries daily report to be used with sa
Q
Where can I get the latest stable version?
A
check it from here http://sebastien.godard.pagesperso-orange.fr/download.html
Q
What is sysstat and what for it is used?
A
Sysstat is one of the powerful monitoring tool to track the system statistics and to troubleshoot the issues. This tutorial covers the ground on the installation procedure of sysstat tool