question

JohnJessee-0343 avatar image
0 Votes"
JohnJessee-0343 asked learn2skills commented

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

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

learn2skills avatar image
1 Vote"
learn2skills answered learn2skills commented

Hi @JohnJessee-0343

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://docs.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.




· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This worked perfectly. I use logrotate all the time, but didn't know the impact of the omiserver.log file being rotated. Easy fix. Thanks.

0 Votes 0 ·

You're Welcome!

0 Votes 0 ·