Thursday, September 24, 2015

Configure sysstat on Antergos Linux

Installation

Install sysstat

pacman -S sysstat

Install a cron implementation

pacman -S cronie


Configuration

Configure crontab

Run crontab -e to open the crontab editor, and enter the following to setup automatic sysstat collection:

# Run system activity accounting tool every 10 minutes
*/10 * * * * /usr/lib/sa/sa1 1 1
# Generate a daily summary of process accounting at 23:53
53 23 * * * /usr/lib/sa/sa2 -A

Save and exit the crontab editor.

Configure cronie.service

touch /etc/crontab
systemctl enable cronie.service
systemctl start cronie.service

Verification

To check that historic syststat collection is working run:
ls -l /var/log/sa
and verify that a new file is created with the name san, where n is the numeric representation of the current day of the month. For instance, if you did this on September 24th, the file would be called /var/log/sa/sa24. Please note that it could take up to 10 minutes for this file to be created.

Troubleshooting

If the /var/log/sa directory is still empty, it is probably something wrong with the crontab or the cronie.service.

Check cronie.service

systemctl status cronie.service -l

Check system journal

journalctl -xn

No comments:

Post a Comment