MRTG Permission Denied

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
shoreypu
Posts: 134
Joined: Wed Mar 13, 2019 2:06 pm

Re: MRTG Permission Denied

Post 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
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: MRTG Permission Denied

Post 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
shoreypu
Posts: 134
Joined: Wed Mar 13, 2019 2:06 pm

Re: MRTG Permission Denied

Post 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
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: MRTG Permission Denied

Post by vtrac »

Hi John,
Do you have SELinux enabled?
Let's check:

Code: Select all

# sestatus
Regards,
Vinh
shoreypu
Posts: 134
Joined: Wed Mar 13, 2019 2:06 pm

Re: MRTG Permission Denied

Post by shoreypu »

Vinh,

We do not have SELinux enabled.

John
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: MRTG Permission Denied

Post by vtrac »

Thanks .... now I understand that you do have SELinux turned on.
shoreypu
Posts: 134
Joined: Wed Mar 13, 2019 2:06 pm

Re: MRTG Permission Denied

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: MRTG Permission Denied

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked