-----------------------------------
Affected Roles: Administrator, Owner
Related Digital Watchdog VMS Apps: DW Spectrum® IPVMS
Last Edit: January 21, 2022
-----------------------------------
Sysstat is a system monitoring tool that can be used to track the performance and usage of system resources. Additionally, Sysstat features a tool that can be scheduled to collect system performance and activity data by using cron.
This article will outline how to install and use the Sysstat System Performance Activity Monitoring Tool for Linux.
**NOTE: This is an optional, supplemental tool that can be installed for Linux-based DW Spectrum® Servers. DW Blackjack® Servers shipping with Ubuntu 18.04 will come pre-loaded with this tool.
By default, DW Blackjack® Servers have OS updates disabled to prevent unexpected operating issues that may occur from auto-updates.
As so, Servers using Ubuntu have repository access disabled by default as well.
To install the Sysstat System Performance and Usage Activity Monitoring Tool, the repository will need to be made accessible to acquire the installation files. If Sysstat is already installed and you are just seeking operating instructions, you can skip to the Sysstat Features and Commands section.
**DISCLAIMER: Please be aware that DW Blackjack® Servers have OS updates and repository access disabled by default. Altering a DW Blackjack® Server’s OS configuration from default settings are performed at the owner’s risk.
**NOTE: When using the Linux command line, be aware that commands are case-sensitive. Press the ENTER key after each command, unless otherwise instructed.
Alternatively, you can simultaneously press the Ctrl+Alt+T keys on the keyboard to launch the Terminal program.
To add the repository, use the command:
sudo add-apt-repository “deb http://us.archive.ubuntu.com/ubuntu/ xenial universe multiverse”
Dw5pectrum
**NOTE: For older DW Blackjack units purchased prior to June 18, 2021, the previously utilized default Linux OS login was “admin/admin”.
sudo add-apt-repository “deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe multiverse”
sudo add-apt-repository “deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe multiverse”
Follow with command:
sudo apt-get update
You may enter the command again to double-check that the available updated data packages have been obtained by the computer.
sudo apt-get update
If an error occurs while attempting to add the repository, there is a chance that the atp-get command may be encountering issues when retrieving third-party dependencies. For example, such an error may display as:
The following packages have unmet dependencies:
E: Unable to correct problems, you have held broken packages.
If you encounter an issue with repository access or package corruption, refer to Repairing Broken Repository Dependencies for Ubuntu Servers for troubleshooting help.
The Sysstat installation package can be found in the default repository as a package in all major Linux distributions or can be obtained manually if needed.
Otherwise, to acquire Sysstat version 12.5.4:
Alternatively, you can simultaneously press the Ctrl+Alt+T keys on the keyboard to launch the Terminal program.
Download the latest version of the syssstat package by using the command:
wget http://pagesperso-orange.fr/sebastien.godard/sysstat-12.5.4.tar.gz
**NOTE: If you must download a different version than Sysstat v12.5.4, change the version number at the end of the command. For example, to download version 11.0.0 instead, the command would be “wget http://pagesperso-orange.fr/sebastien.godard/sysstat-11.0.0.tar.gz”.
Use the commands:
tar –xvf sysstat-12.5.4.tar.gz
cd sysstat-12.5.4/
sysstat-12.5.4 ./iconfig
sysstat-12.5.4 ./configure --help
./configure
make
make install
Verify the sysstat version by using the command:
mpstat -V
By default, sysstat uses “/usr/local” as its prefix directory, while all binary/utilities are installed in the “/usr/local/bin” directory.
However, if there is an existing sysstat package already installed, it will be stored in the “/usr/bin” directory. This is due to the existing sysstat package preventing updated versions from being reflected as the “$PATH” variable does not have the “/usr/local/bin” directory set.
If there is an existing sysstat package installed, but the tool must be upgraded, remove the existing sysstat version and make sure that “/usr/local/bin” exists in the “$PATH” or set the –prefix option to “/usr” during the compilation process before updating.
apt-get remove sysstat
./configure --prefix=usr
make
make install
mpstat -V
The following are included tools included in the Sysstat packages:
Feature |
Description |
iostat |
displays a report of all statististics about the CPU and I/O statistics for I/O devices |
mpstat |
displays details about the system's CPUs (individual or combined) |
pidstat |
displays statistics about running processes/tasks, CPU, memory, etc. |
sar |
saves and reports details about different resources (CPU, memory, IO, network, kernel, etc.) |
sadc |
used for collecting system activity data on the backend for sar |
sa1 |
fetches and stores binary data in the sadc data file |
sa2 |
summarizes daily reports with sar |
Sadf |
displays data generated by sar in different formats (CSV or XML) |
Sysstat |
shows the main page for the sysstat utility |
nfsiostat-sysstat |
shows I/O statistics for NFS |
cifsiostat |
shows statistics for CIFS |
The mpstat feature can be used to view statistical data on the performance of a system’s CPUs, for both single and dual systems.
The following commands can be utilized for use with the mpstat feature.
mpstat
mpstat –P ALL
mpstat –P ALL <N> <n>
**NOTE: The example below is set for two (2) iterations at five (5) second intervals.
mpstat –I
mpstat –A
The pidstat feature can be used to monitor processing and currently running threads that are managed by the kernel.
The following commands can be utilized for use with the pidstat feature.
pidstat
pidstat –p ALL
pidstat –d <n>
**NOTE: The example below is set to display I/O statistics at two (2) second intervals.
pidstat –t –p <x> <n> <z>
**NOTE: The example below is set to display CPU statistics for Process ID (4164) at a time interval of two (2) seconds, three (3) times.
pidstat –rh <n> <z>
**NOTE: The example below is set to display memory statistics at a time interval of two (2) seconds, three (3) times.
pidstat –G <x>
**NOTE: The example below is set to display processes of the VBox service.
pidstat –t –G <x>
**NOTE: The example below is set to display processes of the VBox service.
pidstat -R
The sar feature can be used to obtain reports about the system’s overall performance. It does this by calculating the rates and ratio of system request completion times and I/O counts that are tracked by the Linux Kernal by default. This can be helpful when trying to identify system bottlenecks that may be causing performance issues.
**NOTE: The sar feature reports all activities over a period of time. This means that sar is only useful when used during period of normal operation, rather than during periods of downtime such as during weekends or holidays.
The following commands can be used for the sar feature:
sar –u –o sarfile <n> <N>
**NOTE: The example below is set to a time interval of two (2) seconds, five (5) times.
Use the following cron entries to make this non-interactive:
In the above example, the sa1 script will call for the sadc (System Activity Data Collector) utility to fetch the data at a two (2) second interval.
The sa2 script will call for the sar utility to change the binary log file into a human-readable form.
sar –q <n> <N>
**NOTE: The example below is set to a time interval of two (2) seconds, five (5) times.
sar –F <n> <N>
**NOTE: The example below is set to a time interval of two (2) seconds, four (4) times.
sar –n DEV <n> <N> | egrep –v lo
sar –d <n> <N>
sar –r <n> <N>
safd –d <log file directory> -- -n DEV | grep –v lo