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"; ?>
function syslog_db_connect_real($host, $user, $pass, $db_name, $db_type, $port = '3306', $retries = 20) { return db_connect_real($host, $user, $pass, $db_name, $db_type, $port, $retries); }
function cache_db_reconnect() { chdir(dirname(__FILE__)); /* include custom config again - probably settings have been changed in the meantime */ include_once './include/config.php'; /* connect to the database server */ $cnn_id = db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port, $database_ssl); return $cnn_id ? TRUE : FALSE; }
include './plugins/syslog/config.php'; include_once './plugins/syslog/functions.php'; if ($config['poller_id'] > 1) { exit; } /* Connect to the Syslog Database */ global $syslog_cnn, $cnn_id, $database_default; if (empty($syslog_cnn)) { if (strtolower($database_hostname) == strtolower($syslogdb_hostname) && $database_default == $syslogdb_default) { /* move on, using Cacti */ $syslog_cnn = $cnn_id; } else { if (!isset($syslogdb_port)) { $syslogdb_port = '3306'; } $syslog_cnn = db_connect_real($syslogdb_hostname, $syslogdb_username, $syslogdb_password, $syslogdb_default, $syslogdb_type, $syslogdb_port); } } /* If Syslog Collection is Disabled, Exit Here */ if (read_config_option('syslog_enabled') == '') { print "NOTE: Syslog record transferral and alerting/reporting is disabled. Exiting\n"; exit - 1; } /* initialize some uninitialized variables */ $r = read_config_option('syslog_retention'); if ($r == '' or $r < 0 or $r > 365) { if ($r == '') { $sql = 'REPLACE INTO `' . $database_default . "`.`settings` (name, value) VALUES ('syslog_retention','30')"; } else { $sql = 'UPDATE `' . $database_default . "`.`settings` SET value='30' WHERE name='syslog_retention'"; }
function thold_db_reconnect() { global $cnn_id, $database_type, $database_default, $database_hostname, $database_username, $database_password, $database_port, $database_ssl; chdir(dirname(__FILE__)); include_once "../../include/config.php"; if (is_object($cnn_id)) { db_close(); } /* connect to the database server */ return db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port, $database_ssl); }