]> git.pld-linux.org Git - packages/cacti.git/blobdiff - cacti-config.patch
Up to 1.2.26
[packages/cacti.git] / cacti-config.patch
index d9a821c1302e614cd2b53b65e65396d9bedd7137..3f35eac0c11cdeba6947d03c032a6015fc264df2 100644 (file)
---- cacti-0.8.7b/include/global.php    2008-10-05 04:38:29.740276226 +0300
-+++ cacti-0.8.7g/include/global.php    2010-12-13 12:10:44.312310245 +0200
-@@ -42,7 +42,7 @@
- $cacti_session_name = "Cacti";
- /* Include configuration */
--include(dirname(__FILE__) . "/config.php");
+--- cacti-1.2.26/include/global.php~   2023-12-24 03:17:14.000000000 +0100
++++ cacti-1.2.26/include/global.php    2024-02-28 13:34:23.293235210 +0100
+@@ -81,13 +81,7 @@ $disable_log_rotation = false;
+ $config = array();
+-/* Include configuration, or use the defaults */
+-if (file_exists(dirname(__FILE__) . '/config.php')) {
+-      if (!is_readable(dirname(__FILE__) . '/config.php')) {
+-              die('Configuration file include/config.php is present, but unreadable.' . PHP_EOL);
+-      }
+-      include(dirname(__FILE__) . '/config.php');
+-}
 +require '/etc/webapps/cacti/config.php';
  
- if (isset($config["cacti_version"])) {
-       die("Invalid include/config.php file detected.");
-@@ -101,7 +101,8 @@
- $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';
-+$config["rra_path"] = '/var/lib/cacti/rra';
-+$config["log_path"] = '/var/log/cacti';
- /* colors */
- $colors["dark_outline"] = "454E53";
---- cacti-0.8.7g/include/config.php~   2010-12-13 12:15:08.000000000 +0200
-+++ cacti-0.8.7g/include/config.php    2010-12-13 12:16:09.275611204 +0200
-@@ -26,8 +26,8 @@
- $database_type = "mysql";
- $database_default = "cacti";
- $database_hostname = "localhost";
--$database_username = "cactiuser";
--$database_password = "cactiuser";
-+$database_username = "mysql";
-+$database_password = "";
- $database_port = "3306";
- /* load up old style plugins here */
-@@ -34,4 +34,6 @@
- /* Default session name - Session name must contain alpha characters */
- #$cacti_session_name = "Cacti";
-+$url_path = '/cacti/';
-+
- ?>
---- cacti-0.8.7b/include/global_settings.php~  2008-10-05 04:29:33.121404239 +0300
-+++ cacti-0.8.7b/include/global_settings.php   2008-10-05 04:41:11.807395633 +0300
-@@ -96,7 +96,7 @@
-                       "friendly_name" => "Cacti Log File Path",
-                       "description" => "The path to your Cacti log file (if blank, defaults to <path_cacti>/log/cacti.log)",
-                       "method" => "filepath",
--                      "default" => $config["base_path"] . "/log/cacti.log",
-+                      "default" => $config["log_path"] . "/cacti.log",
-                       "max_length" => "255"
-                       ),
-               "pollerpaths_header" => array(
---- cacti-0.8.7b/install/index.php~    2008-10-05 04:29:33.113733438 +0300
-+++ cacti-0.8.7b/install/index.php     2008-10-05 04:41:37.276839747 +0300
-@@ -244,7 +244,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"] = $config["log_path"] . "/cacti.log";
+ if (isset($config['cacti_version'])) {
+       die('Invalid include/config.php file detected.' . PHP_EOL);
+@@ -238,7 +232,7 @@ if ($config['cacti_server_os'] == 'win32
  }
  
- /* SNMP Version */
---- cacti-0.8.7b/lib/functions.php~    2008-10-05 04:29:33.124737562 +0300
-+++ cacti-0.8.7b/lib/functions.php     2008-10-05 04:42:05.046758504 +0300
-@@ -367,7 +367,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 = $config["log_path"] . "/cacti.log";
-               }
-               /* echo the data to the log (append) */
---- cacti-0.8.8/utilities.php~ 2012-10-29 22:14:05.000000000 +0200
-+++ cacti-0.8.8/utilities.php  2012-10-29 22:15:05.781005237 +0200
-@@ -798,12 +798,12 @@
- }
- function utilities_view_logfile() {
--      global $colors, $log_tail_lines, $page_refresh_interval, $refresh;
-+      global $colors, $log_tail_lines, $page_refresh_interval, $config;
-       $logfile = read_config_option("path_cactilog");
+ $config['include_path'] = dirname(__FILE__);
+-$config['rra_path'] = $config['base_path'] . '/rra';
++$config["rra_path"] = '/var/lib/cacti/rra';
  
-       if ($logfile == "") {
--              $logfile = "./log/rrd.log";
-+              $logfile = $config['log_path']. "/rrd.log";
+ /* for multiple pollers, we need to know this location */
+ if (!isset($scripts_path)) {
+--- cacti-1.2.26/include/config.php~   2023-12-24 03:17:14.000000000 +0100
++++ cacti-1.2.26/include/config.php    2024-02-28 13:35:19.813235204 +0100
+@@ -29,8 +29,8 @@
+ $database_type     = 'mysql';
+ $database_default  = 'cacti';
+ $database_hostname = 'localhost';
+-$database_username = 'cactiuser';
+-$database_password = 'cactiuser';
++$database_username = 'mysql';
++$database_password = '';
+ $database_port     = '3306';
+ $database_retries  = 5;
+ $database_ssl      = false;
+--- cacti-1.2.26/poller.php~   2023-12-24 03:17:14.000000000 +0100
++++ cacti-1.2.26/poller.php    2024-02-28 13:36:02.066568538 +0100
+@@ -31,7 +31,7 @@ if (function_exists('pcntl_async_signals
+ ini_set('output_buffering', 'Off');
+-require(__DIR__ . '/include/cli_check.php');
++require('/usr/share/cacti/include/cli_check.php');
+ require_once($config['base_path'] . '/lib/poller.php');
+ require_once($config['base_path'] . '/lib/data_query.php');
+ require_once($config['base_path'] . '/lib/rrd.php');
+diff -ur cacti-1.2.6.org/install/functions.php cacti-1.2.6/install/functions.php
+--- cacti-1.2.6.org/install/functions.php      2019-09-02 10:23:43.000000000 +0200
++++ cacti-1.2.6/install/functions.php  2019-09-26 11:19:59.780907049 +0200
+@@ -794,8 +794,8 @@
+                       $section = 'general';
+               }
+               $logfile = 'install' . '-' . $section;
+-              file_put_contents($config['base_path'] . '/log/' . $logfile . '.log', sprintf($format_log1, $day, $time, $levelname, $data, PHP_EOL), $flags);
+-              file_put_contents($config['base_path'] . '/log/install-complete.log', sprintf($format_log2, $day, $time, $sectionname, $levelname, $data, PHP_EOL), $flags);
++              file_put_contents('/var/log/cacti/' . $logfile . '.log', sprintf($format_log1, $day, $time, $levelname, $data, PHP_EOL), $flags);
++              file_put_contents('/var/log/cacti/install-complete.log', sprintf($format_log2, $day, $time, $sectionname, $levelname, $data, PHP_EOL), $flags);
        }
-       /* helps determine output color */
-@@ -858,7 +858,7 @@
  }
  
- function utilities_clear_logfile() {
--      global $colors;
-+      global $config, $colors;
-       load_current_session_value("refresh", "sess_logfile_refresh", read_config_option("log_refresh_interval"));
-@@ -870,7 +870,7 @@
-       $logfile = read_config_option("path_cactilog");
-       if ($logfile == "") {
--              $logfile = "./log/cacti.log";
-+              $logfile = $config['log_path']."/cacti.log";
-       }
-       html_start_box("<strong>Clear Cacti Log File</strong>", "100%", $colors["header"], "1", "center", "");
---- cacti/poller.php~  2008-10-05 05:08:10.000000000 +0300
-+++ cacti/poller.php   2008-10-05 05:11:11.327705168 +0300
-@@ -1,3 +1,4 @@
-+#!/usr/bin/php
- <?php
- /*
-  +-------------------------------------------------------------------------+
-@@ -32,7 +32,7 @@
- $no_http_headers = true;
- /* start initialization section */
--include(dirname(__FILE__) . "/include/global.php");
-+require "/usr/share/cacti/include/global.php";
- include_once($config["base_path"] . "/lib/poller.php");
- include_once($config["base_path"] . "/lib/data_query.php");
- include_once($config["base_path"] . "/lib/graph_export.php");
+--- cacti-1.2.26/lib/installer.php~    2023-12-24 03:17:14.000000000 +0100
++++ cacti-1.2.26/lib/installer.php     2024-02-28 13:37:29.589901867 +0100
+@@ -528,7 +528,6 @@ class Installer implements JsonSerializa
+               $always_paths = array(
+                       'sys_temp'  => sys_get_temp_dir(),
+-                      'log'       => $config['base_path'] . '/log',
+                       'boost'     => $config['base_path'] . '/cache/boost',
+                       'mibcache'  => $config['base_path'] . '/cache/mibcache',
+                       'realtime'  => $config['base_path'] . '/cache/realtime',
+@@ -3539,7 +3538,7 @@ class Installer implements JsonSerializa
+               $page_nr = 1;
+               $total_rows = 500;
+-              $logcontents = tail_file($config['base_path'] . '/log/cacti.log', 100, -1, ' INSTALL:' , $page_nr, $total_rows);
++                $logcontents = tail_file('/var/log/cacti/cacti.log', 100, -1, ' INSTALL:' , $page_nr, $total_rows);
+               $output_log = '';
+               foreach ($logcontents as $logline) {
+
This page took 0.278701 seconds and 4 git commands to generate.