diff --git a/etc/CMakeLists.txt b/etc/CMakeLists.txt index 581466461..be4c60b8d 100644 --- a/etc/CMakeLists.txt +++ b/etc/CMakeLists.txt @@ -44,6 +44,7 @@ install_if_not_exists(icinga2/features-available/perfdata.conf ${CMAKE_INSTALL_S install_if_not_exists(icinga2/features-available/statusdata.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available) install_if_not_exists(icinga2/features-available/syslog.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available) install_if_not_exists(icinga2/scripts/mail-notification.sh ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/scripts) +install_if_not_exists(logrotate.d/icinga2 ${CMAKE_INSTALL_SYSCONFDIR}/logrotate.d) install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/features-enabled\")") install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ../features-available/checker.conf \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/features-enabled/checker.conf\")") diff --git a/etc/logrotate.d/icinga2 b/etc/logrotate.d/icinga2 new file mode 100644 index 000000000..4fed232e3 --- /dev/null +++ b/etc/logrotate.d/icinga2 @@ -0,0 +1,39 @@ +# ----- logrotate config ------------- +/var/log/icinga2/icinga2.log { + daily + rotate 90 + compress + delaycompress + missingok + notifempty + create 644 icinga icinga + copytruncate + #postrotate + # if /etc/init.d/icinga2 status > /dev/null ; then \ + # /etc/init.d/icinga2 reload > /dev/null; \ + # fi; + #endscript +} + +/var/log/icinga2/error.log { + daily + rotate 90 + compress + delaycompress + missingok + notifempty + create 644 icinga icinga + copytruncate +} + +/var/log/icinga2/debug.log { + hourly + rotate 90 + compress + delaycompress + missingok + notifempty + create 644 icinga icinga + copytruncate +} +