permission denied logrotate rule incorrect
permission denied logrotate rule incorrect
Hello,
Besides the selinux rules that needed to be in place..
chmod 660 /usr/local/nagiosxi/var/*.log
chown apache:nagios /usr/local/nagiosxi/var/*.log
vi /etc/logrotate.d/nagiosxi
and make this:
/usr/local/nagiosxi/var/*log {
missingok
notifempty
size 5M
rotate 1
compress
}
look like this:
/usr/local/nagiosxi/var/*log {
missingok
notifempty
size 5M
create 0660 apache nagios
rotate 1
compress
}
Thanks,
Brad
Besides the selinux rules that needed to be in place..
chmod 660 /usr/local/nagiosxi/var/*.log
chown apache:nagios /usr/local/nagiosxi/var/*.log
vi /etc/logrotate.d/nagiosxi
and make this:
/usr/local/nagiosxi/var/*log {
missingok
notifempty
size 5M
rotate 1
compress
}
look like this:
/usr/local/nagiosxi/var/*log {
missingok
notifempty
size 5M
create 0660 apache nagios
rotate 1
compress
}
Thanks,
Brad
Re: permission denied logrotate rule incorrect
I'm a bit confused here. Were you having issues with a log file and looking for a fix, or is this a proposed solution to one? What XI version is this for?
Former Nagios employee
Re: permission denied logrotate rule incorrect
A little bit of both I guess, seeing this from:
/etc/cron.daily/logrotate:
error: failed to rename /usr/local/nagiosxi/var/cleaner.log to /usr/local/nagiosxi/var/cleaner.log-20170718: Permission denied
error: failed to rename /usr/local/nagiosxi/var/dbmaint.log to /usr/local/nagiosxi/var/dbmaint.log-20170718: Permission denied
error: failed to rename /usr/local/nagiosxi/var/event_handler.log to /usr/local/nagiosxi/var/event_handler.log-20170718: Permission denied
error: failed to rename /usr/local/nagiosxi/var/eventman.log to /usr/local/nagiosxi/var/eventman.log-20170718: Permission denied
error: failed to rename /usr/local/nagiosxi/var/perfdataproc.log to /usr/local/nagiosxi/var/perfdataproc.log-20170718: Permission denied
error: failed to rename /usr/local/nagiosxi/var/sysstat.log to /usr/local/nagiosxi/var/sysstat.log-20170718: Permission denied
nagiosxi 5.4.5
Thanks,
Brad
/etc/cron.daily/logrotate:
error: failed to rename /usr/local/nagiosxi/var/cleaner.log to /usr/local/nagiosxi/var/cleaner.log-20170718: Permission denied
error: failed to rename /usr/local/nagiosxi/var/dbmaint.log to /usr/local/nagiosxi/var/dbmaint.log-20170718: Permission denied
error: failed to rename /usr/local/nagiosxi/var/event_handler.log to /usr/local/nagiosxi/var/event_handler.log-20170718: Permission denied
error: failed to rename /usr/local/nagiosxi/var/eventman.log to /usr/local/nagiosxi/var/eventman.log-20170718: Permission denied
error: failed to rename /usr/local/nagiosxi/var/perfdataproc.log to /usr/local/nagiosxi/var/perfdataproc.log-20170718: Permission denied
error: failed to rename /usr/local/nagiosxi/var/sysstat.log to /usr/local/nagiosxi/var/sysstat.log-20170718: Permission denied
nagiosxi 5.4.5
Thanks,
Brad
Re: permission denied logrotate rule incorrect
Another thing to check is that the folder permissions are set correctly for the nagios user account as well as the group.
That could be another cause for the error.
Code: Select all
/usr/local/nagiosxi/var/Code: Select all
drwxr-xr-x 5 nagios nagios 4096 Jul 18 16:38 varBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: permission denied logrotate rule incorrect
ls -la /usr/local/nagiosxi/var/
total 3720
drwxr-xr-x. 5 nagios nagios 4096 Jul 19 18:40 .
drwxr-xr-x. 10 nagios nagios 102 Jul 19 13:39 ..
-rw-r--r--. 1 nagios nagios 173186 Jul 19 18:40 cleaner.log
-rw-r--r--. 1 nagios nagios 272420 Jul 19 18:40 cmdsubsys.log
drwsrwsr-x. 2 apache nagios 6 Jul 19 13:39 components
-rw-r--r--. 1 nagios nagios 6 Jul 19 18:40 corelog.data
-rw-r--r--. 1 nagios nagios 0 Jul 19 18:40 corelog.diff
-rw-r--r--. 1 nagios nagios 179906 Jul 19 18:40 dbmaint.log
-rw-r--r-- 1 nagios users 0 Jul 19 18:40 event_handler.lock
-rw-r--r--. 1 nagios nagios 63148 Jul 19 18:40 event_handler.log
-rw-r--r--. 1 nagios nagios 31637 Jul 19 18:40 eventman.log
-rw-r--r--. 1 nagios nagios 36974 Jul 19 18:40 feedproc.log
-rw-r--r--. 1 nagios nagios 1069 Jul 19 16:13 load_url.log
-rw-r--r--. 1 nagios nagios 182886 Jul 19 16:42 nom.log
-rw-r--r--. 1 nagios nagios 159464 Jul 19 18:40 perfdataproc.log
-rw-r--r--. 1 nagios users 1365 Jul 19 18:01 recurringdowntime.log
-rw-r--r--. 1 nagios nagios 1908 Jul 19 14:28 reportengine.log
drwxr-xr-x. 2 nagios nagios 50 Jul 19 18:17 subsys
-rw-r--r--. 1 nagios nagios 2259660 Jul 19 18:40 sysstat.log
drwxr-xr-x. 2 nagios nagios 6 Jul 19 13:39 upgrades
-rw-r--r--. 1 nagios nagios 7 Jul 19 13:39 xi-itype
-rw-r--r--. 1 nagios nagios 12248 Jul 19 13:43 xi-sys.cfg
-rw-r--r--. 1 nagios nagios 37 Jul 19 13:39 xi-uuid
-rw-r--r--. 1 nagios nagios 196 Jul 19 13:43 xiversion
total 3720
drwxr-xr-x. 5 nagios nagios 4096 Jul 19 18:40 .
drwxr-xr-x. 10 nagios nagios 102 Jul 19 13:39 ..
-rw-r--r--. 1 nagios nagios 173186 Jul 19 18:40 cleaner.log
-rw-r--r--. 1 nagios nagios 272420 Jul 19 18:40 cmdsubsys.log
drwsrwsr-x. 2 apache nagios 6 Jul 19 13:39 components
-rw-r--r--. 1 nagios nagios 6 Jul 19 18:40 corelog.data
-rw-r--r--. 1 nagios nagios 0 Jul 19 18:40 corelog.diff
-rw-r--r--. 1 nagios nagios 179906 Jul 19 18:40 dbmaint.log
-rw-r--r-- 1 nagios users 0 Jul 19 18:40 event_handler.lock
-rw-r--r--. 1 nagios nagios 63148 Jul 19 18:40 event_handler.log
-rw-r--r--. 1 nagios nagios 31637 Jul 19 18:40 eventman.log
-rw-r--r--. 1 nagios nagios 36974 Jul 19 18:40 feedproc.log
-rw-r--r--. 1 nagios nagios 1069 Jul 19 16:13 load_url.log
-rw-r--r--. 1 nagios nagios 182886 Jul 19 16:42 nom.log
-rw-r--r--. 1 nagios nagios 159464 Jul 19 18:40 perfdataproc.log
-rw-r--r--. 1 nagios users 1365 Jul 19 18:01 recurringdowntime.log
-rw-r--r--. 1 nagios nagios 1908 Jul 19 14:28 reportengine.log
drwxr-xr-x. 2 nagios nagios 50 Jul 19 18:17 subsys
-rw-r--r--. 1 nagios nagios 2259660 Jul 19 18:40 sysstat.log
drwxr-xr-x. 2 nagios nagios 6 Jul 19 13:39 upgrades
-rw-r--r--. 1 nagios nagios 7 Jul 19 13:39 xi-itype
-rw-r--r--. 1 nagios nagios 12248 Jul 19 13:43 xi-sys.cfg
-rw-r--r--. 1 nagios nagios 37 Jul 19 13:39 xi-uuid
-rw-r--r--. 1 nagios nagios 196 Jul 19 13:43 xiversion
Re: permission denied logrotate rule incorrect
The permissions for the folder / flies look correct.
The files from the previous post are not in that folder anymore so that could of been a onetime error.
If you run the following, do you still get any errors for the files in that folder?
The files from the previous post are not in that folder anymore so that could of been a onetime error.
If you run the following, do you still get any errors for the files in that folder?
Code: Select all
/usr/sbin/logrotate /etc/logrotate.confBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: permission denied logrotate rule incorrect
Works fine with the yum install for Centos7, the previous errors where directly related to the tar fullinstall, seemed to have a bunch of issues with installing that way.
Thanks,
Brad
Thanks,
Brad
Re: permission denied logrotate rule incorrect
Yep, please do.
Thanks,
Brad
Thanks,
Brad
-
bolson
Re: permission denied logrotate rule incorrect
Closing topic as resolved.
Thank you for using the Nagios Support Forum.
Thank you for using the Nagios Support Forum.