cancel
Showing results for 
Search instead for 
Did you mean: 

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
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
Piotr Kirklewski
Super Advisor

Re: Cacti - config problem

/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "111111";
$database_port = "3306";
?>

Now works :)

How about those php errors ?
Jesus is the King
Court Campbell
Honored Contributor

Re: Cacti - config problem

you can remove these

extension=mysql.so
extension=gd.so

this is not debian, this is fedora.
"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
I'm logging to cacti - but don't have any graphs displayed.

If I click the graph management and Turn On Graph Debug Mode then I have:

RRDTool Says:

ERROR: openning '/usr/share/cacti/rra/localhost_load_1min_5.rrd': No such file or directory

Where is the problem ?

Cheers

Jesus is the King
Court Campbell
Honored Contributor

Re: Cacti - config problem

what is the output in /usr/share/cacti/log/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

from version"
06/19/2007 08:16:02 PM - CMDPHP: Poller[0] FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.
06/19/2007 08:16:02 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select cacti from version"
06/19/2007 08:16:39 PM - CMDPHP: Poller[0] FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.
06/19/2007 08:16:39 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed "select cacti from version"

The last entry is yesterday at 08.16 when I've changed the dp.php.

Cheers

Jesus is the King
Court Campbell
Honored Contributor

Re: Cacti - config problem

please post te output from

# rpm -q rrdtool net-snmp
"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 ~]# rpm -q rrdtool net-snmp
rrdtool-1.2.23-5.fc7
net-snmp-5.4-13.fc7

and :

[root@jimlaptop ~]# snmpwalk -v 1 -c public localhost
Timeout: No Response from localhost

Cherers
Jesus is the King
Piotr Kirklewski
Super Advisor

Re: Cacti - config problem

This command wors for now - but steel no graphs in cacti:

#snmpwalk -v 1 -c public localhost

SNMPv2-MIB::sysDescr.0 = STRING: Linux jimlaptop.marketrix.local 2.6.21-1.3228.fc7 #1 SMP Tue Jun 12 15:37:31 EDT 2007 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (8859) 0:01:28.59
SNMPv2-MIB::sysContact.0 = STRING: Root (configure /etc/snmp/snmp.local.conf)
SNMPv2-MIB::sysName.0 = STRING: jimlaptop.marketrix.local
SNMPv2-MIB::sysLocation.0 = STRING: Unknown (edit /etc/snmp/snmpd.conf)
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (9) 0:00:00.09
SNMPv2-MIB::sysORID.1 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.2 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.3 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.5 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.6 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.7 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.8 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORDescr.1 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.3 = STRING: The management information definitions for the SNMP User-based Security Model.
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.6 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.7 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.8 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (8) 0:00:00.08
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (8) 0:00:00.08
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (8) 0:00:00.08
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (9) 0:00:00.09
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (9) 0:00:00.09
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (9) 0:00:00.09
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (9) 0:00:00.09
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (9) 0:00:00.09
HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (337663) 0:56:16.63
End of MIB
Jesus is the King
Piotr Kirklewski
Super Advisor

Re: Cacti - config problem

I've got two pullers in the system I'm not sure which one to use ?

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

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

Jesus is the King
Court Campbell
Honored Contributor

Re: Cacti - config problem

login to cacti as admin. then go to settings. then click on the poller tab. take a screen shot and post it. Note: if the poller type is cmd.php then you do not need the cron entries.
"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

Court Campbell
Honored Contributor

Re: Cacti - config problem

you can remove the cron entries. what is the output in /var/log/messages?
"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

also can you post the output from

