Log rotation for SNMP Trap logs

Hi there,

I have Librenms integrated with SNMPTRAPD. Save logs in /var/log/snmptrap/traps.log.

Does anyone know how to make Log rotation?

Thank you :slight_smile:
Regards

Jeff Deng

Sure.

in /etc/logrotate.d/ i have a file created with the name snmptrapd and in the file I have this:

/var/log/snmptrap/*.log {
        hourly
        missingok
        rotate 24
        delaycompress
        notifempty
        compress
        postrotate
                /bin/systemctl restart snmptrapd.service > /dev/null 2>/dev/null || true
        endscript
}

Thanks, I am going to try this :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.