Intro to System Reporting

One of the more vague of the RHCE Objectives says: "Produce and deliver reports on system utilization (processor, memory, disk, and network)." This loosely defined objective can be very wide-ranging. This section will cover some of the tools that might be useful in meeting that objective. We'll consider `sar`, which stands for System Activity Reports. This utility will collect, report, or save system activity information. The `sar` command writes to standard output the contents of selected cumulative activity counters in the operating system. It also extracts and writes to standard output records previously saved in a file. This file can be either the one specified by the -f flag or, by default, the standard system activity daily data file, located at '/var/log/sa/*' by default.

We'll also consider `top`, which can collect and save information to a file as well as display current information. Explore the man pages for these utilities and be prepared to use them with scripting to write reports to a file if you're preparing for the RHCSA/RHCE exam.

    //----------- top example -----------//
    `top -bi -n <x> -d <x> >> file.txt` - captures top summary info only into the indicated file; nice...

    //----------- sar examples from man page -----------//
    `sar -u 2 5`                        - report CPU utilization for each 2 seconds. 5 lines are displayed.
    `sar -I 14 -o int14.file 2 10`      - Statistics on IRQ 14 @ 2 seconds, 10 lines displayed, stored 'int14.file'.
    `sar -r -n DEV -f /var/log/sa/sa16` - display memory and network statistics saved in daily data file 'sa16'.
    `sar -A`                            - display all the statistics saved in current daily data file.

    //----------- sar stuff from personal experience -----------//
    `sar -u 5 10`       - display average processor stats at 5 second intervals 10 times
    `sar -n DEV 5 10`   - display network device stats at 5 second intervals 10 times
    `sar -n TCP 5 10`   - display tcp i/o at 5 second intervals 10 times

Listed below are some commands that can provide information as indicated.

Installing System Reporting

Check for the existence, or install, the coreutils, sysstat, and procps packages. As always, check the man pages for details.

System Reporting Commands & Services

The commands and utilities listed in this section can be initiated, scripted, and/or configured in `cron` jobs to establish a reporting mechanism.

Additional Notes & Considerations for System Reporting

There is a contemporary tool available that combines most (if not all) of the above information in one place. It's called `nmon`, and there is an analyzer available that will format the output reports. You can find more information at NMON Performance Analyzer .

Reference Material for this Chapter

For this chapter's supporting material, please reference Chapters 5, 9, & 12 in the RHCSA/RHCE Linux Certification Study Guide text book.



[21] Pass the -h flag for a "human-readable" numeric output.

[22] Pass the -hs flags to get a summary output in "human-readable" numeric output.

[23] This command also lists what is known as the system load. We'll discuss this important concept in class.