DEBIAN SARGE CACTI INSTALL HOWTO

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

Moderators: Moderators, Developers

Author
Message
prefetch
Posts: 11
Joined: Thu Sep 01, 2005 5:45 pm

DEBIAN SARGE CACTI INSTALL HOWTO

#1 Post by prefetch » Fri Sep 02, 2005 11:30 am

# assume a fresh sarge installation

this works on a fresh install, so YMMV if you've got one with cruft already in it.

aptitude install cacti
(takes a while - will install apache, php4, mysql - and ask you some questions - just default on all of them. when it asks you about names and passwds, use 'cacti' for everything.)

(also, the message about "libphp-adodb isn't longer installed in /usr/lib/adodb. etc." doesn't seem to be valid - so for now, ignore it.)

adduser cacti

mysqladmin --user=root create cacti

mysql -u root -e "grant all privileges on cacti.* to [email protected] identified by 'cacti'; flush privileges;"

zcat /usr/share/doc/cacti/cacti.sql.gz | mysql -u cacti --password=cacti cacti

echo "extension=mysql.so" >> /etc/php4/apache/php.ini

/etc/init.d/apache restart
(not sure if you actually have to do this step, but it won't hurt.)

got to http://localhost/cacti
click on okay for everything until you get to the main page.
click on the "graphs" tab.
you will see some broken looking stuff.
wait for 10 whole minutes, hit refresh and you will see nice graphs.

that's it.

gg234
Cacti User
Posts: 63
Joined: Fri Oct 07, 2005 11:14 am
Contact:

#2 Post by gg234 » Fri Oct 07, 2005 11:17 am

Hi,

I have just installed the cacti package from debian site.then i went to my browser i am getting following error message

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Warning: mysql_connect(): Access denied for user 'cacti'@'localhost' (using password: YES) in /usr/share/cacti/site/lib/adodb/drivers/adodb-mysql.inc.php on line 339

Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.

Best regards

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

#3 Post by pirx » Mon Oct 10, 2005 4:19 am

Hi,

you need to customize your cacti install and put the user/pass in /usr/share/cacti/site/include/config.php

For example:

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


Ralf

gg234
Cacti User
Posts: 63
Joined: Fri Oct 07, 2005 11:14 am
Contact:

#4 Post by gg234 » Mon Oct 10, 2005 8:34 am

/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
@include('/etc/cacti/debian.php');

/* ----- you probably do not need to change anything below this line ----- */

/* Files that do not need http header information - Command line scripts */
$no_http_header_files = array(
"poller.php",
"cmd.php",
"query_host_cpu.php",
"query_host_partitions.php",
"sql.php",
"ss_host_cpu.php",
"ss_host_disk.php",
"ss_sql.php"
);

$colors = array();
$config = array();

/* this should be auto-detected, set it manually if needed */
$config["cacti_server_os"] = (strstr(PHP_OS, "WIN")) ? "win32" : "unix";

/* built-in snmp support */
$config["php_snmp_support"] = function_exists("snmpget");

/* used for includes */
$config["base_path"] = ereg_replace("(.*)[\/\\]include", "\\1", dirname(__FILE__));
$config["library_path"] = ereg_replace("(.*[\/\\])include", "\\1lib", dirname(__FILE__));
$config["include_path"] = dirname(__FILE__);

/* colors */
$colors["dark_outline"] = "454E53";
$colors["dark_bar"] = "AEB4B7";
$colors["panel"] = "E5E5E5";
$colors["panel_text"] = "000000";
$colors["panel_link"] = "000000";
$colors["light"] = "F5F5F5";
$colors["alternate"] = "E7E9F2";
$colors["panel_dark"] = "C5C5C5";

$colors["header"] = "00438C";
$colors["header_panel"] = "6d88ad";
$colors["header_text"] = "ffffff";
$colors["form_background_dark"] = "E1E1E1";

$colors["form_alternate1"] = "F5F5F5";
$colors["form_alternate2"] = "E5E5E5";

if ((!in_array(basename($_SERVER["PHP_SELF"]), $no_http_header_files, true)) && ($_SERVER["PHP_SELF"] != "")) {
/* we don't want these pages cached */
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
/* we don't want these pages cached */
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

/* initilize php session */
session_start();

/* detect and handle get_magic_quotes */
if (!get_magic_quotes_gpc()) {
function addslashes_deep($value) {
$value = is_array($value) ? array_map('addslashes_deep', $value) : addslashes($value);
return $value;
}

$_POST = array_map('addslashes_deep', $_POST);
$_GET = array_map('addslashes_deep', $_GET);
$_COOKIE = array_map('addslashes_deep', $_COOKIE);
}

/* make sure to start only only Cacti session at a time */
if (!isset($_SESSION["cacti_cwd"])) {
$_SESSION["cacti_cwd"] = $config["base_path"];
}else{
if ($_SESSION["cacti_cwd"] != $config["base_path"]) {
session_unset();
session_destroy();
}
}
}

/* emulate 'register_globals' = 'off' if turned on */
if ((bool)ini_get("register_globals")) {
$not_unset = array("_GET", "_POST", "_COOKIE", "_SERVER", "_SESSION", "_ENV", "_FILES", "database_type", "database_default", "database_hostname", "database_username", "database_password", "config", "colors");

/* Not only will array_merge give a warning if a parameter is not an array, it will
* actually fail. So we check if HTTP_SESSION_VARS has been initialised. */
if (!isset($_SESSION)) {
$_SESSION = array();
}

/* Merge all into one extremely huge array; unset this later */
$input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_SESSION, $_ENV, $_FILES);

unset($input["input"]);
unset($input["not_unset"]);

while (list($var,) = @each($input)) {
if (!in_array($var, $not_unset)) {
unset($$var);
}
}

unset($input);
}

/* display ALL errors */

error_reporting(E_ALL);

/* include base modules */
include($config["library_path"] . "/adodb/adodb.inc.php");
include($config["library_path"] . "/database.php");
include_once($config["library_path"] . "/functions.php");
include_once($config["include_path"] . "/config_constants.php");
include_once($config["include_path"] . "/config_arrays.php");
include_once($config["include_path"] . "/config_settings.php");

/* connect to the database server */
db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type);

