Page 1 of 2

Nagios Logrotation removing notification on rotated files

Posted: Tue Dec 18, 2012 7:09 am
by jose-martins
Hello all.

I've been using Nagios on my corporation with great success.
But there's a behavior on logrotation that I not quite understand.

Logrotation is enabled, but no notifications are kept on rotated files.
log_file=/opt/nagios/nagios/var/nagios.log
log_rotation_method=d
log_archive_path=/opt/nagios/nagios/var/archives

For the current day (viewing the log_file), I get all notifications sent.
For any history (pressing the back red arrow), I always get the "No notifications have been recorded in this archived log file".

Any help solving/debugging, would be appreciated.

Re: Nagios Logrotation removing notification on rotated file

Posted: Thu Dec 20, 2012 4:02 pm
by slansing
Are you using the standard Logrotate tool?

Re: Nagios Logrotation removing notification on rotated file

Posted: Mon Jan 07, 2013 7:37 am
by jose-martins
I'm using Nagios logrotate method, didn't change anything.

How do I even debug such behaviour? Is there any "flag"/anything I can do to see logrotation steps and try and debug why is it not rotating some lines?

Re: Nagios Logrotation removing notification on rotated file

Posted: Mon Jan 07, 2013 10:41 am
by abrist
Are your logs being rotated correctly? Check the archives:

Code: Select all

ls -la /opt/nagios/nagios/var/archives
If they are there, tail one to make sure they are readable.

Re: Nagios Logrotation removing notification on rotated file

Posted: Tue Feb 12, 2013 7:07 am
by jose-martins
They are there, and readable.
But they "lost" some information. As if they where filtered when they where rotated.

Re: Nagios Logrotation removing notification on rotated file

Posted: Tue Feb 12, 2013 10:47 am
by abrist
hmmm. Never heard of that. What type of information is missing from the archived logs?

Re: Nagios Logrotation removing notification on rotated file

Posted: Tue Feb 12, 2013 11:17 am
by jose-martins
Notifications, for example.

Re: Nagios Logrotation removing notification on rotated file

Posted: Tue Feb 12, 2013 11:56 am
by abrist
Alright. Are there any notifications logged in the current nagios.log file? Or are the notification logs missing from that file as well?

Re: Nagios Logrotation removing notification on rotated file

Posted: Tue Feb 12, 2013 11:59 am
by jose-martins
Nope. The current file is all OK. Only the rotated logs are missing the notifications.

Re: Nagios Logrotation removing notification on rotated file

Posted: Tue Feb 12, 2013 12:11 pm
by abrist
Run the following command and post the results in a code wrap. We are going to check logging options in nagios.cfg

Code: Select all

$ cd [path to nagios.cfg dir]
$ cat nagios.cfg | grep log