Linux – opening sar activity files error “Invalid system activity file”

command-line-interfacelinuxsar

Note: I opened this question on Stackoverflow first and realized that this is the right place for the question. Just stating that it is not a duplicate, already closed the question on SO.

I am new to sar(also new to serverfault) I am getting the following error when trying to open system activity files locally(using Ubuntu 12.04) that were imported from a server.

I placed the files under /home/someuser/logs and run the command sar -f sa08. The error I am getting is Invalid system activity file: sa08 Is there anything that I am not doing right?

Also, is there any other way to open the files without using sar?

Thank you

Best Answer

As per source code you will got this message when there is a differnce in version of sysstat package.Please make sure both server uses same sysstat package

sa_common.c

void handle_invalid_sa_file(int *fd, struct file_magic *file_magic, char *file,
                            int n)
{
    fprintf(stderr, _("Invalid system activity file: %s\n"), file);

    if ((n == FILE_MAGIC_SIZE) && (file_magic->sysstat_magic == SYSSTAT_MAGIC)) {
            /* This is a sysstat file, but this file has an old format */
            display_sa_file_version(stderr, file_magic);

            fprintf(stderr,
                    _("Current sysstat version can no longer read the format of this file (%#x)\n"),
                    file_magic->format_magic);
    }

    close (*fd);
    exit(3);
}