# [solved] Fresh Gentoo installation problems with mysql

## mmartens

Hi, 

First time using cacti on Linux installed many on Windows machines. 

made gentoo install 

emerge apache 

emerge mod_php 

emerge mysql 

emerge snmp 

emerge cacti 

created cacti db 

set user rights 

browse to http://localhost/cacti

followed instructions everything looks ok 

added device but no graph and no mounted partitions showed. 

go to shell 

run php poller.php in cacti dir and the following error came: 

kinux cacti # php poller.php 

Fatal error: Call to undefined function: mysql_connect() in /var/www/localhost/htdocs/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339 

Has enyone a solution? 

Thanks in advance, 

Marcel 

Here some aditional info: 

httpd.conf: 

$database_type = "mysql"; 

$database_default = "cacti"; 

$database_hostname = "localhost"; 

$database_username = "cactiuser"; 

$database_password = "****i";Last edited by mmartens on Wed Jan 18, 2006 11:11 pm; edited 1 time in total

----------

## nixnut

Moved from Installing Gentoo to Networking & Security.

Postinstallation stuff, so moved here.

----------

## synt4x

do:

emerge -pv mod_php

(or 'equery u mod_php' if you have gentoolkit installed)

is 'mysql' in the use flags? This is probably your problem.  If it isn't, edit /etc/make.conf, add mysql to your USE flags, and then type:

emerge -Navu world

This will give you a list of packages that need rebuilding to support the mysql client library.  Rebuild them, and you should be set.

----------

## mmartens

Thx for the quick reply

doing the emerge -Navu world right now let you know when finished.

fyi:

cacti give's following error on graph:

RRDTool Says:

ERROR: opening '/var/www/localhost/htdocs/cacti/rra/localhost_mem_buffers_3.rrd': No such file or directory

it is not creating the rrd files and the log file is also emty.

Thx again synt4x

----------

## mmartens

Gentoo is emerging 55 packages and is now busy with 19 so it's going to take a while.

I'll keep you posted!

----------

## kashani

You might want to try chown -R apache: /var/www/localhost/htdocs/cacti/

I'd noticed similar issues with MRTG in the past.

kashani

----------

## mmartens

Thx for the reply!

That did it for the query "added device but no graph and no mounted partitions showed"

but still no graphs.

here the shell:

kinux ~ # chown -R apache: /var/www/localhost/htdocs/cacti/

kinux ~ # cd /var/www/localhost/htdocs/cacti/

kinux cacti # php poller.php

Fatal error: Call to undefined function:  mysql_connect() in /var/www/localhost/htdocs/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 339

kinux cacti #

cacti:

RRDTool Says:

ERROR: opening '/var/www/localhost/htdocs/cacti/rra/localhost_mem_buffers_3.rrd': No such file or directory

----------

## mmartens

the log is functioning as well:

01/18/2006 11:13:33 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=1137539612 --end=1137626012 --title="Localhost - Processes" --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 COMMENT:"From 2006/01/17 23\:13\:32 To 2006/01/18 23\:13\:32\c" COMMENT:" \n" --vertical-label="processes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_proc_7.rrd":proc:AVERAGE AREA:a#F51D30:"Running Processes" GPRINT:a:LAST:"Current\:%8.0lf" GPRINT:a:AVERAGE:"Average\:%8.0lf" GPRINT:a:MAX:"Maximum\:%8.0lf"  

01/18/2006 11:13:33 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=1137539612 --end=1137626012 --title="Localhost - Logged in Users" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 COMMENT:"From 2006/01/17 23\:13\:32 To 2006/01/18 23\:13\:32\c" COMMENT:" \n" --vertical-label="users" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_users_6.rrd":users:AVERAGE AREA:a#4668E4:"Users" GPRINT:a:LAST:"Current\:%8.0lf" GPRINT:a:AVERAGE:"Average\:%8.0lf" GPRINT:a:MAX:"Maximum\:%8.0lf"  

01/18/2006 11:13:33 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=1137539612 --end=1137626012 --title="Localhost - Load Average" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --units-exponent=0 COMMENT:"From 2006/01/17 23\:13\:32 To 2006/01/18 23\:13\:32\c" COMMENT:" \n" --vertical-label="processes in the run queue" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_load_1min_5.rrd":load_1min:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_load_1min_5.rrd":load_5min:AVERAGE DEF:c="/var/www/localhost/htdocs/cacti/rra/localhost_load_1min_5.rrd":load_15min:AVERAGE CDEF:cdefg=TIME,1137625713,GT,a,a,UN,0,a,IF,IF,TIME,1137625713,GT,b,b,UN,0,b,IF,IF,TIME,1137625713,GT,c,c,UN,0,c,IF,IF,+,+ AREA:a#EACC00:"1 Minute Average" GPRINT:a:LAST:" Current\:%8.2lf\n" AREA:b#EA8F00:"5 Minute Average":STACK GPRINT:b:LAST:" Current\:%8.2lf\n" AREA:c#FF0000:"15 Minute Average":STACK GPRINT:c:LAST:"Current\:%8.2lf\n" LINE1:cdefg#000000:""  

01/18/2006 11:13:33 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=1137539612 --end=1137626012 --title="Localhost - Disk Space - /dev/hda3" --rigid --base=1024 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 COMMENT:"From 2006/01/17 23\:13\:32 To 2006/01/18 23\:13\:32\c" COMMENT:" \n" --vertical-label="bytes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_hdd_free_8.rrd":hdd_used:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_hdd_free_8.rrd":hdd_free:AVERAGE CDEF:cdefa=a,1024,* CDEF:cdefe=b,1024,* CDEF:cdefi=TIME,1137625713,GT,a,a,UN,0,a,IF,IF,TIME,1137625713,GT,b,b,UN,0,b,IF,IF,+,1024,* AREA:cdefa#F51D30:"Used" GPRINT:cdefa:LAST:" Current\:%8.2lf %s" GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" AREA:cdefe#002A97:"Available":STACK GPRINT:cdefe:LAST:"Current\:%8.2lf %s" GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" LINE2:cdefi#000000:"Total" GPRINT:cdefi:LAST:" Current\:%8.2lf %s" GPRINT:cdefi:AVERAGE:"Average\:%8.2lf %s" GPRINT:cdefi:MAX:"Maximum\:%8.2lf %s\n"  

01/18/2006 11:13:33 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=1137539612 --end=1137626012 --title="Localhost - Memory Usage" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 COMMENT:"From 2006/01/17 23\:13\:32 To 2006/01/18 23\:13\:32\c" COMMENT:" \n" --vertical-label="kilobytes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_mem_buffers_3.rrd":mem_buffers:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_mem_swap_4.rrd":mem_swap:AVERAGE AREA:a#FF4105:"Free" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s" GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" AREA:b#FFC73B:"Swap":STACK GPRINT:b:LAST:"Current\:%8.2lf %s" GPRINT:b:AVERAGE:"Average\:%8.2lf %s" GPRINT:b:MAX:"Maximum\:%8.2lf %s"  

01/18/2006 11:11:58 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-86400 --end=-300 --title="Localhost - Memory Usage" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label="kilobytes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_mem_buffers_3.rrd":mem_buffers:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_mem_swap_4.rrd":mem_swap:AVERAGE AREA:a#FF4105:"Free" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s" GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" AREA:b#FFC73B:"Swap":STACK GPRINT:b:LAST:"Current\:%8.2lf %s" GPRINT:b:AVERAGE:"Average\:%8.2lf %s" GPRINT:b:MAX:"Maximum\:%8.2lf %s"  

01/18/2006 11:11:58 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-86400 --end=-300 --title="Localhost - Memory Usage" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label="kilobytes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_mem_buffers_3.rrd":mem_buffers:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_mem_swap_4.rrd":mem_swap:AVERAGE AREA:a#FF4105:"Free" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s" GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" AREA:b#FFC73B:"Swap":STACK GPRINT:b:LAST:"Current\:%8.2lf %s" GPRINT:b:AVERAGE:"Average\:%8.2lf %s" GPRINT:b:MAX:"Maximum\:%8.2lf %s"  

01/18/2006 11:03:57 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-86400 --end=-300 --title="Localhost - Memory Usage" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label="kilobytes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_mem_buffers_3.rrd":mem_buffers:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_mem_swap_4.rrd":mem_swap:AVERAGE AREA:a#FF4105:"Free" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s" GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" AREA:b#FFC73B:"Swap":STACK GPRINT:b:LAST:"Current\:%8.2lf %s" GPRINT:b:AVERAGE:"Average\:%8.2lf %s" GPRINT:b:MAX:"Maximum\:%8.2lf %s"  

01/18/2006 11:03:57 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-86400 --end=-300 --title="Localhost - Memory Usage" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label="kilobytes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_mem_buffers_3.rrd":mem_buffers:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_mem_swap_4.rrd":mem_swap:AVERAGE AREA:a#FF4105:"Free" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s" GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" AREA:b#FFC73B:"Swap":STACK GPRINT:b:LAST:"Current\:%8.2lf %s" GPRINT:b:AVERAGE:"Average\:%8.2lf %s" GPRINT:b:MAX:"Maximum\:%8.2lf %s"  

01/18/2006 11:02:15 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=1137538934 --end=1137625334 --title="Localhost - Processes" --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 COMMENT:"From 2006/01/17 23\:02\:14 To 2006/01/18 23\:02\:14\c" COMMENT:" \n" --vertical-label="processes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_proc_7.rrd":proc:AVERAGE AREA:a#F51D30:"Running Processes" GPRINT:a:LAST:"Current\:%8.0lf" GPRINT:a:AVERAGE:"Average\:%8.0lf" GPRINT:a:MAX:"Maximum\:%8.0lf"  

01/18/2006 11:02:15 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=1137538934 --end=1137625334 --title="Localhost - Logged in Users" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 COMMENT:"From 2006/01/17 23\:02\:14 To 2006/01/18 23\:02\:14\c" COMMENT:" \n" --vertical-label="users" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_users_6.rrd":users:AVERAGE AREA:a#4668E4:"Users" GPRINT:a:LAST:"Current\:%8.0lf" GPRINT:a:AVERAGE:"Average\:%8.0lf" GPRINT:a:MAX:"Maximum\:%8.0lf"  

01/18/2006 11:02:15 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=1137538934 --end=1137625334 --title="Localhost - Load Average" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --units-exponent=0 COMMENT:"From 2006/01/17 23\:02\:14 To 2006/01/18 23\:02\:14\c" COMMENT:" \n" --vertical-label="processes in the run queue" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_load_1min_5.rrd":load_1min:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_load_1min_5.rrd":load_5min:AVERAGE DEF:c="/var/www/localhost/htdocs/cacti/rra/localhost_load_1min_5.rrd":load_15min:AVERAGE CDEF:cdefg=TIME,1137625035,GT,a,a,UN,0,a,IF,IF,TIME,1137625035,GT,b,b,UN,0,b,IF,IF,TIME,1137625035,GT,c,c,UN,0,c,IF,IF,+,+ AREA:a#EACC00:"1 Minute Average" GPRINT:a:LAST:" Current\:%8.2lf\n" AREA:b#EA8F00:"5 Minute Average":STACK GPRINT:b:LAST:" Current\:%8.2lf\n" AREA:c#FF0000:"15 Minute Average":STACK GPRINT:c:LAST:"Current\:%8.2lf\n" LINE1:cdefg#000000:""  

01/18/2006 11:02:15 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=1137538934 --end=1137625334 --title="Localhost - Disk Space - /dev/hda3" --rigid --base=1024 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 COMMENT:"From 2006/01/17 23\:02\:14 To 2006/01/18 23\:02\:14\c" COMMENT:" \n" --vertical-label="bytes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_hdd_free_8.rrd":hdd_used:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_hdd_free_8.rrd":hdd_free:AVERAGE CDEF:cdefa=a,1024,* CDEF:cdefe=b,1024,* CDEF:cdefi=TIME,1137625035,GT,a,a,UN,0,a,IF,IF,TIME,1137625035,GT,b,b,UN,0,b,IF,IF,+,1024,* AREA:cdefa#F51D30:"Used" GPRINT:cdefa:LAST:" Current\:%8.2lf %s" GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" AREA:cdefe#002A97:"Available":STACK GPRINT:cdefe:LAST:"Current\:%8.2lf %s" GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" LINE2:cdefi#000000:"Total" GPRINT:cdefi:LAST:" Current\:%8.2lf %s" GPRINT:cdefi:AVERAGE:"Average\:%8.2lf %s" GPRINT:cdefi:MAX:"Maximum\:%8.2lf %s\n"  

01/18/2006 11:02:15 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=1137538934 --end=1137625334 --title="Localhost - Memory Usage" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 COMMENT:"From 2006/01/17 23\:02\:14 To 2006/01/18 23\:02\:14\c" COMMENT:" \n" --vertical-label="kilobytes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_mem_buffers_3.rrd":mem_buffers:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_mem_swap_4.rrd":mem_swap:AVERAGE AREA:a#FF4105:"Free" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s" GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" AREA:b#FFC73B:"Swap":STACK GPRINT:b:LAST:"Current\:%8.2lf %s" GPRINT:b:AVERAGE:"Average\:%8.2lf %s" GPRINT:b:MAX:"Maximum\:%8.2lf %s"  

01/18/2006 10:57:31 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-86400 --end=-300 --title="Localhost - Memory Usage" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label="kilobytes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_mem_buffers_3.rrd":mem_buffers:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_mem_swap_4.rrd":mem_swap:AVERAGE AREA:a#FF4105:"Free" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s" GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" AREA:b#FFC73B:"Swap":STACK GPRINT:b:LAST:"Current\:%8.2lf %s" GPRINT:b:AVERAGE:"Average\:%8.2lf %s" GPRINT:b:MAX:"Maximum\:%8.2lf %s"  

01/18/2006 10:57:31 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-86400 --end=-300 --title="Localhost - Memory Usage" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label="kilobytes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_mem_buffers_3.rrd":mem_buffers:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_mem_swap_4.rrd":mem_swap:AVERAGE AREA:a#FF4105:"Free" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s" GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" AREA:b#FFC73B:"Swap":STACK GPRINT:b:LAST:"Current\:%8.2lf %s" GPRINT:b:AVERAGE:"Average\:%8.2lf %s" GPRINT:b:MAX:"Maximum\:%8.2lf %s"  

01/18/2006 10:56:16 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-86400 --end=-300 --title="Localhost - Memory Usage" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label="kilobytes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_mem_buffers_3.rrd":mem_buffers:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_mem_swap_4.rrd":mem_swap:AVERAGE AREA:a#FF4105:"Free" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s" GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" AREA:b#FFC73B:"Swap":STACK GPRINT:b:LAST:"Current\:%8.2lf %s" GPRINT:b:AVERAGE:"Average\:%8.2lf %s" GPRINT:b:MAX:"Maximum\:%8.2lf %s"  

01/18/2006 10:56:16 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-86400 --end=-300 --title="Localhost - Memory Usage" --rigid --base=1000 --height=120 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label="kilobytes" --slope-mode DEF:a="/var/www/localhost/htdocs/cacti/rra/localhost_mem_buffers_3.rrd":mem_buffers:AVERAGE DEF:b="/var/www/localhost/htdocs/cacti/rra/localhost_mem_swap_4.rrd":mem_swap:AVERAGE AREA:a#FF4105:"Free" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s" GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" AREA:b#FFC73B:"Swap":STACK GPRINT:b:LAST:"Current\:%8.2lf %s" GPRINT:b:AVERAGE:"Average\:%8.2lf %s" GPRINT:b:MAX:"Maximum\:%8.2lf %s"

----------

## mmartens

Thx

The emerge -Navu world workt!!!

after i rebooted and the graphs are shown!

Thx again

----------

