Page 2 of 2

Re: MRTG Permission Denied

Posted: Tue Jan 05, 2021 10:55 am
by shoreypu
Result of # ls -la /var/lib/mrtg
total 4
drwxrwxr-x 2 apache nagios 20 Dec 23 13:25 .
drwxr-xr-x. 42 root root 4096 Dec 4 08:05 ..
-rwxrwxr-x 1 apache nagios 0 Jan 5 10:45 mrtg.ok

I do not believe there are two mrtg cron jobs running. The errors I'm collecting are being logged to a file that I've listed in the cron job.

Result of # ls -l /etc/cron.d/
total 16
-rw-r--r-- 1 root root 128 Jun 9 2019 0hourly
-rw-r--r-- 1 root root 985 Dec 22 17:31 KoneaCheckerCrontab
-rw-r--r-- 1 root root 612 Jan 5 10:49 mrtg
-rw-r--r-- 1 root root 1806 Dec 17 10:49 nagiosxi

I've updated the cron job to put mrtg.ok into /tmp/. Since there are no timestamps in the log, I'll note that my log file last updated 1/5 at 1:00.
]# ls -la /usr/local/nagiosxi/var/mrtg.log
-rw-r--r-- 1 nagios nagios 303034 Jan 5 01:00 /usr/local/nagiosxi/var/mrtg.log

Re: MRTG Permission Denied

Posted: Tue Jan 05, 2021 3:55 pm
by vtrac
Hi John,
Can you please run the below command and update the results:

Code: Select all

ls -aZ /var/lib/mrtg/
Regards,
Vinh

Re: MRTG Permission Denied

Posted: Wed Jan 06, 2021 8:01 am
by shoreypu
# ls -aZ /var/lib/mrtg
drwxrwxr-x apache nagios ? .
drwxr-xr-x. root root system_u:object_r:var_lib_t:s0 ..
-rwxrwxr-x apache nagios ? mrtg.ok

Re: MRTG Permission Denied

Posted: Wed Jan 06, 2021 3:34 pm
by vtrac
Hi John,
Do you have SELinux enabled?
Let's check:

Code: Select all

# sestatus
Regards,
Vinh

Re: MRTG Permission Denied

Posted: Thu Jan 07, 2021 8:55 am
by shoreypu
Vinh,

We do not have SELinux enabled.

John

Re: MRTG Permission Denied

Posted: Thu Jan 07, 2021 2:21 pm
by vtrac
Thanks .... now I understand that you do have SELinux turned on.

Re: MRTG Permission Denied

Posted: Wed Jan 13, 2021 8:15 am
by shoreypu
Moving the mrtg.ok and mrtg.lock files to /tmp/ looks to have resolved the permissions issue.

This topic can be closed. Thanks

Re: MRTG Permission Denied

Posted: Wed Jan 13, 2021 9:20 am
by scottwilkerson
shoreypu wrote:Moving the mrtg.ok and mrtg.lock files to /tmp/ looks to have resolved the permissions issue.

This topic can be closed. Thanks
Great!

Locking thread