mirror of
https://github.com/Cacti/cacti.git
synced 2026-11-09 05:26:50 +09:00
This patch adds functionality to control the debugging of low level routines via defines within the config.php file. In order to allow flexibility, if these are defined, variables within the $config array are primed as true, otherwise false. These elements within the $config array are defined in uppercase to highlight the difference between these are other ordinary configuration optios. Should a function or program need to enable debugging of these various options, simply setting the value to true in the $config array will enable logging from that point. Inversely, setting it to false will stop logging from that point. The only option that is of limited use is DEBUG_READ_CONFIG_OPTION_DB_OPEN that will only work up to the database being open. Setting this to true after the database has already been opened will not automatic turn off the companion option DEBUG_READ_CONFIG_OPTION since the db_connect_real() will not be called again. The list of options and their functionality are: - DEBUG_READ_CONFIG_OPTION : record use of read_config_option() to cacti-option.log in the system temporary folder - DEBUG_READ_CONFIG_OPTION_DB_OPEN : Once the database has been successfully opened, disable DEBUG_READ_CONFIG_OPTION - DEBUG_SQL_CMD : Always write a copy of the SQL being requested to the cacti-sql.log file in the system temporary folder - DEBUG_SQL_FLOW : Write flow of db_xxx calls to the cacti-sql.log in the system temporary folder. The system temporary folder is normally set to one of the following: - Linux, CLI: /tmp/ - Linux, WEB: Apache/Ngix's temporary folder - Windows, CLI: %TEMP% - Windows, WEB: Temp folder of web user or %WINDIR%\TEMP
131 lines
4.3 KiB
Plaintext
131 lines
4.3 KiB
Plaintext
<?php
|
|
/*
|
|
+-------------------------------------------------------------------------+
|
|
| Copyright (C) 2004-2018 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/ |
|
|
+-------------------------------------------------------------------------+
|
|
*/
|
|
|
|
/*
|
|
* Make sure these values reflect your actual database/host/user/password
|
|
*/
|
|
|
|
$database_type = 'mysql';
|
|
$database_default = 'cacti';
|
|
$database_hostname = 'localhost';
|
|
$database_username = 'cactiuser';
|
|
$database_password = 'cactiuser';
|
|
$database_port = '3306';
|
|
$database_ssl = false;
|
|
$database_ssl_key = '';
|
|
$database_ssl_cert = '';
|
|
$database_ssl_ca = '';
|
|
|
|
/*
|
|
* When the cacti server is a remote poller, then these entries point to
|
|
* the main cacti server. Otherwise, these variables have no use and
|
|
* must remain commented out.
|
|
*/
|
|
|
|
#$rdatabase_type = 'mysql';
|
|
#$rdatabase_default = 'cacti';
|
|
#$rdatabase_hostname = 'localhost';
|
|
#$rdatabase_username = 'cactiuser';
|
|
#$rdatabase_password = 'cactiuser';
|
|
#$rdatabase_port = '3306';
|
|
#$rdatabase_ssl = false;
|
|
#$rdatabase_ssl_key = '';
|
|
#$rdatabase_ssl_cert = '';
|
|
#$rdatabase_ssl_ca = '';
|
|
|
|
/*
|
|
* The poller_id of this system. set to `1` for the main cacti web server.
|
|
* Otherwise, you this value should be the poller_id for the remote poller.
|
|
*/
|
|
|
|
$poller_id = 1;
|
|
|
|
/*
|
|
* Set the $url_path to point to the default URL of your cacti install.
|
|
* For exmaple if your cacti install as at `https://serverip/cacti/` this
|
|
* would be set to `/cacti/`.
|
|
*/
|
|
|
|
$url_path = '/cacti/';
|
|
|
|
/*
|
|
* Default session name - session name must contain alpha characters
|
|
*/
|
|
|
|
$cacti_session_name = 'Cacti';
|
|
|
|
/*
|
|
* Save sessions to a database for load balancing
|
|
*/
|
|
|
|
$cacti_db_session = false;
|
|
|
|
/*
|
|
* Optional parameters to define scripts and resource paths. These
|
|
* variables become important when using remote poller installs when the
|
|
* scripts and resource files are not in the main Cacti web server path.
|
|
*/
|
|
|
|
//$scripts_path = '/var/www/html/cacti/scripts';
|
|
//$resource_path = '/var/www/html/cacti/resource/';
|
|
|
|
/*
|
|
* Optional parameter to define a data input whitelist command string. This
|
|
* whitelist file will help protect cacti from unauthorized changes to Cacti
|
|
* data input command string.
|
|
*/
|
|
|
|
//$input_whitelist = '/usr/local/etc/cacti/input_whitelist.json';
|
|
|
|
/*
|
|
* The following are optional variables for debugging low level system
|
|
* functions that are generally only used by Cacti Developers to help
|
|
* identify potential issues in commonly used functions
|
|
*
|
|
* To use them, uncomment and the equivalent field will be set in the
|
|
* $config variable allowing for instant on but still allowing the
|
|
* ability to fine turn and turn them off.
|
|
*/
|
|
|
|
/*
|
|
* Debug the read_config_option program flow
|
|
*/
|
|
# define('DEBUG_READ_CONFIG_OPTION', true);
|
|
|
|
/*
|
|
* Automatically suppress the DEBUG_READ_CONFIG_OPTION
|
|
*/
|
|
# define('DEBUG_READ_CONFIG_OPTION_DB_OPEN', true);
|
|
|
|
/*
|
|
* Always write the SQL command to the cacti log file
|
|
*/
|
|
# define('DEBUG_SQL_CMD', true);
|
|
|
|
/*
|
|
* Debug the flow of calls to the db_xxx functions that
|
|
* are defined in lib/database.php
|
|
*/
|
|
# define('DEBUG_SQL_FLOW', true);
|