Help, moved database, no cacti love!

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

Moderators: Developers, Moderators

Post Reply
jcwelch
Posts: 7
Joined: Thu Jan 25, 2007 5:08 pm

Help, moved database, no cacti love!

Post by jcwelch »

Okay, so due to space constraints, i moved the mysql data directory from /var/mysql to a DAS RAID, at /Volumes/LanAdmin/databasestores/mysql

This is on a DP Xserve G5, Mac OS X Server 10.4.8, cacti .8.6i

I added this to /etc/my.cnf in the [mysqld] section:

datadir = /Volumes/LanAdmin/databasestores/mysql/

I changed the socket lines for [mysqld] and [client] to read:

socket = /Volumes/LanAdmin/databasestores/mysql/mysql.sock

and

socket = /Volumes/LanAdmin/databasestores/mysql/mysql.sock

Respectively.

I moved the mysql directory structure via:

cp -Rpv /var/mysql /Volumes/LanAdmin/databasestores/

all the files moved over with correct permissions and ownership.

I can log into the cacti database as the cacti user via :

mysql -u nagios -p cacti

the hostname, username, and password in include/config.php look to be correct.

Trying to access cacti from the web, I get the standard:

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 nagios -p cacti < cacti.sql

message. If I run php -q poller.php from the cacti directory, I get:

xserve02:/usr/local/nagios/share/cacti-0.8.6h admin$ php -q ./poller.php
sh: line 1: -: command not found

the errors I get in my log file read:

02/05/2007 02:26:16 PM - CMDPHP: Poller[0] ERROR: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.

the pertinent sections from that file read:

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "nagios";
$database_password = "nagios";
$database_port = "3306";

ideas?
mvam
Cacti User
Posts: 87
Joined: Wed Jun 01, 2005 2:00 pm
Location: Seattle

Post by mvam »

why are you specifying password cacti on the command line.. and nagios in the config.php file?
jcwelch
Posts: 7
Joined: Thu Jan 25, 2007 5:08 pm

Post by jcwelch »

in the config file, that's how it was set up originally, and working quite well. On the command line, that's just how I test it
mvam
Cacti User
Posts: 87
Joined: Wed Jun 01, 2005 2:00 pm
Location: Seattle

Post by mvam »

well, line 1 is where you specify the path for your binary.. in this case php.
for example

Code: Select all


#!/usr/bin/php -q

make sure you're php line is correct
jcwelch
Posts: 7
Joined: Thu Jan 25, 2007 5:08 pm

Post by jcwelch »

mvam wrote:well, line 1 is where you specify the path for your binary.. in this case php.
for example

Code: Select all


#!/usr/bin/php -q

make sure you're php line is correct
Yep, just checked:

Code: Select all

admin$ which php
/usr/bin/php
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests