NagiosXI logrotate not working
Posted: Fri Nov 17, 2023 1:20 am
I read somewhere that NagiosXI should have automatic Logrotation feature. I have noticed that perhaps the logrotate is not working, because my log files are getting big. I have not touched the logrotate conf files, but is there something I should configure for the logrotate to start working?
The settings are at the moment:
PRODDIR/var/*log {
missingok
notifempty
size 5M
copytruncate
su NAGIOSUSER NAGIOSGROUP
rotate 1
compress
}
PRODDIR/var/xidebug.log {
missingok
notifempty
size 100M
copytruncate
create 0660 APACHEUSER NAGIOSGROUP
su APACHEUSER NAGIOSGROUP
rotate 1
compress
}
PRODDIR/var/xidebug.log.backtrace {
missingok
notifempty
size 100M
copytruncate
create 0660 APACHEUSER NAGIOSGROUP
su APACHEUSER NAGIOSGROUP
rotate 1
compress
}
PRODDIR/var/components/auditlog.log {
missingok
notifempty
size 100M
copytruncate
create 0660 APACHEUSER NAGIOSGROUP
su APACHEUSER NAGIOSGROUP
rotate 1
compress
}
PRODDIR/tmp/phpmailer.log {
missingok
notifempty
size 100M
copytruncate
create 0660 APACHEUSER NAGIOSGROUP
su APACHEUSER NAGIOSGROUP
rotate 1
compress
}
When I run
"logrotate -d /etc/logrotate.d/nagiosxi"
I get:
reading config file /etc/logrotate.d/nagiosxi
error: /etc/logrotate.d/nagiosxi:1 unknown option 'PRODDIR' -- ignoring line
error: /etc/logrotate.d/nagiosxi:6 unknown user 'NAGIOSUSER'
The settings are at the moment:
PRODDIR/var/*log {
missingok
notifempty
size 5M
copytruncate
su NAGIOSUSER NAGIOSGROUP
rotate 1
compress
}
PRODDIR/var/xidebug.log {
missingok
notifempty
size 100M
copytruncate
create 0660 APACHEUSER NAGIOSGROUP
su APACHEUSER NAGIOSGROUP
rotate 1
compress
}
PRODDIR/var/xidebug.log.backtrace {
missingok
notifempty
size 100M
copytruncate
create 0660 APACHEUSER NAGIOSGROUP
su APACHEUSER NAGIOSGROUP
rotate 1
compress
}
PRODDIR/var/components/auditlog.log {
missingok
notifempty
size 100M
copytruncate
create 0660 APACHEUSER NAGIOSGROUP
su APACHEUSER NAGIOSGROUP
rotate 1
compress
}
PRODDIR/tmp/phpmailer.log {
missingok
notifempty
size 100M
copytruncate
create 0660 APACHEUSER NAGIOSGROUP
su APACHEUSER NAGIOSGROUP
rotate 1
compress
}
When I run
"logrotate -d /etc/logrotate.d/nagiosxi"
I get:
reading config file /etc/logrotate.d/nagiosxi
error: /etc/logrotate.d/nagiosxi:1 unknown option 'PRODDIR' -- ignoring line
error: /etc/logrotate.d/nagiosxi:6 unknown user 'NAGIOSUSER'