snmptt log file not rolling over

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vijilants
Posts: 215
Joined: Wed Jun 12, 2013 2:50 pm

snmptt log file not rolling over

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: snmptt log file not rolling over

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vijilants
Posts: 215
Joined: Wed Jun 12, 2013 2:50 pm

Re: snmptt log file not rolling over

Post 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
}
[]#
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: snmptt log file not rolling over

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vijilants
Posts: 215
Joined: Wed Jun 12, 2013 2:50 pm

Re: snmptt log file not rolling over

Post 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]
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: snmptt log file not rolling over

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vijilants
Posts: 215
Joined: Wed Jun 12, 2013 2:50 pm

Re: snmptt log file not rolling over

Post by vijilants »

Thank you.

I will monitor this.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: snmptt log file not rolling over

Post by npolovenko »

@vijilants , Sounds good.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vijilants
Posts: 215
Joined: Wed Jun 12, 2013 2:50 pm

Re: snmptt log file not rolling over

Post by vijilants »

Thank you.

This is now working !
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: snmptt log file not rolling over

Post by npolovenko »

@vijilants, Thanks for the update. Closing this thread as resolved.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked