cacti on Debian Sarge

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

Moderators: Developers, Moderators

Post Reply
User avatar
Stilzchen
Posts: 4
Joined: Mon Sep 12, 2005 3:27 pm

cacti on Debian Sarge

Post by Stilzchen »

Hello,

I want to use cacti on a Debian Sarge.
After installing it, apt-get said, that I have to read /usr/share/doc/cacti/README.Debian.gz:

Code: Select all

* installation

  using the username and password you provided in debconf (and stored
  in the cacti config file /etc/cacti/debian.php), create a database
  and load up the cacti skeleton.  assuming you chose a database and
  user both named 'cacti':

  mysql -u root -p -e "create database cacti"
  mysql -u root -p -e "grant all privileges on cacti.* to cacti@localhost identified by 'yourpasswordhere'; flush privileges"
  zcat /usr/share/doc/cacti/cacti.sql.gz | mysql -u cacti -p cacti 

  next, go to http://$yourhost/cacti/, and follow the on-screen directions.
But after I have done these steps, I get the following message if I go to http://localhost/cacti/

Code: Select all

Fatal error: Call to undefined function: mysql_connect() in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 338
Can somebody help me?

Thanks
Stilzchen
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

You are missing the php mysql module....

I don't know the name of the package...
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
Stilzchen
Posts: 4
Joined: Mon Sep 12, 2005 3:27 pm

Post by Stilzchen »

But it's installed. Here is my package-list for php and mysql:

Code: Select all

darkstar:~# dpkg -l | grep php
ii  libphp-adodb   4.52-1         The 'adodb' database abstraction layer for p
ii  php4           4.3.10-16      server-side, HTML-embedded scripting languag
ii  php4-cli       4.3.10-16      command-line interpreter for the php4 script
ii  php4-common    4.3.10-16      Common files for packages built from the php
ii  php4-mysql     4.3.10-16      MySQL module for php4
ii  php4-snmp      4.3.10-16      SNMP module for php4

darkstar:~# dpkg -l | grep mysql
ii  libdbd-mysql-p 2.9006-1       A Perl5 database interface to the MySQL data
ii  libmysqlclient 4.0.24-10      mysql database client library
ii  mysql-client   4.0.24-10      mysql database client binaries
ii  mysql-common   4.0.24-10      mysql database common files (e.g. /etc/mysql
ii  mysql-server   4.0.24-10      mysql database server binaries
ii  php4-mysql     4.3.10-16      MySQL module for php4
Here are some more information:

Code: Select all

darkstar:~# dpkg -l | grep rrd  
ii  cacti          0.8.6c-7sarge2 Frontend to rrdtool for monitoring systems a
ii  librrd0        1.0.49-1       Time-series data storage and display system 
ii  rrdtool        1.0.49-1       Time-series data storage and display system

darkstar:~# dpkg -l | grep kernel-image
ii  kernel-image-2 2.6.8-16       Linux kernel image for version 2.6.8 on 386.

Stilzchen
Bateau
Posts: 3
Joined: Thu Sep 15, 2005 8:06 am

Post by Bateau »

you need to edit your php.ini file
i hade the same problem. php didnt coop with "mysql functions". because mysql wasnt configured in php.ini

the only thing... is that i dont remember what line it was :x

think it was to remove the ; sign infront of somthing
User avatar
Stilzchen
Posts: 4
Joined: Mon Sep 12, 2005 3:27 pm

Post by Stilzchen »

Bateau wrote:think it was to remove the ; sign infront of somthing
So I removed the line in front of "extension=mysql.so".

Now I get the following message if I go to http://localhost/cacti/

Code: Select all

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 cacti -p cacti < cacti.sql
But I get this error:

Code: Select all

darkstar:~# mysql -u cacti -p cacti < cacti.sql
-su: cacti.sql: No such file or directory
In one of the steps (read my first post) I had to do

Code: Select all

zcat /usr/share/doc/cacti/cacti.sql.gz | mysql -u cacti -p cacti
So I tried to decompress the cacti.sql.gz into root's home.

Code: Select all

darkstar:/mnt# mysql -u cacti -p cacti < cacti.sql
Enter password:
ERROR 1050 at line 5: Table 'cdef' already exists
Stilzchen
User avatar
pirx
Cacti User
Posts: 199
Joined: Tue Feb 10, 2004 10:08 am
Location: Esslingen, Germany

Post by pirx »

Try to drop the database and add it again.

$ mysqladmin -u cacti -p cacti drop cacti
$ mysql -u cacti -p cacti cacti < cacti.sql

Ralf
User avatar
Stilzchen
Posts: 4
Joined: Mon Sep 12, 2005 3:27 pm

Post by Stilzchen »

I dropped the database in a other way, because your way failed every time (with an without password cacti)

Code: Select all

darkstar:/mnt# mysqladmin drop cacti
Dropping the database is potentially a very bad thing to do.
Any data stored in the database will be destroyed.

Do you really want to drop the 'cacti' database [y/N] y
Database "cacti" dropped

Code: Select all

darkstar:/mnt# mysql -u cacti -p cacti < cacti.sql
Enter password: 
ERROR 1049: Unknown database 'cacti'
So I tried the steps I have read in /usr/share/doc/cacti/README.Debian.gz (see my first post)

Code: Select all

darkstar:/mnt# mysql -u root -p -e "create database cacti"
Enter password: 
darkstar:/mnt# mysql -u root -p -e "grant all privileges on cacti.* to cacti@localhost identified by 'cacti'; flush privileges"
Enter password: 
darkstar:/mnt# zcat /usr/share/doc/cacti/cacti.sql.gz | mysql -u cacti -p cacti
Enter password: 
darkstar:/mnt#
After that the cacti intall guide ist asking me some questions if I go to http://localhost/cacti/. So it seems to work. But 3 steps later I could'nt log in at the login-prompt with username/password cacti.

What's wrong? What have I to do next?

Stilzchen
User avatar
pirx
Cacti User
Posts: 199
Joined: Tue Feb 10, 2004 10:08 am
Location: Esslingen, Germany

Post by pirx »

Stilzchen wrote:I dropped the database in a other way, because your way failed every time (with an without password cacti)
Sorry, I forgot that you have to create the db again.
After that the cacti intall guide ist asking me some questions if I go to http://localhost/cacti/. So it seems to work. But 3 steps later I could'nt log in at the login-prompt with username/password cacti.

What's wrong? What have I to do next?
http://www.cacti.net/downloads/docs/htm ... _unix.html

Code: Select all

8. Point your web browser to:

    http://your-server/cacti/

Log in the with a username/password of admin. You will be required to change this password immediately. Make sure to fill in all of the path variables carefully and correctly on the following screen.
You should try admin/admin as login/password. I don't know if debian is using other default settings.

BTW: I use cacti on a debian sarge system too. But I always use the recent version from www.cacti.net , not the debian package.

Ralf
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests