February 17, 2019

dnsmasq.log - root partition is full VCSA 6.5

In the Morning got alerts regarding the VCSA Health ,I logged to VCSA Management Interface 

https://vcentercerver:5480

I can see some Helth warning on VCSA, SSH to VCSA using putty and immediately Noticed that  /root partition is full..



Then I dig deeper to find which files causing the issue and find the culprit bunch of dnsmasq.log files were created in the /var/log directory.  



Found KB related the issue that I'm having .. seems like it is safe to remove larger log files as a quick solution, it cleared most of the space and now I have free space.. 




Still I need a permanent solution for this .. Time to follow the KB and add parameters to Log rotate..   

First edit Log rotate for dnsmasq

vi /etc/logrotate.d/dnsmasq
Update the file to contain these lines and save the file:
/var/log/vmware/dnsmasq.log {
nodateext
daily
missingok
notifempty
compress
maxsize 5M
rotate 5
sharedscripts
postrotate
[ ! -f /var/run/dnsmasq.pid ] || kill -USR2 `cat /var/run/dnsmasq.pid`
endscript
create 0640 dnsmasq dnsmasq
}


Then update the dnsmasq.conf

vi /etc/dnsmasq.conf

Update the file to contain these lines and save the file:

listen-address=127.0.0.1
bind-interfaces
user=dnsmasq
group=dnsmasq

no-negcache
no-hosts
log-queries
log-facility=/var/log/vmware/dnsmasq.log
domain-needed
dns-forward-max=150
cache-size=8192
neg-ttl=3600 

finally restart dnsmasq service

service dnsmasq restart 

new log files are much smaller and they are zipped.

 

VMware KB shows that this issue resolved in below version.