Log Problem with CACTI Version 0.8.8a

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
yjcb2
Posts: 2
Joined: Wed Dec 12, 2012 11:30 am

Log Problem with CACTI Version 0.8.8a

Post by yjcb2 »

Dear All,

I have installed Cacti from source as shown in Cacti 0.8 Beginner's Guide book. I also installed cacti from yum repository. In the yum repository installation i realized the logs are saved in /var/log/cacti because of a symbolic link in the cacti directory. So i tried to do the same in my "from source installation". I made a backup of the log folder, removed the folder, created a symbolic link to /var/log/cacti, change user and group of /var/log/cacti to apache. After that i got the following error in the apache's error log.
PHP Warning: touch(): Unable to create file /usr/share/cacti/log/cacti.log because Permission denied in /usr/share/cacti/lib/functions.php on line 658

So i change the permisions like this:
ls -l /var/log/cacti/
-rwxrw-r--. 1 apache apache 500387 dic 12 11:40 cacti.log
After that i got an error in the cacti webpage: Error /usr/share/cacti/log/cacti.log is not readable.
But the cacti.log is working. It writes all the logs in the file. I also changed to 777 permision (which is not so secure for me) but it doesn't work. I compare the lib/functions.php file in "from source installation" and "from yum repository". They are the same. I have also tried to read the cacti.log file with the apache user and in fact he can do it.

I would to receive some guidance if it is possible.

Thanks in advance.
Attachments
cacti_error.png
cacti_error.png (69.94 KiB) Viewed 12728 times
doiggl
Cacti User
Posts: 222
Joined: Wed Dec 16, 2009 6:32 am

Re: Log Problem with CACTI Version 0.8.8a

Post by doiggl »

I suspect apache can read/write file but cacti has no permissions
-rwxrw-r--. 1 apache apache 500387 dic 12 11:40 cacti.log

Try setting permission to:
-rwxrw-rw-. 1 apache apache 500387 dic 12 11:40 cacti.log
See [1] for more info.
Examples see[2]
so cacti can read and write to the log file.
Cheers Glenn

[1]
http://www.tuxfiles.org/linuxhelp/filepermissions.html
http://www.tuxfiles.org/linuxhelp/fileowner.html

[2] examples

# touch zz
# ll zz
-rw-r--r-- 1 root root 0 Dec 13 17:47 zz
# chmod 644 zz
# ll zz
-rw-r--r-- 1 root root 0 Dec 13 17:47 zz
# chmod 646 zz
# ll zz
-rw-r--rw- 1 root root 0 Dec 13 17:47 zz
yjcb2
Posts: 2
Joined: Wed Dec 12, 2012 11:30 am

Re: Log Problem with CACTI Version 0.8.8a

Post by yjcb2 »

Dear doiggl,

Thank you so much for your time. I have done what you said, but I'm getting the same error:
-rwxrw-rw-. 1 apache apache 123206946 ene 3 09:26 cacti.log
Error /usr/share/cacti/log/cacti.log is not readable

I found this bug:
http://bugs.cacti.net/print_bug_page.php?bug_id=2222
But it says it was solved in the 0.8.8a version. I have the 0.8.8a version but I'm getting the error. Do you have any idea???
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Log Problem with CACTI Version 0.8.8a

Post by gandalf »

Is SELinux enabled?
R.
User avatar
JorisFRST
Cacti User
Posts: 229
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Re: Log Problem with CACTI Version 0.8.8a

Post by JorisFRST »

Thanks gandalf,

was looking at this and couldn't figure it out, looks like I need to add a selinux label to cacti.log to allow httpd process to write.
Not sure if i'm going to bother now :lol:
Joris.
http://www.routerjanitor.com
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Log Problem with CACTI Version 0.8.8a

Post by phalek »

THe paths do not match

Code: Select all

So i change the permisions like this:
ls -l /var/log/cacti/
-rwxrw-r--. 1 apache apache 500387 dic 12 11:40 cacti.log

Code: Select all

After that i got an error in the cacti webpage: Error /usr/share/cacti/log/cacti.log is not readable.
Maybe you should fix the permissions in /usr/share/cacti/log/cacti.log instead of /var/log/cacti/

?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
nullzero
Posts: 1
Joined: Tue Sep 27, 2016 6:54 am

Re: Log Problem with CACTI Version 0.8.8a

Post by nullzero »

After doing this commands to resolved the issue of "[NOT FOUND] Cacti Log File Path: The path to your Cacti log file."

touch /usr/share/cacti/log/cacti.log
chown apache:apache /usr/share/cacti/log/cacti.log
chmod 755 /usr/share/cacti/log/cacti.log

I've encountered same issue for Version 0.8.8h

"Error /usr/share/cacti/log/cacti.log is not readable"

Please advise. Thank you very much in advance.
Tempus
Posts: 4
Joined: Sat Dec 10, 2016 9:40 am

Re: Log Problem with CACTI Version 0.8.8a

Post by Tempus »

nullzero wrote:After doing this commands to resolved the issue of "[NOT FOUND] Cacti Log File Path: The path to your Cacti log file."

touch /usr/share/cacti/log/cacti.log
chown apache:apache /usr/share/cacti/log/cacti.log
chmod 755 /usr/share/cacti/log/cacti.log

I've encountered same issue for Version 0.8.8h

"Error /usr/share/cacti/log/cacti.log is not readable"

Please advise. Thank you very much in advance.
I had the same issue on a new instation of 0.8.8h on CentOS 7. Disabling SElinux solved the issue for me.

Just edit the /etc/sysconfig/selinux and reboot the server.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest