DEBIAN SARGE CACTI INSTALL HOWTO

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

Moderators: Developers, Moderators

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

DEBIAN SARGE CACTI INSTALL HOWTO

Post by prefetch »

# 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 cacti@localhost 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:

Post by gg234 »

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

Post by pirx »

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:

Post by gg234 »

/* 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

Post by StaWha »

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

Post by mav21 »

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

Post by iNeo »

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: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

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

Post by soneedu »

i meet the same problem too. why???
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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 dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
griswold
Posts: 2
Joined: Tue Jun 20, 2006 1:34 pm

Post by griswold »

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

Post by JJX »

did u edit snmpd.conf ?
cacti rulez!
griswold
Posts: 2
Joined: Tue Jun 20, 2006 1:34 pm

Post by griswold »

No it is the default one.
iampuero
Posts: 4
Joined: Tue Sep 05, 2006 9:46 am

CACTI Passwd

Post by iampuero »

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: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

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

Who is online

Users browsing this forum: No registered users and 2 guests