Page 1 of 1
permission denied logrotate rule incorrect
Posted: Mon Jul 17, 2017 8:16 am
by BradZynda
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
Re: permission denied logrotate rule incorrect
Posted: Mon Jul 17, 2017 4:49 pm
by tmcdonald
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?
Re: permission denied logrotate rule incorrect
Posted: Tue Jul 18, 2017 6:49 am
by BradZynda
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
Re: permission denied logrotate rule incorrect
Posted: Tue Jul 18, 2017 4:43 pm
by tgriep
Another thing to check is that the folder permissions are set correctly for the nagios user account as well as the group.
Code: Select all
drwxr-xr-x 5 nagios nagios 4096 Jul 18 16:38 var
That could be another cause for the error.
Re: permission denied logrotate rule incorrect
Posted: Wed Jul 19, 2017 1:41 pm
by BradZynda
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
Re: permission denied logrotate rule incorrect
Posted: Wed Jul 19, 2017 1:59 pm
by tgriep
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?
Code: Select all
/usr/sbin/logrotate /etc/logrotate.conf
Re: permission denied logrotate rule incorrect
Posted: Thu Jul 20, 2017 8:24 am
by BradZynda
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
Re: permission denied logrotate rule incorrect
Posted: Thu Jul 20, 2017 9:51 am
by bolson
May we go ahead and close this topic?
Re: permission denied logrotate rule incorrect
Posted: Thu Jul 20, 2017 10:01 am
by BradZynda
Yep, please do.
Thanks,
Brad
Re: permission denied logrotate rule incorrect
Posted: Thu Jul 20, 2017 10:04 am
by bolson
Closing topic as resolved.
Thank you for using the Nagios Support Forum.