Cacti Webpages Not Displaying any graphics

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

Moderators: Developers, Moderators

Post Reply
SuperOmegaSlack
Posts: 16
Joined: Tue Jan 17, 2006 7:22 pm

Cacti Webpages Not Displaying any graphics

Post by SuperOmegaSlack »

I'm running freebsd 7(fresh install), apache 2.2, php5, and mysql 4.1. After running into some problems getting apache to display php correctly... I now can see the cacti index.php, but it only displays the text (never asked for a login). see screen captures below:

this is index.php
Image

this is the create graphs page
Image

Here is the view graphs page
Image

I only found one other issue like this and it was because the cacti database was missing... I checked, and the cacti database is there with the right permissions.

i don't know where else to go with this... anyone else have this problem?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Look in Cacti's global.php for a variable that needs to be updated with the actual path to the web root of you site. It typically is set to "cacti". But by default, I believe it is set to "/". Make sure that is correct.

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?
SuperOmegaSlack
Posts: 16
Joined: Tue Jan 17, 2006 7:22 pm

Post by SuperOmegaSlack »

Thanks for the response, but I don't have a global.php. i even ran a search and no file with that name exists...
Is that the problem? If that was supposed to be automatically created, should I try to reinstall cacti?

Thanks for the help!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Cacti 087* will have a file ./include/global.php. If not, it is broken (or the distro maintainer did sth he should better have skipped)
Reinhard
SuperOmegaSlack
Posts: 16
Joined: Tue Jan 17, 2006 7:22 pm

Post by SuperOmegaSlack »

Again, thanks for the response!!

I removed cacti and downloaded 087b... has the global.php, but I don't see the variable with the web path. here is my global.php... can you help me spot the path that i should check/change?

my cacti directory is in /usr/local/share/



<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2008 The Cacti Group |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
+-------------------------------------------------------------------------+
| Cacti: The Complete RRDTool-based Graphing Solution |
+-------------------------------------------------------------------------+
| This code is designed, written, and maintained by the Cacti Group. See |
| about.php and/or the AUTHORS file for specific developer information. |
+-------------------------------------------------------------------------+
| http://www.cacti.net/ |
+-------------------------------------------------------------------------+
*/

/*
!!! IMPORTANT !!!

The following defaults are not to be altered. Please refer to
include/config.php for user configurable database settings.

*/

/* Default database settings*/
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "****";
$database_username = "****";
$database_password = "****";
$database_port = "****";

/* Default session name - Session name must contain alpha characters */
$cacti_session_name = "Cacti";

/* Include configuration */
include(dirname(__FILE__) . "/config.php");

if (isset($config["cacti_version"])) {
die("Invalid include/config.php file detected.");
exit;
}

/* Files that do not need http header information - Command line scripts */
$no_http_header_files = array(
"cmd.php",
"poller.php",
"poller_commands.php",
"script_server.php",
"query_host_cpu.php",
"query_host_partitions.php",
"sql.php",
"ss_host_cpu.php",
"ss_host_disk.php",
"ss_sql.php",
"add_device.php",
"add_graphs.php",
"add_perms.php",
"add_tree.php",
"copy_user.php",
"poller_export.php",
"poller_graphs_reapply_names.php",
"poller_output_empty.php",
"poller_reindex_hosts.php",
"rebuild_poller_cache.php"
);

$config = array();
$colors = 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"] = strtr(ereg_replace("(.*)[\/\\]include", "\\1", dirname(__FILE__)), "\\", "/");
$config["library_path"] = ereg_replace("(.*[\/\\])include", "\\1lib", dirname(__FILE__));
$config["include_path"] = dirname(__FILE__);
$config["rra_path"] = $config["base_path"] . '/rra';

/* 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"] != "")) {
/* Sanity Check on "Corrupt" PHP_SELF */
if ((!is_file($_SERVER["PHP_SELF"])) && (!is_file($config["base_path"] . '/' . $_SERVER["PHP_SELF"]))) {
if (!is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["PHP_SELF"])) {
if (!((is_file($_SERVER["SCRIPT_FILENAME"])) && (substr_count($_SERVER["SCRIPT_FILENAME"], $_SERVER["PHP_SELF"])))) {
echo "\nInvalid PHP_SELF Path\n";
exit;
}
}
}

/* 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_name($cacti_session_name);
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"] . "/global_constants.php");
include_once($config["include_path"] . "/global_arrays.php");
include_once($config["include_path"] . "/global_settings.php");

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

/* include additional modules */
include_once($config["include_path"] . "/global_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.7b";

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

Post by gandalf »

SuperOmegaSlack wrote: /* used for includes */
$config["base_path"] = strtr(ereg_replace("(.*)[\/\\]include", "\\1", dirname(__FILE__)), "\", "/");
$config["library_path"] = ereg_replace("(.*[\/\\])include", "\\1lib", dirname(__FILE__));
$config["include_path"] = dirname(__FILE__);
$config["rra_path"] = $config["base_path"] . '/rra';
This handles the paths
Reinhard
SuperOmegaSlack
Posts: 16
Joined: Tue Jan 17, 2006 7:22 pm

Post by SuperOmegaSlack »

Thanks!

ok... I see where the base_path is: $config["base_path"] = but after that, the way it defines the directory confuses me.

so here is the code:
$config["base_path"] = strtr(ereg_replace("(.*)[\/\\]include", "\\1", dirname(__
FILE__)), "\\", "/");

My cacti is in "/usr/local/share/cacti/",... I understand that "\\1" is the base, but I tried to change it and still same issue. i don't understand why \\1 is the path?

I also tried changing the path to: "\\", "/usr/local/share/cacti"); and [\/usr/local/share/cacti/\\]include, bur that didn't work either (didn't think it would, those were the only lines with what looked to be a directory "/")

I installed and configured cacti on Linux (Ubuntu) in half an hour... I just wanted to run it on a freebsd box for stability, I didn't realize it was going to be this hard getting it going =D
SuperOmegaSlack
Posts: 16
Joined: Tue Jan 17, 2006 7:22 pm

Post by SuperOmegaSlack »

I started all over again!

I have a fresh install of freebsd 7 and installed apache 2.2, php5, and mysql 50 which I got working before i started with cacti. installed cacti and cactid from the ports collection. made sure I followed all the directions including one I missed last time:

If you are using PLUGIN option set, in file
/usr/local/share/cacti/include/config.php
change the follow line

$config["url_path"] = '/';

with location where your cacti is available. E.g.:

$config["url_path"] = '/cacti/';

if your URL is http://yoursite.com/cacti

But, I still have the same problem!!! Can someone let me know where I am going wrong? If I have to set the paths in global.php... what path do I change exactly?
SuperOmegaSlack
Posts: 16
Joined: Tue Jan 17, 2006 7:22 pm

Post by SuperOmegaSlack »

Is there anyone who has had this problem that was able to resolve it? I'm still having the same problem... I don't know why I can't seem to get past this, and I really want to run cacti on freebsd!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please create a new thread attaching all information you are able to provide. That makes more sense than adding to an old one
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest