Nagios - Retention period for logrotate

James Corteciano james at linux-source.org
Sat Jun 5 17:52:12 CEST 2010


Hi Marc,

Thanks for your response. What can you suggest for this kind of scenario as
my boss requirement is to have the nagios logs remain within 6 months only?

At this moment, I just set "log_rotation_method=n" in nagios.cfg and I made
simple logrotation script as stated below.

/var/logrotation.d/nagios:

/var/log/nagios/*log {
daily
rotate 180
compress
dateext
missingok
notifempty
olddir /var/log/nagios/archives
sharedscripts
postrotate
        /sbin/service nagios reload > /dev/null 2>/dev/null || true
endscript
}

Would appreciate your help about this.

Thanks.

Regards,
James

On Sat, Jun 5, 2010 at 8:45 PM, Marc Powell <lists at xodus.org> wrote:

>
> On Jun 5, 2010, at 3:57 AM, James Corteciano wrote:
>
> > Dear List,
> >
> > I am running Nagios version 3.2.0 and the archive logs are located in
> /var/log/nagios/archive which doing log rotation everyday. How can I
> configure nagios that the archive logs retention period is six (6) months?
>
> There isn't a configuration option for this. Nagios will keep the log files
> indefinitely for reporting (you can go back 2+ years through the web
> interface).
>
> You can cron a simple find -exec rm to do that but be aware that you won't
> have any reporting capability beyond what you keep.
>
> Also, because you specifically mention it, using logrotate will break
> reporting in nagios. The file naming convention must be exact for nagios to
> find the files.
>
> --
> Marc
>
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when
> reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20100605/23678304/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list