Nagios Logrotation removing notification on rotated files

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
jose-martins
Posts: 6
Joined: Tue Dec 18, 2012 6:48 am

Nagios Logrotation removing notification on rotated files

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios Logrotation removing notification on rotated file

Post by slansing »

Are you using the standard Logrotate tool?
jose-martins
Posts: 6
Joined: Tue Dec 18, 2012 6:48 am

Re: Nagios Logrotation removing notification on rotated file

Post 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?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Logrotation removing notification on rotated file

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jose-martins
Posts: 6
Joined: Tue Dec 18, 2012 6:48 am

Re: Nagios Logrotation removing notification on rotated file

Post by jose-martins »

They are there, and readable.
But they "lost" some information. As if they where filtered when they where rotated.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Logrotation removing notification on rotated file

Post by abrist »

hmmm. Never heard of that. What type of information is missing from the archived logs?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jose-martins
Posts: 6
Joined: Tue Dec 18, 2012 6:48 am

Re: Nagios Logrotation removing notification on rotated file

Post by jose-martins »

Notifications, for example.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Logrotation removing notification on rotated file

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jose-martins
Posts: 6
Joined: Tue Dec 18, 2012 6:48 am

Re: Nagios Logrotation removing notification on rotated file

Post by jose-martins »

Nope. The current file is all OK. Only the rotated logs are missing the notifications.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Logrotation removing notification on rotated file

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked