The problem is likely that Nagios is never killed/restarted so that it starts logging to a new log file. Here are a couple examples that show how you'd go about doing the postrotate
action.
/var/log/nagios/nagios.log {
daily
rotate 180
compress
dateext
missingok
notifempty
sharedscripts
postrotate
/sbin/service nagios reload > /dev/null 2>/dev/null || true
endscript
}
Or something more direct:
/var/log/nagios/nagios.log {
missingok
postrotate
/bin/kill -HUP `cat /var/run/nagios.pid 2> /dev/null` 2> /dev/null || true
endscript
}
Letting Nagios do it
However in newer versions of Nagios it actually will rotate its own log files. The included logrotate configuration file even states as much.
On a Fedora 19 install of Nagios version 3.5.1-1:
$ more /etc/logrotate.d/nagios
# Important! Nagios rotates its own logs. Only enable this logrotate if you
# know what you are doing!
# For more information please see "log_rotate_method" in:
# /etc/nagios/nagios.cfg
# ----- logrotate config -------------
#/var/log/nagios/*.log {
# missingok
# weekly
# notifempty
# nocompress
# create 644 nagios nagios
#}