예제 #1
0
function syslog_install_advisor($syslog_exists, $db_version)
{
    global $config, $colors, $syslog_retentions;
    top_header();
    syslog_config_arrays();
    $fields_syslog_update = array('upgrade_type' => array('method' => 'drop_array', 'friendly_name' => __('What upgrade/install type do you wish to use'), 'description' => __('When you have very large tables, performing a Truncate will be much quicker.  If you are
			concerned about archive data, you can choose either Inline, which will freeze your browser for the period
			of this upgrade, or background, which will create a background process to bring your old syslog data
			from a backup table to the new syslog format.  Again this process can take several hours.'), 'value' => 'truncate', 'array' => array('truncate' => __('Truncate Syslog Table'), 'inline' => __('Inline Upgrade'), 'background' => __('Background Upgrade'))), 'engine' => array('method' => 'drop_array', 'friendly_name' => __('Database Storage Engine'), 'description' => __('In MySQL 5.1.6 and above, you have the option to make this a partitioned table by days.  Prior to this
			release, you only have the traditional table structure available.'), 'value' => 'myisam', 'array' => array('myisam' => __('MyISAM Storage'), 'innodb' => __('InnoDB Storage'))), 'db_type' => array('method' => 'drop_array', 'friendly_name' => __('Database Architecutre'), 'description' => __('In MySQL 5.1.6 and above, you have the option to make this a partitioned table by days.
				In MySQL 5.5 and above, you can create multiple partitions per day.
				Prior to MySQL 5.1.6, you only have the traditional table structure available.'), 'value' => 'trad', 'array' => $db_version >= '5.1' ? array('trad' => __('Traditional Table'), 'part' => __('Partitioined Table')) : array('trad' => __('Traditional Table'))), 'days' => array('method' => 'drop_array', 'friendly_name' => __('Retention Policy'), 'description' => __('Choose how many days of Syslog values you wish to maintain in the database.'), 'value' => '30', 'array' => $syslog_retentions), 'mode' => array('method' => 'hidden', 'value' => 'install'), 'id' => array('method' => 'hidden', 'value' => 'syslog'));
    if ($db_version >= 5.5) {
        $fields_syslog_update['dayparts'] = array('method' => 'drop_array', 'friendly_name' => __('Partitions per Day'), 'description' => __('Select the number of partitions per day that you wish to create.'), 'value' => '1', 'array' => array('1' => __('%d Per Day', 1), '2' => __('%d Per Day', 2), '4' => __('%d Per Day', 4), '6' => __('%d Per Day', 6), '12' => __('%d Per Day', 12)));
    }
    if ($syslog_exists) {
        $type = __('Upgrade');
    } else {
        $type = __('Install');
    }
    print "<table align='center' width='80%'><tr><td>\n";
    html_start_box(__('Syslog %s Advisor', $type) . '<', '100%', $colors['header'], '3', 'center', '');
    print "<tr><td>\n";
    if ($syslog_exists) {
        print "<h2 style='color:red;'>" . __('WARNING: Syslog Upgrade is Time Consuming!!!') . "</h2>\n";
        print "<p>" . __('The upgrade of the \'main\' syslog table can be a very time consuming process.  As such, it is recommended
			that you either reduce the size of your syslog table prior to upgrading, or choose the background option</p>
			<p>If you choose the background option, your legacy syslog table will be renamed, and a new syslog table will
			be created.  Then, an upgrade process will be launched in the background.  Again, this background process can
			quite a bit of time to complete.  However, your data will be preserved</p>
			<p>Regardless of your choice,
			all existing removal and alert rules will be maintained during the upgrade process.</p>
			<p>Press <b>\'Upgrade\'</b> to proceed with the upgrade, or <b>\'Cancel\'</b> to return to the Plugins menu.') . "</p>\n\t\t\t</td></tr>";
    } else {
        unset($fields_syslog_update['upgrade_type']);
        print "<p>" . __('You have several options to choose from when installing Syslog.  The first is the Database Architecture.
			Starting with MySQL 5.1.6, you can elect to utilize Table Partitioning to prevent the size of the tables
			from becomming excessive thus slowing queries.') . "</p>\n\t\t\t<p>" . __('You can also set the MySQL storage engine.  If you have not tuned you system for InnoDB storage properties,
			it is strongly recommended that you utilize the MyISAM storage engine.') . "</p>\n\t\t\t<p>" . __('Can can also select the retention duration.  Please keeep in mind that if you have several hosts logging
			to syslog, this table can become quite large.  So, if not using partitioning, you might want to keep the size
			smaller.') . "</p>\n\t\t\t</td></tr>";
    }
    html_end_box();
    print "<form action='plugins.php' method='get'>\n";
    html_start_box(__('Syslog %s Settings', $type), '100%', $colors['header'], '3', 'center', '');
    draw_edit_form(array('config' => array(), 'fields' => inject_form_variables($fields_syslog_update, array())));
    html_end_box();
    syslog_confirm_button('install', 'plugins.php', $syslog_exists);
    print "</td></tr></table>\n";
    bottom_footer();
    exit;
}
예제 #2
0
function syslog_install_advisor($syslog_exists, $db_version)
{
    global $config, $colors, $syslog_retentions;
    include $config["include_path"] . "/top_header.php";
    syslog_config_arrays();
    $fields_syslog_update = array("upgrade_type" => array("method" => "drop_array", "friendly_name" => "What upgrade/install type do you wish to use", "description" => "When you have very large tables, performing a Truncate will be much quicker.  If you are\n\t\t\tconcerned about archive data, you can choose either Inline, which will freeze your browser for the period\n\t\t\tof this upgrade, or background, which will create a background process to bring your old syslog data\n\t\t\tfrom a backup table to the new syslog format.  Again this process can take several hours.", "value" => "truncate", "array" => array("truncate" => "Truncate Syslog Table", "inline" => "Inline Upgrade", "background" => "Background Upgrade")), "engine" => array("method" => "drop_array", "friendly_name" => "Database Storage Engine", "description" => "In MySQL 5.1.6 and above, you have the option to make this a partitioned table by days.  Prior to this\n\t\t\trelease, you only have the traditional table structure available.", "value" => "myisam", "array" => array("myisam" => "MyISAM Storage", "innodb" => "InnoDB Storage")), "db_type" => array("method" => "drop_array", "friendly_name" => "Database Architecutre", "description" => "In MySQL 5.1.6 and above, you have the option to make this a partitioned table by days.\n\t\t\t\tIn MySQL 5.5 and above, you can create multiple partitions per day.\n\t\t\t\tPrior to MySQL 5.1.6, you only have the traditional table structure available.", "value" => "trad", "array" => $db_version >= "5.1" ? array("trad" => "Traditional Table", "part" => "Partitioined Table") : array("trad" => "Traditional Table")), "days" => array("method" => "drop_array", "friendly_name" => "Retention Policy", "description" => "Choose how many days of Syslog values you wish to maintain in the database.", "value" => "30", "array" => $syslog_retentions), "mode" => array("method" => "hidden", "value" => "install"), "id" => array("method" => "hidden", "value" => "syslog"));
    if ($db_version >= 5.5) {
        $fields_syslog_update["dayparts"] = array("method" => "drop_array", "friendly_name" => "Partitions per Day", "description" => "Select the number of partitions per day that you wish to create.", "value" => "1", "array" => array("1" => "1 Per Day", "2" => "2 Per Day", "4" => "4 Per Day", "6" => "6 Per Day", "12" => "12 Per Day"));
    }
    if ($syslog_exists) {
        $type = "Upgrade";
    } else {
        $type = "Install";
    }
    print "<table align='center' width='80%'><tr><td>\n";
    html_start_box("<strong>Syslog " . $type . " Advisor</strong>", "100%", $colors["header"], "3", "center", "");
    print "<tr><td bgcolor='#FFFFFF'>\n";
    if ($syslog_exists) {
        print "<h2 style='color:red;'>WARNING: Syslog Upgrade is Time Consuming!!!</h2>\n";
        print "<p>The upgrade of the 'main' syslog table can be a very time consuming process.  As such, it is recommended\n\t\t\tthat you either reduce the size of your syslog table prior to upgrading, or choose the background option</p>\n\t\t\t<p>If you choose the background option, your legacy syslog table will be renamed, and a new syslog table will\n\t\t\tbe created.  Then, an upgrade process will be launched in the background.  Again, this background process can\n\t\t\tquite a bit of time to complete.  However, your data will be preserved</p>\n\t\t\t<p>Regardless of your choice,\n\t\t\tall existing removal and alert rules will be maintained during the upgrade process.</p>\n\t\t\t<p>Press <b>'Upgrade'</b> to proceed with the upgrade, or <b>'Cancel'</b> to return to the Plugins menu.</p>\n\t\t\t</td></tr>";
    } else {
        unset($fields_syslog_update["upgrade_type"]);
        print "<p>You have several options to choose from when installing Syslog.  The first is the Database Architecture.\n\t\t\tStarting with MySQL 5.1.6, you can elect to utilize Table Partitioning to prevent the size of the tables\n\t\t\tfrom becomming excessive thus slowing queries.</p>\n\t\t\t<p>You can also set the MySQL storage engine.  If you have not tuned you system for InnoDB storage properties,\n\t\t\tit is strongly recommended that you utilize the MyISAM storage engine.</p>\n\t\t\t<p>Can can also select the retention duration.  Please keeep in mind that if you have several hosts logging\n\t\t\tto syslog, this table can become quite large.  So, if not using partitioning, you might want to keep the size\n\t\t\tsmaller.\n\t\t\t</td></tr>";
    }
    html_end_box();
    print "<form action='plugins.php' method='get'>\n";
    html_start_box("<strong>Syslog " . $type . " Settings</strong>", "100%", $colors["header"], "3", "center", "");
    draw_edit_form(array("config" => array(), "fields" => inject_form_variables($fields_syslog_update, array())));
    html_end_box();
    syslog_confirm_button("install", "plugins.php", $syslog_exists);
    print "</td></tr></table>\n";
    exit;
}