Configure /etc/cacti.conf

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
yermandu
Posts: 4
Joined: Wed Aug 26, 2009 4:12 pm
Location: Brasil

Configure /etc/cacti.conf

Post by yermandu »

Hi

I have a mandriva free server 2009 installed cacti, but i can not start.

to install

# urpmi cacti

OK, instalation success.

Then i go to mysql and create user "cactiuser" pass "cactiuser", the database "cacti".
I import /usr/share/cacti/cacti.sql to database cacti (48 tables)

I go to /etc/cacti.conf

Code: Select all

/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "127.0.0.1";
$database_username = "cactiuser";
$database_password = "cactiuser";
$database_port = "3306";
OK i hope this is correct :/

Code: Select all

#  grep 'port' /etc/my.cnf
# an important part, or systems up to 128M where MySQL is used together with
port            = 3306
port            = 3306
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    <port> by the master's port number (3306 by default).
# The port the master is listening on.
#master-port     =  <port>
port=2273
I Suppose the port are 3306 or 2273, and not others.

Well i go to http://ip/cacti

Then i read the below message:

Code: Select all

FATAL: Cannot connect to MySQL server on '127.0.0.1'. Please make sure you have specified a valid MySQL database name in '/etc/cacti.conf' 
I Can not understand ... what happen?
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

You have three port settings. The configuration will most likely take the last one.

Remove/comment out two of them.

Restart the service. Use the port that is uncommented (I would recommend 3306).
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
yermandu
Posts: 4
Joined: Wed Aug 26, 2009 4:12 pm
Location: Brasil

Dont Worked

Post by yermandu »

Code: Select all

FATAL: Cannot connect to MySQL server on '127.0.0.1'. Please make sure you have specified a valid MySQL database name in '/etc/cacti.conf' 
Now i specify all ports are 3306 in /etc/my.cnf and /etc/cacti.conf

PhpMyAdmin works fine, in /127.0.0.1/ or /localhost/ or /namemachine/

The other applications runs fines too.
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

What is the output of:

Code: Select all

# mysql -ucactiuser -pcactiuser P3306 -h127.0.0.1 cacti
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
yermandu
Posts: 4
Joined: Wed Aug 26, 2009 4:12 pm
Location: Brasil

Post by yermandu »

Result:

Code: Select all

Variables (--variable-name=value)
and boolean options {FALSE|TRUE}  Value (after reading options)
--------------------------------- -----------------------------
auto-rehash                       FALSE                        
character-sets-dir                (No default value)           
column-type-info                  FALSE                        
comments                          FALSE                        
compress                          FALSE                        
debug-check                       FALSE                        
debug-info                        FALSE                        
database                          (No default value)           
default-character-set             utf8                         
delimiter                         ;                            
vertical                          FALSE                        
force                             FALSE                        
named-commands                    FALSE                        
local-infile                      FALSE                        
no-beep                           FALSE                        
host                              127.0.0.1
html                              FALSE
xml                               FALSE
line-numbers                      TRUE
unbuffered                        FALSE
column-names                      TRUE
sigint-ignore                     FALSE
port                              3306
prompt                            mysql>
quick                             FALSE
raw                               FALSE
reconnect                         TRUE
socket                            /var/lib/mysql/mysql.sock
ssl                               FALSE
ssl-ca                            (No default value)
ssl-capath                        (No default value)
ssl-cert                          (No default value)
ssl-cipher                        (No default value)
ssl-key                           (No default value)
ssl-verify-server-cert            FALSE
table                             FALSE
user                              cactiuser
safe-updates                      FALSE
i-am-a-dummy                      FALSE
connect_timeout                   0
max_allowed_packet                16777216
net_buffer_length                 16384
select_limit                      1000
max_join_size                     1000000
secure-auth                       FALSE
show-warnings                     FALSE
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

Wait... what?

Did you just enter the command above, or did you enter the command and then do a 'show variables;'?
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
yermandu
Posts: 4
Joined: Wed Aug 26, 2009 4:12 pm
Location: Brasil

Post by yermandu »

:oops:

The parameters are different here, follow this line:

Code: Select all

[root@pankararu daniel]# mysql -u cactiuser -pcactiuser -P 3306 -D cacti -h localhost
Welcome to the MySQL monitor.  Commands end with ; or \g.                            
Your MySQL connection id is 53                                                       
Server version: 5.1.34 Mandriva Linux - MySQL Standard Edition (GPL)                 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show tables;
+---------------------------+
| Tables_in_cacti           |
+---------------------------+
| cdef                      | 
| cdef_items                | 
| colors                    | 
| data_input                | 
| data_input_data           | 
| data_input_fields         | 
| data_local                | 
| data_template             | 
| data_template_data        | 
| data_template_data_rra    | 
| data_template_rrd         | 
| graph_local               | 
| graph_template_input      | 
| graph_template_input_defs | 
| graph_templates           | 
| graph_templates_gprint    | 
| graph_templates_graph     | 
| graph_templates_item      | 
| graph_tree                | 
| graph_tree_items          | 
| host                      |
| host_graph                |
| host_snmp_cache           |
| host_snmp_query           |
| host_template             |
| host_template_graph       |
| host_template_snmp_query  |
| poller                    |
| poller_command            |
| poller_item               |
| poller_output             |
| poller_reindex            |
| poller_time               |
| rra                       |
| rra_cf                    |
| settings                  |
| settings_graphs           |
| settings_tree             |
| snmp_query                |
| snmp_query_graph          |
| snmp_query_graph_rrd      |
| snmp_query_graph_rrd_sv   |
| snmp_query_graph_sv       |
| user_auth                 |
| user_auth_perms           |
| user_auth_realm           |
| user_log                  |
| version                   |
+---------------------------+
48 rows in set (0.37 sec)

mysql>


but:
[root@pankararu daniel]# mysql -u cactiuser -pcactiuser -P 3306 -D cacti -h 127.0.0.1
ERROR 1045 (28000): Access denied. Bad username/password pair

Code: Select all

GRANT ALL PRIVILEGES ON `cacti` . * TO 'cactiuser'@'127.0.0.1' WITH GRANT OPTION ;
GRANT ALL PRIVILEGES ON `cacti` . * TO 'cactiuser'@'localhost' WITH GRANT OPTION ;

Code: Select all

[root@pankararu daniel]# mysql -u cactiuser -pcactiuser -P 3306 -D cacti -h 127.0.0.1
ERROR 1045 (28000): Access denied. Bad username/password pair
i Edit /etc/cacti.conf and change localhost

Code: Select all

/* 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";
Worked.

The problem are no Grant Access to cactiuser

Thanks Linegod for your help.

Regards
Deviloper
Cacti User
Posts: 256
Joined: Tue Jul 07, 2009 8:03 am

Post by Deviloper »

you granted cactiuser only "local" privileges on the host.

If you grant cactuser access from all (%) or from 127.0.0.1 it will work.
Or just use "localhost" instead of 127.0.0.1.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests