File cacti-0.8.7g-cacti-log-path.patch of Package cacti
diff -Naur cacti-0.8.7g-old/include/global_settings.php cacti-0.8.7g/include/global_settings.php
--- cacti-0.8.7g-old/include/global_settings.php 2010-07-10 00:33:46.000000000 +0200
+++ cacti-0.8.7g/include/global_settings.php 2010-07-10 23:43:20.000000000 +0200
@@ -96,9 +96,9 @@
),
"path_cactilog" => array(
"friendly_name" => "Cacti Log File Path",
- "description" => "The path to your Cacti log file (if blank, defaults to <path_cacti>/log/cacti.log)",
+ "description" => "The path to your Cacti log file (if blank, defaults to /var/log/cacti/cacti.log)",
"method" => "filepath",
- "default" => $config["base_path"] . "/log/cacti.log",
+ "default" => "/var/log/cacti/cacti.log",
"max_length" => "255"
),
"pollerpaths_header" => array(
diff -Naur cacti-0.8.7g-old/install/index.php cacti-0.8.7g/install/index.php
--- cacti-0.8.7g-old/install/index.php 2010-07-10 00:33:46.000000000 +0200
+++ cacti-0.8.7g/install/index.php 2010-07-10 23:43:20.000000000 +0200
@@ -266,7 +266,7 @@
if (config_value_exists("path_cactilog")) {
$input["path_cactilog"]["default"] = read_config_option("path_cactilog");
} else {
- $input["path_cactilog"]["default"] = $config["base_path"] . "/log/cacti.log";
+ $input["path_cactilog"]["default"] = "/var/log/cacti/cacti.log";
}
/* SNMP Version */
diff -Naur cacti-0.8.7g-old/lib/functions.php cacti-0.8.7g/lib/functions.php
--- cacti-0.8.7g-old/lib/functions.php 2010-07-10 00:33:46.000000000 +0200
+++ cacti-0.8.7g/lib/functions.php 2010-07-10 23:43:20.000000000 +0200
@@ -491,7 +491,7 @@
/* Log to Logfile */
if ((($logdestination == 1) || ($logdestination == 2)) && (read_config_option("log_verbosity") != POLLER_VERBOSITY_NONE)) {
if ($logfile == "") {
- $logfile = $config["base_path"] . "/log/cacti.log";
+ $logfile = "/var/log/cacti/cacti.log";
}
/* echo the data to the log (append) */
diff -Naur cacti-0.8.7g-old/script_server.pl cacti-0.8.7g/script_server.pl
--- cacti-0.8.7g-old/script_server.pl 2009-12-30 06:36:40.000000000 +0100
+++ cacti-0.8.7g/script_server.pl 2010-07-10 23:43:20.000000000 +0200
@@ -1,4 +1,4 @@
-chdir("./scripts");
+chdir("/usr/share/cacti/scripts");
$loaded = 0;
while ($file = <*.pl>) {
next if $file eq $0;
diff -Naur cacti-0.8.7g-old/utilities.php cacti-0.8.7g/utilities.php
--- cacti-0.8.7g-old/utilities.php 2010-07-10 00:33:46.000000000 +0200
+++ cacti-0.8.7g/utilities.php 2010-07-10 23:43:20.000000000 +0200
@@ -786,7 +786,7 @@
$logfile = read_config_option("path_cactilog");
if ($logfile == "") {
- $logfile = "./log/rrd.log";
+ $logfile = "/var/log/rrd.log";
}
/* helps determine output color */
@@ -1034,7 +1034,7 @@
$logfile = read_config_option("path_cactilog");
if ($logfile == "") {
- $logfile = "./log/cacti.log";
+ $logfile = "/var/log/cacti/cacti.log";
}
html_start_box("<strong>Clear Cacti Log File</strong>", "100%", $colors["header"], "1", "center", "");