Can not delete logs from system utilities
Moderators: Developers, Moderators
Can not delete logs from system utilities
I have been working on cacti trying to fix some other problems I had today, and noticed that when I click clear cacti log file the alarms remain there, and only refresh. The link for the action is = to http://address/cacti/utilities.php?action=clear_logfile.
Any suggestions?
Any suggestions?
JP
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
I did not ask for the mysql user, I asked for the webserver's (httpd) user. The chown above is correct. But the logfile may need special permissions. Personally, I do not like that: deleting files from a browser. So I did not walk through this.jpimentel wrote:How do I check which user was created for mysql? The server I am on has a bunch of users, not sure which account to give the permissions to.
chown -R cactiuser rra/ log/
When it was installed I guess cactiuser was not selected.
Reinhard
It just bugs me that it does not do what it is supposed to do, and that I dont know why, lol. Cactiuser has the proper permissions, but unfortunitly I can still not delete. When you say special permissons, what do you mean. I gave 777 so it should have total access. Is there somthing else I should look into?
JP
For me, the fix was:
chown -R nobody /opt/apache/htdocs/cacti/
My web server runs as user "nobody"
My cacti is installed in /opt/apache/htdocs/cacti/
chown -R nobody /opt/apache/htdocs/cacti/
My web server runs as user "nobody"
My cacti is installed in /opt/apache/htdocs/cacti/
Thank you,
Ernie
http://www.NMSWorld.com
[b]Dual Zeon Dual Core 2.6Ghz / 8GB RAM / 4x15k RPM SATA RAID5[/b]
[b]Cacti Version[/b] - 0.8.7b
[b]Poller Type[/b] - cactid 0.8.7 with Boost v1.7
[b]Server Info[/b] - FreeBSD 7.0-RELEASE
[b]Web Server[/b] - Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8
[b]PHP[/b] - 5.2.6
[b]MySQL[/b] - 5.0.51b Mod: poller_output ENGINE = MEMORY
[b]RRDTool[/b] - 1.3.0
[b]SNMP[/b] - 5.4.1
[b]Plugins[/b] - Host Info (hostinfo - v0.2), Update Checker (update - v0.3), Network Tools (tools - v0.2), FlowView (flowview - v0.3), Read-only Devices Tab (devices - v0.4), Network Discovery (discovery - v0.8.3), Syslog Monitoring (syslog - v0.5.2), Thresholds (thold - v0.3.9), Device Monitoring (monitor - v0.8.2), PHP Network Weathermap (weathermap - v0.941), SuperLinks (superlinks - v0.72), Report Creator (reports - v0.1b)
Ernie
http://www.NMSWorld.com
[b]Dual Zeon Dual Core 2.6Ghz / 8GB RAM / 4x15k RPM SATA RAID5[/b]
[b]Cacti Version[/b] - 0.8.7b
[b]Poller Type[/b] - cactid 0.8.7 with Boost v1.7
[b]Server Info[/b] - FreeBSD 7.0-RELEASE
[b]Web Server[/b] - Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8
[b]PHP[/b] - 5.2.6
[b]MySQL[/b] - 5.0.51b Mod: poller_output ENGINE = MEMORY
[b]RRDTool[/b] - 1.3.0
[b]SNMP[/b] - 5.4.1
[b]Plugins[/b] - Host Info (hostinfo - v0.2), Update Checker (update - v0.3), Network Tools (tools - v0.2), FlowView (flowview - v0.3), Read-only Devices Tab (devices - v0.4), Network Discovery (discovery - v0.8.3), Syslog Monitoring (syslog - v0.5.2), Thresholds (thold - v0.3.9), Device Monitoring (monitor - v0.8.2), PHP Network Weathermap (weathermap - v0.941), SuperLinks (superlinks - v0.72), Report Creator (reports - v0.1b)
\var\www\html\cacti is where mine is. The user is cacti user. I have set the correct permissions but for some unknown reason to me, I can only clear the logs manually through command line.
drwxr-xr-x 2 cactiuser cacti 4096 Feb 20 11:53 log
I am still looking into it, and as soon as I find a solution I will post. If you have any suggestions, let me know.
drwxr-xr-x 2 cactiuser cacti 4096 Feb 20 11:53 log
I am still looking into it, and as soon as I find a solution I will post. If you have any suggestions, let me know.
JP
jpimentel wrote:\var\www\html\cacti is where mine is. The user is cacti user. I have set the correct permissions but for some unknown reason to me, I can only clear the logs manually through command line.
Does Apache run as cactiuser also? On most systems, Apache runs as "nobody" and that is the user that needs access to delete the log file. If you are unsure, run this command:
Code: Select all
ps -ef | grep httpd
[root@syslog /]# ps -ef | grep httpd
root 30764 1 0 Feb17 ? 00:00:00 /usr/sbin/httpd
apache 16192 30764 0 Feb19 ? 00:00:43 /usr/sbin/httpd
apache 16193 30764 0 Feb19 ? 00:00:43 /usr/sbin/httpd
apache 16194 30764 0 Feb19 ? 00:00:44 /usr/sbin/httpd
apache 16196 30764 0 Feb19 ? 00:00:44 /usr/sbin/httpd
apache 16197 30764 0 Feb19 ? 00:00:39 /usr/sbin/httpd
apache 16198 30764 0 Feb19 ? 00:00:41 /usr/sbin/httpd
apache 16201 30764 0 Feb19 ? 00:00:44 /usr/sbin/httpd
apache 11972 30764 0 Feb20 ? 00:00:32 /usr/sbin/httpd
root 20046 19994 0 13:11 pts/3 00:00:00 grep httpd
This is what I got.
root 30764 1 0 Feb17 ? 00:00:00 /usr/sbin/httpd
apache 16192 30764 0 Feb19 ? 00:00:43 /usr/sbin/httpd
apache 16193 30764 0 Feb19 ? 00:00:43 /usr/sbin/httpd
apache 16194 30764 0 Feb19 ? 00:00:44 /usr/sbin/httpd
apache 16196 30764 0 Feb19 ? 00:00:44 /usr/sbin/httpd
apache 16197 30764 0 Feb19 ? 00:00:39 /usr/sbin/httpd
apache 16198 30764 0 Feb19 ? 00:00:41 /usr/sbin/httpd
apache 16201 30764 0 Feb19 ? 00:00:44 /usr/sbin/httpd
apache 11972 30764 0 Feb20 ? 00:00:32 /usr/sbin/httpd
root 20046 19994 0 13:11 pts/3 00:00:00 grep httpd
This is what I got.
JP
Ok, try making apache owner of your Cacti log file and see if the "Clear log file" link works. You might need to do it on the directory also, I'm not surejpimentel wrote:[root@syslog /]# ps -ef | grep httpd
root 30764 1 0 Feb17 ? 00:00:00 /usr/sbin/httpd
apache 16192 30764 0 Feb19 ? 00:00:43 /usr/sbin/httpd
apache 16193 30764 0 Feb19 ? 00:00:43 /usr/sbin/httpd
apache 16194 30764 0 Feb19 ? 00:00:44 /usr/sbin/httpd
apache 16196 30764 0 Feb19 ? 00:00:44 /usr/sbin/httpd
apache 16197 30764 0 Feb19 ? 00:00:39 /usr/sbin/httpd
apache 16198 30764 0 Feb19 ? 00:00:41 /usr/sbin/httpd
apache 16201 30764 0 Feb19 ? 00:00:44 /usr/sbin/httpd
apache 11972 30764 0 Feb20 ? 00:00:32 /usr/sbin/httpd
root 20046 19994 0 13:11 pts/3 00:00:00 grep httpd
This is what I got.
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
Ok, this thread is annoying me... Mostly because no one has given an answer that is a good answer.
The proper permissions should only be applyed as such:
The proper permissions should only be applyed as such:
- <cacti_path> should be owned by the cactiuser or some user OTHER THAN THE WEB SERVER. This is important as you don't want the webserver to have to abbility to overwrite php scripts.
- <cacti_path>/rra should be world readable but only writeable by the user that runs the poller, IE, cactiuser.
- <cacti_path>/log should be world readable and writable by the user that runs the poller. If you want to have the ability to clear the log from the web interface, then special permissions should be used. The best approach is to apply a sticky bit to the group permissions so that all files in the directory are set to the same group, despite the owner. So, you would make sure that you poller user and the webserver are members of the same group, IE, cactilog, and apply the following permissions to the <cacti_path>/logs directory: `chmod 2775 <cacti_path>/logs; chgrp cactilog <cacti_path>/logs`. This way any file in the <cacti_path>/logs directory if created by the poller or by the webserver will still be readable and writeable by the poller and the web server.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Who is online
Users browsing this forum: No registered users and 3 guests