# ll /usr/share/cacti
"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 cacti]# ll
total 848
-rw-r--r-- 1 cacti root 5892 2007-05-05 21:51 about.php
-rw-r--r-- 1 cacti root 4773 2007-05-05 21:51 auth_changepassword.php
-rw-r--r-- 1 cacti root 6203 2007-05-05 21:51 auth_login.php
-rw-r--r-- 1 cacti root 13108 2007-05-05 21:51 cdef.php
-rwxr-xr-x 1 cacti root 17023 2007-05-05 21:51 cmd.php
-rw-r--r-- 1 cacti root 5917 2007-05-05 21:51 color.php
-rw-r--r-- 1 cacti root 2846 2007-05-05 21:51 copy_cacti_user.php
-rw-r--r-- 1 cacti root 18387 2007-05-05 21:51 data_input.php
-rw-r--r-- 1 cacti root 28762 2007-05-05 21:51 data_queries.php
-rw-r--r-- 1 cacti root 45400 2007-05-05 21:51 data_sources.php
-rw-r--r-- 1 cacti root 31307 2007-05-05 21:51 data_templates.php
-rw-r--r-- 1 cacti root 6110 2007-05-05 21:51 gprint_presets.php
-rw-r--r-- 1 cacti root 3423 2007-05-05 21:51 graph_image.php
-rw-r--r-- 1 cacti root 10572 2007-05-05 21:51 graph.php
-rw-r--r-- 1 cacti root 6502 2007-05-05 21:51 graph_settings.php
-rw-r--r-- 1 cacti root 12446 2007-05-05 21:51 graphs_items.php
-rw-r--r-- 1 cacti root 30927 2007-05-05 21:51 graphs_new.php
-rw-r--r-- 1 cacti root 48109 2007-05-05 21:51 graphs.php
-rw-r--r-- 1 cacti root 10097 2007-05-05 21:51 graph_templates_inputs.php
-rw-r--r-- 1 cacti root 17367 2007-05-05 21:51 graph_templates_items.php
-rw-r--r-- 1 cacti root 23468 2007-05-05 21:51 graph_templates.php
-rw-r--r-- 1 cacti root 23261 2007-05-05 21:51 graph_view.php
-rw-r--r-- 1 cacti root 35150 2007-05-05 21:51 host.php
-rw-r--r-- 1 cacti root 15014 2007-05-05 21:51 host_templates.php
drwxr-xr-x 2 cacti root 4096 2007-06-19 11:44 images
drwxr-xr-x 5 cacti root 4096 2007-06-20 08:22 include
-rw-r--r-- 1 cacti root 2271 2007-05-05 21:51 index.php
drwxr-xr-x 2 cacti root 4096 2007-06-19 11:44 install
drwxr-xr-x 3 cacti root 4096 2007-06-19 11:44 lib
lrwxrwxrwx 1 cacti root 15 2007-06-19 11:44 log -> /var/log/cacti/
-rw-r--r-- 1 cacti root 1796 2007-05-05 21:51 logout.php
-rw-r--r-- 1 cacti root 4462 2007-05-05 21:51 poller_commands.php
-rw-r--r-- 1 cacti root 2399 2007-05-05 21:51 poller_export.php
-rwxr-xr-x 1 cacti root 9314 2007-05-05 21:51 poller.php
-rw-r--r-- 1 cacti root 4417 2007-05-05 21:51 poller_reindex_hosts.php
-rw-r--r-- 1 cacti root 4244 2007-05-05 21:51 rebuild_poller_cache.php
drwxr-xr-x 5 cacti root 4096 2007-06-19 11:44 resource
lrwxrwxrwx 1 cacti root 18 2007-06-19 11:44 rra -> /var/lib/cacti/rra
-rw-r--r-- 1 cacti root 7236 2007-05-05 21:51 rra.php
lrwxrwxrwx 1 cacti root 22 2007-06-19 11:44 scripts -> /var/lib/cacti/scripts
-rw-r--r-- 1 cacti root 7363 2007-05-05 21:51 script_server.php
-rw-r--r-- 1 cacti root 5148 2007-05-05 21:51 settings.php
-rw-r--r-- 1 cacti root 6813 2007-05-05 21:51 templates_export.php
-rw-r--r-- 1 cacti root 5954 2007-05-05 21:51 templates_import.php
-rw-r--r-- 1 cacti root 17958 2007-05-05 21:51 tree.php
-rw-r--r-- 1 cacti root 28925 2007-05-05 21:51 user_admin.php
-rw-r--r-- 1 cacti root 35851 2007-05-05 21:51 utilities.php
Jesus is the King
Court Campbell
Honored Contributor

Re: Cacti - config problem

Do the following

# cd /usr/share/cacti
# chown root *
# chown cacti.cacti -R rra 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???"