/var/opt/omi/log/omiserver.log file is taking up 14G

John Jessee 21 Reputation points
2021-05-07T14:35:53.077+00:00

I have a CentOS VM that is starting to throw up warning that /dev/sda2 is running low on space. I searched and found that the /var/opt/omi/log/omiserver.log file is taking up 14G of space. Do I have any way of cleaning this log file or reducing the size?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,039 questions
0 comments No comments
{count} votes

Accepted answer
  1. SUNOJ KUMAR YELURU 15,491 Reputation points MVP Volunteer Moderator
    2021-05-07T14:45:05.34+00:00

    Hi @John Jessee

    UNIX and Linux do not limit the size of the agent log files. In order to control the maximum size of the log files, implement a process to manage the log files. For example, the standard utility logrotate is available on many UNIX and Linux operating systems. The logrotate utility can be configured to control the log files used by the Operations Manager Agents for UNIX or Linux.

    The following example demonstrates a configuration file to rotate the scx.log files as well as omiserver.log with the logrotate utility of Linux. Typically, logrotate will run as a scheduled job (with crond) and act on configuration files found in /etc/logrotate.d. To test and use this configuration file, modify the configuration to be appropriate for your environment, and link or save the file in /etc/logrotate.d.
    https://learn.microsoft.com/en-us/system-center/scom/manage-monitoring-unix-linux?view=sc-om-2019#example-logrotate-configuration-file
    https://www.redhat.com/sysadmin/setting-logrotate

    If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.