net-snmp Logrotate On CentOS

It turns out be defult net-snmp doesn’t come with logrotate for CentOS 7. However is quite simple to be done. All you have to do create a the following file: /etc/logrotate.d/snmpdlog and add the content below:

/var/log/snmpd.log {
weekly
rotate 4
compress
delaycompress
missingok
notifempty
sharedscripts
create 0644 root root
postrotate
/usr/bin/systemctl reload snmpd.service > /dev/null 2>/dev/null || true
endscript
}

This article will help you understanding each end every line of the fike

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.