Linux sysstat Installation and Use

Source: Internet
Author: User

1. About Sysstat;
Sysstat is a software package that includes a set of tools to monitor system performance and efficiency. These tools collect system performance data for us, such as CPU usage, hard disk and network throughput data, the collection and analysis of these data helps us determine whether the system is operating normally. It is a good assistant to improve the system operation efficiency and run the server safely;


The Sysstat Software Package integrates the following tools:

* The iostat tool provides data on CPU usage and Hard Disk Throughput efficiency;
* The mpstat tool provides data related to a single processor or multiple processors;
* The sar tool collects, reports, and stores active system information;
* The sa1 tool collects and stores the daily system dynamic information to a binary file. It runs through the scheduled task tool cron,
Is a program front-end program designed for sadc;
* The sa2 tool writes the daily system activity information to the summative report. It is a front-end designed for sar and needs to be called through cron
* Sadc is a system dynamic data collection tool. The collected data is written into a binary file and used as the backend of the sar tool;
* Sadf displays data collected by sar in multiple formats;


2. Install Sysstat and run it;
For most systems, this software package is available. The software name starts with sysstat. We can install it through the network;


2.1 Debian or deb software package-based systems;

[Root @ localhost ~] # Apt-get install sysstat


2.2 Fedora system or system managed with RPM packages;

[Root @ localhost ~] # Yum install sysstat

If it is an RPM package, use the following command to install it;
[Root @ localhost ~] # Rpm-ivh sysstat *. rpm

For details about yum and rpm software package management tools, see Fedora/RedHat software package management guide.


2.3 Slackware system, for Slackware systems;

[Root @ localhost ~] # Installpkg sysstat *. pkg


2.4 compile and install the SDK through the source code package;
If you are using the source code package installation, please go to the official source code package http://perso.wanadoo.fr/sebastien.godard, currently the latest is sysstat-6.1.2;

If you think about the source code package, see: how to compile and install the source code package software
[Root @ localhost ~] # Tar zxvf sysstat-6.1.2.tar.gz
[Beinan @ localhost ~] $ Sysstat-6.1.2 cd
[Beinan @ localhost sysstat-6.1.2] #
[Beinan @ localhost sysstat-6.1.2] # make config
[Beinan @ localhost sysstat-6.1.2] # make
[Beinan @ localhost sysstat-6.1.2] # make install


2.5 about Sysstat scheduled tasks;
If you want the system information collected by the Sysstat tool set to be automatically stored in a file, you must perform the scheduled task for sa1 and sa2. You can modify the user's crontab. By default, Sysstat history is stored in the/var/log/sa file. If you want to define your own scheduled tasks, see: Planning Task tool cron configuration and description

In the root user, add the following section through crontab-e;
# 8am-7pm activity reports every 10 minutes during weekdays
0 8-18 ** 1-5/usr/lib/sa/sa1 600 6 &
# 7pm-8am activity reports every hour during weekdays
0 19-7 ** 1-5/usr/lib/sa/sa1 &
# Activity reports every hour on Saturday and Sunday
0 *** 0, 6/usr/lib/sa/sa1 &
# Daily summary prepared at 19: 05 5 19 ***/usr/lib/sa/sa2-&

Create the Sysstat STARTUP script;
[Root @ localhost ~] # Touch/etc/rc. d/init. d/sysstat
[Root @ localhost ~] # Vi/etc/rc. d/init. d/sysstat


#! /Bin/sh
# Begin $ rc_base/init. d/sysstat

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans-gerard@linuxfromscratch.org

./Etc/sysconfig/rc
. $ Rc_functions

Case "$1" in
Start)
Echo "Calling the system activity data collector (sadc )..."
/Usr/lib/sa/sadc-F-L-
Evaluate_retval
;;
*)

Echo "Usage: $0 start"
Exit 1
;;
Esac

# End $ rc_base/init. d/sysstat


[Root @ localhost ~] # Chmod 755/etc/rc. d/init. d/sysstat
[Root @ localhost ~] # Ln-sf/etc/rc. d/init. d/sysstat/etc/init. d/sysstat

With the Sysstat daemon, The Sysstat daemon always serves us after we start the system. Sa, sa1, or sa2 automatically store the information in the binary file of the/var/log/sa directory. We can use the sar tool to extract the history of the system information;

Of course, we can also manually open the Sysstat daemon, that is, the sysstat we created earlier;


[Root @ localhost ~] #/Etc/rc. d/init. d/sysstat start

The following methods are also supported;

[Root @ localhost ~] #/Usr/lib/sa/sa1
[Root @ localhost ~] #/Usr/lib/sa/sa2

Sysstat details: click here
Sysstat: click here

Monitor Linux parameters through sysstat

Install sysstat in SUSE

 

This article is not complete. Continue to read the content on page 1:

  • 1
  • 2
  • 3
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.