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; } /* remove records that don't need to to be transferred */ syslog_debug("Syslog Batch Transfer / Remove Process started ...... "); $syslog_items = syslog_manage_items("syslog", "syslog_removed"); $syslog_removed = $syslog_items["removed"]; $syslog_xferred = $syslog_items["xferred"]; syslog_debug("Removed " . $syslog_removed . ", Message(s) from the 'syslog' table"); syslog_debug("Xferred " . $syslog_xferred . ", Message(s) to the 'syslog_removed' table"); syslog_debug("Finished processing..."); function display_help() { echo "Syslog Batch Process 1.0, Copyright 2004-2011 - The Cacti Group\n\n"; echo "The Syslog batch process script for Cacti Syslogging.\n\n"; echo "This script removes old messages from main view prior.\n\n"; echo "usage: syslog_batch_transfer.php [--debug|-d]\n\n"; }
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; } /* remove records that don't need to to be transferred */ syslog_debug('Syslog Batch Transfer / Remove Process started ...... '); $syslog_items = syslog_manage_items('syslog', 'syslog_removed'); $syslog_removed = $syslog_items['removed']; $syslog_xferred = $syslog_items['xferred']; syslog_debug("Removed " . $syslog_removed . ", Message(s) from the 'syslog' table"); syslog_debug("Xferred " . $syslog_xferred . ", Message(s) to the 'syslog_removed' table"); syslog_debug('Finished processing...'); function display_help() { echo "Syslog Batch Process 2.0, Copyright 2004-2016 - The Cacti Group\n\n"; echo "The Syslog batch process script for Cacti Syslogging.\n\n"; echo "This script removes old messages from main view prior.\n\n"; echo "usage: syslog_batch_transfer.php [--debug|-d]\n\n"; }