LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   RRDTool cacti problem (https://www.linuxquestions.org/questions/linux-newbie-8/rrdtool-cacti-problem-491067/)

Braynid 10-10-2006 05:07 AM

RRDTool cacti problem
 
Hey guys, i've tried to spare you by posting to the cacti forums about this but they don't seem to reply so here goes:
I have cacti up and running on my ubuntu server rc 6.06 with Apache/2.0.55 (Ubuntu) PHP/5.1.2 mod_ssl/2.0.55 OpenSSL/0.9.8a. If it's of any importance it is the .tar.gz that i have installeb becouse with 'apt-get install cacti' it instals cacti on php4 and i's giving me some bad errors.
So cacti is now installed and i've created a new device and some graphics for it, but i can only see the name of the graphic as seen in the picture below. The host is a generic snmp host, i have instaleed 'snmpd' on the linux machine and the snmp is running.
I have up and running 'rrdtool', the path in cacti for rrdtool is correct but i get this error:
RRDTool Command:GRAPH ACCESS DENIEDRRDTool Says:GRAPH ACCESS DENIED

What is the problem?
Thanks.

http://img220.imageshack.us/img220/7886/cactiav5.jpg

acid_kewpie 10-10-2006 05:53 AM

sounds like a file system permissions issue. i would assume that the cacti daemon is running as the "cacti" user so the location where the RRD's are meant to be being written to needs to be either owned by the cacti user or set with sufficiently broad permissions so as to allow them to write to it. concentrate on the former method, maybe using the chown tool to change the ownership of the directory, or possibly changing the location to a more suitable one if that was an option during configuration. it seems strange that this error would occur after a formal installation process so i'd wonder if this location was changed somehow.

Braynid 10-10-2006 06:07 AM

The location is '/usr/bin' the file has the same owner as the cacti database, root. The chmod is read write execute for owner, and read and execute for the others. I can't think of any location change, beside that cacti has a 'path' option and the location of 'rrdtool' is se properly.
Oh, and i've done mysql> GRANT ALL ON cacti.* TO root@localhost IDENTIFIED BY 'pass';

acid_kewpie 10-10-2006 06:46 AM

no i mean the actual destination directory for the data files, not the rrdtool binary itself, e.g. /var/local/cacti/rrd or something.

Braynid 10-10-2006 07:00 AM

On slocate: rrdtool. I get:
/usr/share/doc/rrdtool/
/usr/share/rrdtool

which one ?

IBall 10-10-2006 08:43 AM

On my machine (Debian Sarge), the rrd data is stored in /var/lib/cacti/rra.

There is one file for each data source, and "ls -l" gives:
Code:

-rw-r--r--  1 www-data www-data  47836 2006-10-10 21:20 localhost_mem_buffers_3.rrd
As you can see, www-data has read and write access, and everyone else has only read access.

The directory /var/lib/cacti/rra is owned by the user that runs the cronjob to update the database, in my case admin. This directory has permissions of "rwxrwxrwx". (I know this is probably bad, but it works :)) I seem to remember that the ownership / permissions of this directory were a problem when I installed cacti.

Unfortunately, it was a long time ago that I setup cacti, so I can't remember much more than that :)

I hope this helps
--Ian

Braynid 10-10-2006 03:09 PM

There's my problem right there. in the /cacti/rra folder i have only this:
Code:

drwxr-xr-x  2 root root 4096 2006-10-10 09:34 .
drwxr-xr-x 11 root root 4096 2006-10-10 11:43 ..
-rw-r--r--  1 root root    0 2006-10-10 09:34 .placeholder

The folder /usr/share/rrdtool has the following configuration:
Code:

drwxr-xr-x  3 root root  4096 2006-10-10 12:18 rrdtool
Root is also my cacti user...

IBall 10-10-2006 09:29 PM

As I said, my memory is a bit rusty, but try running:
Code:

/usr/share/cacti/site/poller.php
That script may be somewhere else on your machine. See if it throws any errors. Make sure that that command is being run every five minutes by cron. In /etc/crontab:
Code:

*/5 * * * *    admin  /usr/share/cacti/site/poller.php > /dev/null 2>&1
Where admin is the user to run that script.

I hope this helps
--Ian

Braynid 10-11-2006 12:20 AM

Sure was helpful to run poller.php. First of all the file didn't have the 'x' flag on even for the owner, i had to chmod it. Then i run the script and it gave me this error:
Code:

Fatal error: Call to undefined function:  mysql_pconnect() in /var/www/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 356
I will try to google it some more.
If you need to know i use PHP5, and in php.ini i have:

Code:

; Allow or prevent persistent links.
mysql.allow_persistent = On

As for compatibylity with mysql i have this (displayed with phpinfo() ):
Code:

Active Persistent Links        0
Active Links                        0
Client API version                5.0.22
MYSQL_MODULE_TYPE                external
MYSQL_SOCKET                        /var/run/mysqld/mysqld.sock
MYSQL_INCLUDE                        -I/usr/include/mysql
MYSQL_LIBS                        -L/usr/lib -lmysqlclient



All times are GMT -5. The time now is 01:05 PM.