If you just installed the sysstat package and you tried to ran sar
command you might end up getting the following error: Cannot open /var/log/sysstat/saXX: No such file or directory. Please check if data collecting is enabled”
The above means that sysstat is not enabled or configured to collect data.
Depending on your Linux Distribution (like CentOS) a restart of sysstat can fix the error : service sysstat restart
Next verify if sar started collecting data using the following : sar -p -d
If the above didn't fix the problem and you still get the same error you need to check in the sysstat config file the following line: ENABLED="false"
and edit this to ENABLED="true"
Save the setting and restart sysstat service service sysstat restart
sysstat should be able to collect data now and after a few seconds you will see that the initial error is no longer there.
