Installing Cacti for Ubuntu - Part 3: Errors FAQ (Work In Progress)
Q1. When I go to localhost/cacti, I keep getting the follow error:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'cacti@localhost' (Using password: YES) in /usr/share/adodb/drivers/adodb-mysql.inc.php on line 338
A. If you get this error, you've set the wrong password for cacti in mysql. To fix it, follow steps 9 & 10 in Part 1 of this guide.
A2. You can also get this message if you run the GRANT ALL command without the quotes around the password or without the semi-colon at the end.
Q2. The default password won't work when I try to log in through the web interface, how can I log in?
A. Go back to command line and type
mysql. At the mysql> prompt, type:
update user_auth set password == md5('admin') where username == 'admin';
Q3. I get a "red X" and my graphs will not display properly.
A. I have found that this is because the mysql module sometimes does not get properly registered with PHP. Run the command "php -m" and if you do not see mysql listed then this is your problem. Run the command "dpkg-reconfigure php5-mysql" to correct the problem and then run the command "php -m" again to see if it is now listed. Run the command "apache2ctl restart" to restart the Apache server.
Q4. I get a "red X" and my graphs will not display properly.
Fatal error: Call to undefined function mysql_pconnect() in /usr/share/php/adodb/drivers/adodb-mysql.inc.php on line 372
A. This is probably due to the fact that the poller runs using the commandline php. So you have to edit /etc/php5/cli/php.ini and make sure you add extension=mysql.so.
Q5. When I add a graph, I notice an error in the log: "CMDPHP: Poller[0] ERROR: SQL Exec Failed "update data_template_data set rrd_maximum='|query_ifSpeed|' where local_data_id=8""
A. I believe there's a problem with the package. The query is trying to update a field in a column that doesn't exist in the table data_template_data. I was able to clear this error by running 'sudo apt-get remove cacti' and installing 0.8.6i manually. (I think the package currently installs 0.8.6h) I didn't locate a .php file that had both the string 'data_template_data' and the string 'rrd_maximum' but something launched that sql command.
Q6. When I change the Title of a graph, the graph disappears from the list. The log says, "CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select data_input_fields.type_code, data_input_data.value from (data_input_fields,data_input_data) where data_input_fields.id=data_input_data.data_input_field_id and data_input_data.data_template_data_id= and (data_input_fields.type_code='index_type' or data_input_fields.type_code='index_value' or data_input_fields.type_code='output_type')"
A. I believe there's a problem with the package. This sql query is just broken - though it may be the log process munging the report of the query being attempted rather than the query itself. I was able to clear this error by running 'sudo apt-get remove cacti' and installing 0.8.6i manually. (I think the package currently installs 0.8.6h)