]> git.pld-linux.org Git - packages/cacti.git/blob - cacti-config.patch
make logrotate compatible with ac
[packages/cacti.git] / cacti-config.patch
1 --- cacti-0.8.7b/include/global.php     2008-10-05 04:38:29.740276226 +0300
2 +++ cacti-0.8.7g/include/global.php     2010-12-13 12:10:44.312310245 +0200
3 @@ -42,7 +42,7 @@
4  $cacti_session_name = "Cacti";
5  
6  /* Include configuration */
7 -include(dirname(__FILE__) . "/config.php");
8 +require '/etc/webapps/cacti/config.php';
9  
10  if (isset($config["cacti_version"])) {
11         die("Invalid include/config.php file detected.");
12 @@ -101,7 +101,8 @@
13  $config["base_path"] = strtr(ereg_replace("(.*)[\/\\]include", "\\1", dirname(__FILE__)), "\\", "/");
14  $config["library_path"] = ereg_replace("(.*[\/\\])include", "\\1lib", dirname(__FILE__));
15  $config["include_path"] = dirname(__FILE__);
16 -$config["rra_path"] = $config["base_path"] . '/rra';
17 +$config["rra_path"] = '/var/lib/cacti/rra';
18 +$config["log_path"] = '/var/log/cacti';
19  
20  /* colors */
21  $colors["dark_outline"] = "454E53";
22 --- cacti-0.8.7g/include/config.php~    2010-12-13 12:15:08.000000000 +0200
23 +++ cacti-0.8.7g/include/config.php     2010-12-13 12:16:09.275611204 +0200
24 @@ -26,8 +26,8 @@
25  $database_type = "mysql";
26  $database_default = "cacti";
27  $database_hostname = "localhost";
28 -$database_username = "cactiuser";
29 -$database_password = "cactiuser";
30 +$database_username = "mysql";
31 +$database_password = "";
32  $database_port = "3306";
33  
34  /* load up old style plugins here */
35 @@ -34,4 +34,6 @@
36  /* Default session name - Session name must contain alpha characters */
37  #$cacti_session_name = "Cacti";
38  
39 +$url_path = '/cacti/';
40 +
41  ?>
42 --- cacti-0.8.7b/include/global_settings.php~   2008-10-05 04:29:33.121404239 +0300
43 +++ cacti-0.8.7b/include/global_settings.php    2008-10-05 04:41:11.807395633 +0300
44 @@ -96,7 +96,7 @@
45                         "friendly_name" => "Cacti Log File Path",
46                         "description" => "The path to your Cacti log file (if blank, defaults to <path_cacti>/log/cacti.log)",
47                         "method" => "filepath",
48 -                       "default" => $config["base_path"] . "/log/cacti.log",
49 +                       "default" => $config["log_path"] . "/cacti.log",
50                         "max_length" => "255"
51                         ),
52                 "pollerpaths_header" => array(
53 --- cacti-0.8.7b/install/index.php~     2008-10-05 04:29:33.113733438 +0300
54 +++ cacti-0.8.7b/install/index.php      2008-10-05 04:41:37.276839747 +0300
55 @@ -244,7 +244,7 @@
56  if (config_value_exists("path_cactilog")) {
57         $input["path_cactilog"]["default"] = read_config_option("path_cactilog");
58  } else {
59 -       $input["path_cactilog"]["default"] = $config["base_path"] . "/log/cacti.log";
60 +       $input["path_cactilog"]["default"] = $config["log_path"] . "/cacti.log";
61  }
62  
63  /* SNMP Version */
64 --- cacti-0.8.7b/lib/functions.php~     2008-10-05 04:29:33.124737562 +0300
65 +++ cacti-0.8.7b/lib/functions.php      2008-10-05 04:42:05.046758504 +0300
66 @@ -367,7 +367,7 @@
67         /* Log to Logfile */
68         if ((($logdestination == 1) || ($logdestination == 2)) && (read_config_option("log_verbosity") != POLLER_VERBOSITY_NONE)) {
69                 if ($logfile == "") {
70 -                       $logfile = $config["base_path"] . "/log/cacti.log";
71 +                       $logfile = $config["log_path"] . "/cacti.log";
72                 }
73  
74                 /* echo the data to the log (append) */
75 --- cacti-0.8.8/utilities.php~  2012-10-29 22:14:05.000000000 +0200
76 +++ cacti-0.8.8/utilities.php   2012-10-29 22:15:05.781005237 +0200
77 @@ -773,12 +773,12 @@ function utilities_clear_user_log() {
78  }
79  
80  function utilities_view_logfile() {
81 -       global $log_tail_lines, $page_refresh_interval, $refresh;
82 +       global $log_tail_lines, $page_refresh_interval, $refresh, $config;
83  
84         $logfile = read_config_option("path_cactilog");
85  
86         if ($logfile == "") {
87 -               $logfile = "./log/rrd.log";
88 +               $logfile = $config['log_path']. "/rrd.log";
89         }
90  
91         /* helps determine output color */
92 @@ -1014,6 +1014,7 @@ function utilities_view_logfile() {
93  }
94  
95  function utilities_clear_logfile() {
96 +       global $config;
97         load_current_session_value("refresh", "sess_logfile_refresh", read_config_option("log_refresh_interval"));
98  
99         $refresh["seconds"] = get_request_var_request("refresh");
100 @@ -870,7 +870,7 @@
101         $logfile = read_config_option("path_cactilog");
102  
103         if ($logfile == "") {
104 -               $logfile = "./log/cacti.log";
105 +               $logfile = $config['log_path']."/cacti.log";
106         }
107  
108         html_start_box("<strong>Clear Cacti Log File</strong>", "100%", $colors["header"], "1", "center", "");
109 --- cacti/poller.php~   2008-10-05 05:08:10.000000000 +0300
110 +++ cacti/poller.php    2008-10-05 05:11:11.327705168 +0300
111 @@ -1,3 +1,4 @@
112 +#!/usr/bin/php
113  <?php
114  /*
115   +-------------------------------------------------------------------------+
116 @@ -32,7 +32,7 @@
117  $no_http_headers = true;
118  
119  /* start initialization section */
120 -include(dirname(__FILE__) . "/include/global.php");
121 +require "/usr/share/cacti/include/global.php";
122  include_once($config["base_path"] . "/lib/poller.php");
123  include_once($config["base_path"] . "/lib/data_query.php");
124  include_once($config["base_path"] . "/lib/graph_export.php");
This page took 0.03426 seconds and 3 git commands to generate.