Operating System - Linux
1752729 Members
5901 Online
108789 Solutions
New Discussion юеВ

Re: Cacti - config problem

 
SOLVED
Go to solution
Piotr Kirklewski
Super Advisor

Cacti - config problem

Hi there

I did that on Fedora v 7:

============================================
3. #apt-get install cacti
4. Cause the PHP interpreter to handle files with .php extension тАУ add to /etc/httpd/conf/httpd.conf :
AddType application/x-httpd-php .php
5. #adduser cacti (unless it already exist)
6. In mysql тАУ create cacti database (mysql> create database cacti ;)
7. mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'somepassword';
8. mysql тАУu cacti тАУp111111 cacti < /home/mydirectory/cacti-0.8.6j/cacti.sql (check if accomplished by running mysql>show tables;)
9. Find /include/config.php and add:
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";
10. chown тАУR cacti /usr/share/cacti
11. edit crontab (crontab -e) and enter:

*/5 * * * * cactiuser php /usr/share/cacti/lib/poller.php > /dev/null 2>&1
============================================

When I do http://127.0.0.1/cacti
or http://localhost/cacti

I get this error:


You have created a new database, but have not yet imported the 'cacti.sql' file. At the command line, execute the following to continue:

mysql -u cactiuser -p cacti < cacti.sql

This error may also be generated if the cacti database user does not have correct permissions on the cacti database. Please ensure that the cacti database user has the ability to SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, INDEX on the cacti database.
============================================

here's my /usr/share/cacti/include/config.php :

$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "111111";
============================================



here's my /etc/httpd/conf/httpd.conf:

AddType application/x-httpd-php .php
============================================

# mysql -u cacti -p111111


Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 44
Server version: 5.0.37 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use cacti;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+---------------------------+
| Tables_in_cacti |
+---------------------------+
| cdef |
| cdef_items |
| colors |
| data_input |
| data_input_data |
| data_input_fields |

............|

| user_auth_realm |
| user_log |
| version |
+---------------------------+
48 rows in set (0.01 sec)

mysql>


So it looks like user cacti have permitions to this database and cacti.sql was imported.

Where is the problem then ?

Cheers
Jesus is the King
29 REPLIES 29
Steven E. Protter
Exalted Contributor
Solution

Re: Cacti - config problem

Shalom,

Have you met the version requirements concerning mysql for cacti? If your install is on a version of mysql that is not supported, it could explain this behavior.

Also, examine the msyql logs for errors during your creation procedure.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Court Campbell
Honored Contributor

Re: Cacti - config problem

You might try editing /usr/share/cacti/include/db.php. At least that is where I am used to seeing the db login info. Then remove the lines out of config.php. Here is what is in my db.php file:

/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "XXXXX";
$database_port = "3306";
?>
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Court Campbell
Honored Contributor

Re: Cacti - config problem

Did we solve your issue or do you just feel like giving away bunnies?
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Piotr Kirklewski
Super Advisor

Re: Cacti - config problem

Hi again

$database_port = "3306";

When I've added this line to my config.php file - I get blank page.

Why ?



Jesus is the King
Piotr Kirklewski
Super Advisor

Re: Cacti - config problem

Missing ;

When I added it - I have the error again.

Why I'm giving bunnies?

Because this is first and only forum where people are trying to help me.

Cheers


Jesus is the King
Court Campbell
Honored Contributor

Re: Cacti - config problem

can you post the output of /usr/share/cacti/include/db.php if you have it?
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Piotr Kirklewski
Super Advisor

Re: Cacti - config problem

I will check the version reqirements in the meantime im giving you output of:

show grants for cacti@localhost;

| GRANT ALL PRIVILEGES ON *.* TO 'cacti'@'localhost' IDENTIFIED BY PASSWORD '5fc c735428e45938' WITH GRANT OPTION |
| GRANT ALL PRIVILEGES ON `cacti`.* TO 'cacti'@'localhost' WITH GRANT OPTION

Cheers
Jesus is the King
Court Campbell
Honored Contributor

Re: Cacti - config problem

what is in /var/log/mysqld.log and /var/log/cacti/cacti.log?
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Piotr Kirklewski
Super Advisor

Re: Cacti - config problem

[root@jimlaptop ~]# cat /usr/share/cacti/include/db.php
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactiuser";
$database_port = "3306";
?>

One more thing:

After reboot PHP is throwing errors:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/msql.so'
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/gd.so'

I've added those lines to php.ini:

extension=mysql.so
extension=gd.so

Because that was in the tutorial: http://www.debianhelp.co.uk/cacti.htm

:(



Jesus is the King