Exemplo n.º 1
0
include 'plugins/syslog/config.php';
include_once 'plugins/syslog/functions.php';
$title = "Syslog Viewer";
/* make sure syslog is setup correctly */
if (!syslog_check_dependencies()) {
    include_once dirname(__FILE__) . "/include/top_syslog_header.php";
    cacti_log("SYSLOG: You are missing a required dependency, please install the '<a href='http://cactiusers.org/'>Settings'</a> plugin.", true, "SYSTEM");
    print "<br><br><center><font color=red>You are missing a dependency for Syslog, please install the '<a href='http://cactiusers.org'>Settings</a>' plugin.</font></color>";
    exit;
}
/* set the default tab */
load_current_session_value("tab", "sess_syslog_tab", "syslog");
$current_tab = $_REQUEST["tab"];
/* validate the syslog post/get/request information */
if ($current_tab != "stats") {
    syslog_request_validation($current_tab);
}
/* draw the tabs */
/* display the main page */
if (isset($_REQUEST["export"])) {
    syslog_export($current_tab);
    /* clear output so reloads wont re-download */
    unset($_REQUEST["output"]);
} else {
    include_once dirname(__FILE__) . "/include/top_syslog_header.php";
    syslog_display_tabs($current_tab);
    if ($current_tab == "current") {
        syslog_view_alarm();
    } elseif ($current_tab == "stats") {
        syslog_statistics();
    } else {
Exemplo n.º 2
0
function save_settings()
{
    global $current_tab;
    syslog_request_validation($current_tab);
    if (sizeof($_REQUEST)) {
        foreach ($_REQUEST as $var => $value) {
            switch ($var) {
                case 'rows':
                    set_user_setting('syslog_rows', get_request_var('rows'));
                    break;
                case 'refresh':
                    set_user_setting('syslog_refresh', get_request_var('refresh'));
                    break;
                case 'removal':
                    set_user_setting('syslog_removal', get_request_var('removal'));
                    break;
                case 'trimval':
                    set_user_setting('syslog_trimval', get_request_var('trimval'));
                    break;
                case 'efacility':
                    set_user_setting('syslog_efacility', get_request_var('efacility'));
                    break;
                case 'epriority':
                    set_user_setting('syslog_epriority', get_request_var('epriority'));
                    break;
                case 'eprogram':
                    set_user_setting('syslog_eprogram', get_request_var('eprogram'));
                    break;
            }
        }
    }
    syslog_request_validation($current_tab, true);
}