/* include additional modules */
include_once($config["include_path"] . "/config_form.php");
include_once($config["library_path"] . "/html.php");
include_once($config["library_path"] . "/html_form.php");
include_once($config["library_path"] . "/html_utility.php");
include_once($config["library_path"] . "/html_validate.php");
include_once($config["library_path"] . "/variables.php");
include_once($config["library_path"] . "/auth.php");

/* current cacti version */
$config["cacti_version"] = "0.8.6c";

?>



this is the file you menctioned where i need to add those details.You can see those bold letters under this or some whre else thanks for your help

StaWha
Posts: 36
Joined: Tue Jul 26, 2005 11:05 am

#5 Post by StaWha » Mon Oct 10, 2005 8:48 am

It seems that with the debian package the file to customize
is '/etc/cacti/debian.php' .

mav21
Posts: 3
Joined: Fri Oct 21, 2005 9:47 pm
Location: Houston

Cacti graphs don't show

#6 Post by mav21 » Fri Oct 21, 2005 9:53 pm

This seems to go here.

I got past the sql errors and it seems the rrdtool is trying to do its job. However i waited over an hour and got no graphed information. Is there something that I am still missing?

Here is one of the graph configuration files;

/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" \
DEF:a="/usr/share/cacti/site/rra/localhost_mem_buffers_3.rrd":mem_buffers:AVERAGE \
DEF:b="/usr/share/cacti/site/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" \
STACK:b#FFC73B:"Swap" \
GPRINT:b:LAST:"Current\:%8.2lf %s" \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:b:MAX:"Maximum\:%8.2lf %s"

Any help would be appreciated

Thanks Chris

User avatar
iNeo
Posts: 35
Joined: Thu Nov 03, 2005 7:29 am

#7 Post by iNeo » Thu Nov 03, 2005 7:35 am

Hi,

I am also trying to get Cacti running on a Debian testing system.

But every seems to be working but there are no graphs :cry:

It is no directory security issue because rra/ has for 775 for root and www-data and
de cron entry runs with the owner www-data for the cacti poller.php.
But there are also no .rrd file in the rra/ directory.

Somebody any idea :?:

iNeo

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#8 Post by gandalf » Sat Nov 05, 2005 2:59 pm

iNeo wrote:Hi,

I am also trying to get Cacti running on a Debian testing system.

But every seems to be working but there are no graphs :cry:

It is no directory security issue because rra/ has for 775 for root and www-data and
de cron entry runs with the owner www-data for the cacti poller.php.
But there are also no .rrd file in the rra/ directory.

Somebody any idea :?:

iNeo
su to your cacti user (www-data in this case) and run the poller manually. You'll probably get some error messages that may help.
Reinhard

soneedu
Posts: 12
Joined: Sun Nov 20, 2005 8:05 pm

#9 Post by soneedu » Sun Nov 20, 2005 10:55 pm

i meet the same problem too. why???

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#10 Post by TheWitness » Mon Nov 21, 2005 5:53 am

Easiest way to solve this one is to log into console using your poller's cron ID and run "php poller.php" from the <path_cacti> directory. You will see STDOUT in your face. Otherwise, redirect STDOUT and STDERR to a file from CRON and look at that file. You will have enlightenment.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

griswold
Posts: 2
Joined: Tue Jun 20, 2006 1:34 pm

#11 Post by griswold » Tue Jun 20, 2006 1:38 pm

Hi,

I just finished an install on a fresh sarge.
Cacti works : I get the 4 default graphs without any problem.

My problem is that I can't use SNMP to monitor my network adapter (or is there another way to do it ?).
On the 'about' page, I get 'PHP SNMP Support: no" despite I installed snmpd and php4-snmp packages.

Any idea ?

JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

#12 Post by JJX » Tue Jun 20, 2006 3:52 pm

did u edit snmpd.conf ?
cacti rulez!

griswold
Posts: 2
Joined: Tue Jun 20, 2006 1:34 pm

#13 Post by griswold » Wed Jun 21, 2006 11:54 am

No it is the default one.

iampuero
Posts: 4
Joined: Tue Sep 05, 2006 9:46 am

CACTI Passwd

#14 Post by iampuero » Tue Sep 05, 2006 9:50 am

First. sorry my english, im chilean...

I install CACTI, i follow yours instruction, but when i connect to http://localhost/cacti , i put my username = cacti and my password = cacti, but say Invalid User Name/Password

Why ????

some can help me???

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#15 Post by gandalf » Wed Sep 06, 2006 11:55 am

For first login, use admin/admin. You may change this using "User Admin"
Reinhard

Post Reply