[f384a9d] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
| 7 | <!ENTITY sysstat-download-http "http://perso.wanadoo.fr/sebastien.godard/sysstat-5.0.5.tar.gz">
|
---|
| 8 | <!ENTITY sysstat-download-ftp "ftp://ibiblio.org/pub/linux/system/status/sysstat-5.0.5.tar.gz">
|
---|
| 9 | <!ENTITY sysstat-size "123 KB">
|
---|
| 10 | <!ENTITY sysstat-buildsize "1.2 MB">
|
---|
| 11 | <!ENTITY sysstat-time ".12 SBU">
|
---|
| 12 | ]>
|
---|
| 13 |
|
---|
| 14 | <sect1 id="sysstat" xreflabel="Sysstat-&sysstat-version;">
|
---|
| 15 | <?dbhtml filename="sysstat.html"?>
|
---|
| 16 | <title>Sysstat-&sysstat-version;</title>
|
---|
| 17 |
|
---|
| 18 | <sect2>
|
---|
| 19 | <title>Introduction to <application>Sysstat</application></title>
|
---|
| 20 |
|
---|
| 21 | <para>The <application>Sysstat</application> package contains utilities to
|
---|
| 22 | monitor system performance and usage activity.
|
---|
| 23 | <application>Sysstat</application> contains the <command>sar</command> utility,
|
---|
| 24 | common to many commercial Unixes, and tools you can schedule via cron to collect
|
---|
| 25 | and historize performance and activity data.</para>
|
---|
| 26 |
|
---|
| 27 | <sect3><title>Package information</title>
|
---|
| 28 | <itemizedlist spacing='compact'>
|
---|
| 29 | <listitem><para>Download (HTTP): <ulink url="&sysstat-download-http;"/></para></listitem>
|
---|
| 30 | <listitem><para>Download (FTP): <ulink url="&sysstat-download-ftp;"/></para></listitem>
|
---|
| 31 | <listitem><para>Download size: &sysstat-size;</para></listitem>
|
---|
| 32 | <listitem><para>Estimated Disk space required: &sysstat-buildsize;</para></listitem>
|
---|
| 33 | <listitem><para>Estimated build time: &sysstat-time;</para></listitem></itemizedlist>
|
---|
| 34 | </sect3>
|
---|
| 35 |
|
---|
| 36 | <sect3><title><application>Sysstat</application> dependencies</title>
|
---|
| 37 | <sect4><title>Recommended</title>
|
---|
| 38 | <para><xref linkend="fcron"/></para></sect4>
|
---|
| 39 | </sect3>
|
---|
| 40 |
|
---|
| 41 | </sect2>
|
---|
| 42 |
|
---|
| 43 | <sect2>
|
---|
| 44 | <title>Installation of <application>Sysstat</application></title>
|
---|
| 45 |
|
---|
| 46 | <para>Install <application>Sysstat</application> by running the
|
---|
| 47 | following commands:</para>
|
---|
| 48 |
|
---|
| 49 | <screen><userinput><command>make config &&
|
---|
| 50 | make &&
|
---|
| 51 | make install</command></userinput></screen>
|
---|
| 52 |
|
---|
| 53 | </sect2>
|
---|
| 54 |
|
---|
| 55 | <sect2>
|
---|
| 56 | <title>Command explanations</title>
|
---|
| 57 |
|
---|
| 58 | <para><command>make config</command>: Runs the interactive configuration
|
---|
| 59 | process. The first question prompts you for an "Installation directory".
|
---|
| 60 | Reply with <filename class="directory">/usr</filename>, as this is equivalent
|
---|
| 61 | to <application>Autoconf</application>'s <parameter>--prefix=/usr</parameter>
|
---|
| 62 | parameter to <command>configure</command>. For all other prompts, you may
|
---|
| 63 | press <command>Enter</command> to accept the (very sane) defaults.</para>
|
---|
| 64 |
|
---|
| 65 | </sect2>
|
---|
| 66 |
|
---|
| 67 | <sect2>
|
---|
| 68 | <title>Configuring <application>Sysstat</application></title>
|
---|
| 69 |
|
---|
| 70 | <sect3><title>Cron information</title>
|
---|
| 71 |
|
---|
| 72 | <para>To begin gathering <application>Sysstat</application> history information,
|
---|
| 73 | you must add to, or create a privileged user's crontab. The default history
|
---|
| 74 | data location is <filename class="directory">/var/log/sa</filename>. The user
|
---|
| 75 | running <application>Sysstat</application> utilities via cron must have write
|
---|
| 76 | access to this location.</para>
|
---|
| 77 |
|
---|
| 78 | <para>Below is an example of what to install in the crontab. Adjust the
|
---|
| 79 | parameters to suit your needs. Use <command>man sa1</command> and
|
---|
| 80 | <command>man sa2</command> for information about the commands.</para>
|
---|
| 81 |
|
---|
| 82 | <screen><userinput># 8am-7pm activity reports every 10 minutes during weekdays
|
---|
| 83 | 0 8-18 * * 1-5 /usr/lib/sa/sa1 600 6 &
|
---|
| 84 |
|
---|
| 85 | # 7pm-8am activity reports every hour during weekdays
|
---|
| 86 | 0 19-7 * * 1-5 /usr/lib/sa/sa1 &
|
---|
| 87 |
|
---|
| 88 | # Activity reports every hour on Saturday and Sunday
|
---|
| 89 | 0 * * * 0,6 /usr/lib/sa/sa1 &
|
---|
| 90 |
|
---|
| 91 | # Daily summary prepared at 19:05
|
---|
| 92 | 5 19 * * * /usr/lib/sa/sa2 -A &</userinput></screen>
|
---|
| 93 |
|
---|
| 94 | <para>Ensure you submit the revised crontab to the cron daemon.</para>
|
---|
| 95 | </sect3>
|
---|
| 96 |
|
---|
| 97 | <sect3><title>Startup script information</title>
|
---|
| 98 |
|
---|
| 99 | <para>At system startup, a LINUX RESTART message must be inserted in the daily
|
---|
| 100 | data file to reinitialize the kernel counters. Create a
|
---|
| 101 | <filename>sysstat</filename> bootscript to accomplish this using the following
|
---|
| 102 | commands:</para>
|
---|
| 103 |
|
---|
| 104 | <screen><userinput><command>cat > /etc/rc.d/init.d/sysstat << "EOF"</command>
|
---|
| 105 | #!/bin/sh
|
---|
| 106 | # Begin $rc_base/init.d/sysstat
|
---|
| 107 |
|
---|
| 108 | # Based on sysklogd script from LFS-3.1 and earlier.
|
---|
| 109 | # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
---|
| 110 |
|
---|
| 111 | . /etc/sysconfig/rc
|
---|
| 112 | . $rc_functions
|
---|
| 113 |
|
---|
| 114 | case "$1" in
|
---|
| 115 | start)
|
---|
| 116 | echo "Calling the system activity data collector (sadc)..."
|
---|
| 117 | /usr/lib/sa/sadc -F -L -
|
---|
| 118 | evaluate_retval
|
---|
| 119 | ;;
|
---|
| 120 |
|
---|
| 121 | *)
|
---|
[be617a2] | 122 | echo "Usage: $0 start"
|
---|
[f384a9d] | 123 | exit 1
|
---|
| 124 | ;;
|
---|
| 125 | esac
|
---|
| 126 |
|
---|
| 127 | # End $rc_base/init.d/sysstat
|
---|
| 128 | <command>EOF
|
---|
| 129 | chmod 754 /etc/rc.d/init.d/sysstat</command></userinput></screen>
|
---|
| 130 |
|
---|
| 131 | <para>The <filename>sysstat</filename> bootscript only needs to run at
|
---|
| 132 | system startup, therefore only one symlink is required. Create this symlink in
|
---|
| 133 | <filename class="directory">/etc/rc.d/rcsysinit.d</filename> using the following
|
---|
| 134 | command:</para>
|
---|
| 135 |
|
---|
| 136 | <screen><userinput><command>ln -sf ../init.d/sysstat /etc/rc.d/rcsysinit.d/S85sysstat</command></userinput></screen>
|
---|
| 137 | </sect3>
|
---|
| 138 |
|
---|
| 139 | </sect2>
|
---|
| 140 |
|
---|
| 141 | <sect2>
|
---|
| 142 | <title>Contents</title>
|
---|
| 143 |
|
---|
| 144 | <para>The <application>Sysstat</application> package contains
|
---|
| 145 | <command>iostat</command>,
|
---|
| 146 | <command>mpstat</command>,
|
---|
| 147 | <command>sar</command>,
|
---|
| 148 | <filename>sa1</filename>,
|
---|
| 149 | <filename>sa2</filename> and
|
---|
| 150 | <filename>sadc</filename>.</para>
|
---|
| 151 |
|
---|
| 152 | </sect2>
|
---|
| 153 |
|
---|
| 154 | <sect2><title>Description</title>
|
---|
| 155 |
|
---|
| 156 | <sect3><title>iostat</title>
|
---|
| 157 | <para><command>iostat</command> reports <acronym>CPU</acronym> statistics and
|
---|
| 158 | input/output statistics for devices and partitions.</para></sect3>
|
---|
| 159 |
|
---|
| 160 | <sect3><title>mpstat</title>
|
---|
| 161 | <para><command>mpstat</command> reports individual or combined processor
|
---|
| 162 | related statistics.</para></sect3>
|
---|
| 163 |
|
---|
| 164 | <sect3><title>sar</title>
|
---|
| 165 | <para><command>sar</command> collects, reports and saves system activity
|
---|
| 166 | information.</para></sect3>
|
---|
| 167 |
|
---|
| 168 | <sect3><title>sa1</title>
|
---|
| 169 | <para><filename>sa1</filename> collects and stores binary data in the system
|
---|
| 170 | activity daily data file. It is a front end to <filename>sadc</filename>
|
---|
| 171 | designed to be run from cron.</para></sect3>
|
---|
| 172 |
|
---|
| 173 | <sect3><title>sa2</title>
|
---|
| 174 | <para><filename>sa2</filename> writes a summarized daily activity report. It
|
---|
| 175 | is a front end to <command>sar</command> designed to be run from
|
---|
| 176 | cron.</para></sect3>
|
---|
| 177 |
|
---|
| 178 | <sect3><title>sadc</title>
|
---|
| 179 | <para><filename>sadc</filename> is the system activity data collector, used as
|
---|
| 180 | a backend for <command>sar</command>.</para></sect3>
|
---|
| 181 |
|
---|
| 182 | </sect2>
|
---|
| 183 |
|
---|
| 184 | </sect1>
|
---|