sysstat – sar Invalid system activity file: /var/log/sysstat/sa19

After a recent upgrade (not sure which) the sar command stopped working, with the error output:

Invalid system activity file: /var/log/sysstat/sa19

The saXX can be any number, and relates to the log file – which for some reason is corrupt/missing/unreadable. In my case it seems to exist, but doesn’t function.

I’ve found the best remedy to this to be purging sysstat from the system and reinstalling it, fairly trivial to script for multiple machines and seems to have fixed it up just fine.

Here’s the command to run to fix it:

sudo aptitude update; \
sudo aptitude purge sysstat -y; \
sudo aptitude install sysstat -y; \
sudo sed -i "s/ENABLED=\"false\"/ENABLED=\"true\"/" /etc/default/sysstat; \
sudo /etc/init.d/sysstat start \
/

The lines from top to bottom update the repo list, remove sysstat and purge it’s settings, install sysstat, set the sysstat config file to true so it runs, then start the sysstat daemon.

It should be rocking again after that 🙂

root@server1:/var/log/sysstat# sar
Linux 3.8.4-x86_64 (server1)         04/19/2013      _x86_64_        (8 CPU)

08:59:15 AM       LINUX RESTART

Comments

comments

Subscribe

You can subscribe via e-mail to get my posts in your Inbox, or stalk me on numerous other platforms.

Follow my Dayre!

, , , , , , ,


Comments are closed.