Page 1 of 1

snmptt log file not rolling over

Posted: Thu Nov 15, 2018 8:52 am
by vijilants
Nagios XI version: 5.5.4
XI installed from: manual
XI UUID:
Release info: 3.10.0-862.11.6.el7.x86_64 x86_64
CentOS Linux release 7.5.1804 (Core)
Gnome is not installed

Can someone please assist.

I have noticed that since this system was migrated to a new platforrm the snmptt.log file is no longer rolling over and is now huge.

I'm not sure if this is also happening across other log files, but prior to migtrating to a new platform this used to roll in one week intervals and keep 4 weeks worth of rolled files.

Can you please advise ?

Thanks

Re: snmptt log file not rolling over

Posted: Thu Nov 15, 2018 1:19 pm
by npolovenko
Hello, @vijilants. Please upload the following file from your server:
/etc/logrotate.d/snmptt
Also, where is the snmptt.log located your new system?

Re: snmptt log file not rolling over

Posted: Fri Nov 16, 2018 7:08 am
by vijilants
npolovenko wrote:Hello, @vijilants. Please upload the following file from your server:
/etc/logrotate.d/snmptt
Also, where is the snmptt.log located your new system?
Thank you for your response.

The log is located in /var/log/snmptt/

Code: Select all

[]# more /etc/logrotate.d/snmptt
/var/log/snmptt/snmptt*.log /var/log/snmptt/snmptthandler.debug {
    weekly
    notifempty
    missingok
}

/var/log/snmptt/snmptt.debug {
    weekly
    notifempty
    missingok
    postrotate
        /etc/init.d/snmptt reload >/dev/null 2>/dev/null || true
    endscript
}
[]#

Re: snmptt log file not rolling over

Posted: Fri Nov 16, 2018 1:30 pm
by npolovenko
@vijilants, Lets check permissions on the /var/log/snmptt folder:
ls -ld /var/log/snmptt/
Then run the following command and let me know if you see any errors:
/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
Then right after that run this command and show me the output:
tail -20 /var/log/messages

Re: snmptt log file not rolling over

Posted: Mon Nov 19, 2018 4:23 am
by vijilants
npolovenko wrote:@vijilants, Lets check permissions on the /var/log/snmptt folder:
ls -ld /var/log/snmptt/
Then run the following command and let me know if you see any errors:
/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
Then right after that run this command and show me the output:
tail -20 /var/log/messages
Please see below:
# ls -ld /var/log/snmptt/
drwxrwxr-x 2 snmptt snmptt 73 Aug 24 11:23 /var/log/snmptt/
#
#
# /usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
error: skipping "/var/log/snmptt/snmptt.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/snmptt/snmpttsystem.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/snmptt/snmpttunknown.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/snmptt/snmptthandler.debug" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
error: skipping "/var/log/snmptt/snmptt.debug" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
#
#
# tail -20 /var/log/messages
Nov 19 09:20:01 londnms1 systemd: Started Session 1335743 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Starting Session 1335743 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Started Session 1335745 of user root.
Nov 19 09:20:01 londnms1 systemd: Starting Session 1335745 of user root.
Nov 19 09:20:01 londnms1 systemd: Started Session 1335746 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Starting Session 1335746 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Started Session 1335747 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Starting Session 1335747 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Started Session 1335750 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Starting Session 1335750 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Started Session 1335748 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Starting Session 1335748 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Started Session 1335749 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Starting Session 1335749 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Started Session 1335751 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Starting Session 1335751 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Started Session 1335752 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Starting Session 1335752 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Started Session 1335753 of user nagios.
Nov 19 09:20:01 londnms1 systemd: Starting Session 1335753 of user nagios.
# [/quote]

Re: snmptt log file not rolling over

Posted: Mon Nov 19, 2018 12:59 pm
by npolovenko
@vijilants, Please run the following command to change the ownership of the snmptt folder:
chown root:root /var/log/snmptt/
And then run this again:
/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf

Re: snmptt log file not rolling over

Posted: Tue Nov 20, 2018 8:18 am
by vijilants
Thank you.

I will monitor this.

Re: snmptt log file not rolling over

Posted: Tue Nov 20, 2018 12:13 pm
by npolovenko
@vijilants , Sounds good.

Re: snmptt log file not rolling over

Posted: Tue Nov 27, 2018 10:36 am
by vijilants
Thank you.

This is now working !

Re: snmptt log file not rolling over

Posted: Tue Nov 27, 2018 11:58 am
by npolovenko
@vijilants, Thanks for the update. Closing this thread as resolved.