sysstat - great utilities package to monitor performanceFollow @ggarron
sysstat is a package of monitoring tools, these are the tools included in the package.
- Reports CPU statistics and input/output statistics for devices, partitions and network filesystems.
- Reports individual or combined processor related statistics.
- Reports statistics for Linux tasks (processes) : I/O, CPU, memory, etc.
- Collects, reports and saves system activity information (CPU, memory, disks, interrupts, network interfaces, TTY, kernel tables,etc.)
- Is the system activity data collector, used as a backend for sar.
- Collects and stores binary data in the system activity daily data file. It is a front end to sadc designed to be run from cron.
- Writes a summarized daily activity report. It is a front end to sar designed to be run from cron.
- Displays data collected by sar in multiple formats (CSV, XML, etc.) This is useful to load performance data into a database, or import them in a spreadsheet to make graphs. To use this tools, you need to install
apt-get install sysstatOne great feature of this tools is that you can configure it to run as a daemon, and it will log a lot of info about your system. To start it if you are using Debian, edit with your favorite text editor, in my case is vi
vim /etc/default/sysstatAnd change the line: ENABLED="false" to ENABLED="true", so that file may look like this
# # Default settings for /etc/init.d/sysstat, /etc/cron.d/sysstat # and /etc/cron.daily/sysstat files # # Should sadc collect system activity informations? Valid values # are "true" and "false". Please do not put other values, they # will be overwritten by debconf! ENABLED="true" # Additional options passed to sa1 by /etc/init.d/sysstat # and /etc/cron.d/sysstat # By default contains the `-d' option responsible for # generating disk statisitcs. SA1_OPTIONS="-d" # Additional options passed to sa2 by /etc/cron.daily/sysstat. SA2_OPTIONS=""
sa1is a variant of
sadc, which is designed to work as a cronjob, just like
sa2which is a variant of
sarcommand also designed to be run as cronjob. If you are not using Debian, you will not have the
/etc/default/sysstat, so you will have to add to your root's cronjob file this lines:
0 8-18 * * 1-5 /usr/lib/sysstat/sa1 1200 3 & 5 19 * * 1-5 /usr/lib/sysstat/sa2 -A &The -d option in sa1 makes it to store disks data, which by default are not written. Now you can use
sarto see the data stored, in your system, check the page of the project for more information about this performance toolkit