Saksham Paliwal
Saksham Paliwal

Reputation: 483

sar Reports Every 10 Minutes Instead of Configured Minutes on Ubuntu

I've installed sysstat on my Ubuntu system and configured sar to collect data every 2 minutes. However, it continues to report every 10 minutes instead.

Here's what I've done so far:

  1. I installed sysstat using sudo apt install sysstat.
  2. I modified the configuration file at /etc/default/sysstat to enable data collection.
  3. In /etc/sysstat/sysstat, I set the INTERVAL parameter to 2.

My /etc/default/sysstat file looks like this:

# The first element of the path is a directory where the debian-sa1
# script is located
PATH=/usr/lib/sysstat:/usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin

# Activity reports every 10 minutes everyday
*/2 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1

# Additional run at 23:59 to rotate the statistics file
00 23 * * * root command -v debian-sa1 > /dev/null && debian-sa1 60 2

Despite these changes, the output still reflects a 10-minute interval. I've restarted the sysstat service with sudo service sysstat restart after making the changes. Even i restarted cron with this: sudo systemctl restart cron

Any help would be greatly appreciated!

Upvotes: -2

Views: 357

Answers (1)

devyy devyy
devyy devyy

Reputation: 1

First off, double-check your /etc/sysstat/sysstat file. Ensure that the INTERVAL parameter is actually set to 2.

Next, make sure your cron job in /etc/default/sysstat looks like this:

*/2 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1

After making these changes, did you restart both the sysstat service and the cron service? Use the following commands:

sudo service sysstat restart
sudo systemctl restart cron

Also, verify the permissions on the cron job. The debian-sa1 script needs to be executable. Lastly, check the logs for any errors. You can find these in /var/log/syslog or by running journalctl -u cron.

Upvotes: 0

Related Questions