Hello, @Atanu Gupta !
How do I prevent the OmsAgent logs from taking up local disk space on my VM?
You may notice that omsconfigdetailed.log
and omsconfig.log
are taking up space on your VM. While there is currently no way to disable these logs, you are able to change the size of the logs using the logratate
settings.
Additionally, you can consider using the new Azure Monitor Agent (AMA), which doesn't run into this issue. The legacy Log Analytics agent (OMS) will be deprecated by August 2024.
This GitHub issue goes into more detail on logratate
:
https://github.com/microsoft/omi/issues/531#issuecomment-398624551
omsconfig's logrotate setting like below:
https://github.com/Microsoft/PowerShell-DSC-for-Linux/blob/master/Providers/Extras/Scripts/omsconfig_logrotate.confjumping@jumping-ub14:/root$ cat /etc/logrotate.d/omsconfig
/var/opt/microsoft/omsconfig/omsconfig.log {
rotate 5
sharedscripts
weekly
size 50M
compress
}/var/opt/microsoft/omsconfig/omsconfigdetailed.log {
rotate 5
sharedscripts
size 50M
compress
}
jumping@jumping-ub14:/root$
Additional reference: