Antennipasi
2009-01-03 55eb00b8e324e18c7a4699ebcc42f37c7eef704b
interface/web/monitor/show_sys_state.php
@@ -48,19 +48,22 @@
$app->tpl->newTemplate("form.tpl.htm");
$app->tpl->setInclude('content_tpl','templates/show_sys_state.htm');
/* Get some translations */
$monTransRefreshsq = $app->lng("monitor_settings_refreshsq_txt");
/*
 * setting the content
 */
if ($_GET['state'] == 'server')
{
    $output = _getServerState($_SESSION['monitor']['server_id'], $_SESSION['monitor']['server_name'], true);
    $title = "Server State";
    $title = $app->lng("monitor_general_serverstate_txt");
    $stateType = 'server';
}
else
{
    $output = _getSysState();
    $title = "System State";
    $title = $app->lng("monitor_general_systemstate_txt");
    $stateType = 'system';
}
@@ -68,10 +71,11 @@
$app->tpl->setVar("state_type",$stateType);
$app->tpl->setVar("title",$title);
$app->tpl->setVar("description",$description);
$app->tpl->setVar("monTransRefreshsq", $monTransRefreshsq);
/*
 Creating the array with the refresh intervals
 Attention: the core-moule ist triggered every 5 minutes,
 Attention: the core-module ist triggered every 5 minutes,
            so reload every 2 minutes is impossible!
*/
$refresh = (isset($_GET["refresh"]))?intval($_GET["refresh"]):0;
@@ -142,15 +146,16 @@
    $res .= '<div class="systemmonitor-state state-'.$serverState.'">';
    $res .= '<div class="systemmonitor-device device-server">';
    $res .= '<div class="systemmonitor-content icons32 ico-'.$serverState.'">';
    $res .= 'Server: ' . $serverName . '<br />';
    $res .= 'State: ' . $serverState . '<br />';
    $res .= $app->lng("monitor_serverstate_server_txt") . ': ' . $serverName . '<br />';
    $res .= $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . '<br />';
    //        $res .= sizeof($messages['ok']) . ' ok | ';
    $res .= sizeof($messages['unknown']) . ' unknown | ';
    $res .= sizeof($messages['info']) . ' info | ';
    $res .= sizeof($messages['warning']) . ' warning | ';
    $res .= sizeof($messages['critical']) . ' critical | ';
    $res .= sizeof($messages['error']) . ' error <br />';
    $res .= sizeof($messages['unknown']) . ' ' . $app->lng("monitor_serverstate_unknown_txt") . ' | ';
    $res .= sizeof($messages['info']) . ' ' . $app->lng("monitor_serverstate_info_txt") . ' | ';
    $res .= sizeof($messages['warning']) . ' ' . $app->lng("monitor_serverstate_warning_txt") . ' | ';
    $res .= sizeof($messages['critical']) . ' ' . $app->lng("monitor_serverstate_critical_txt") . ' | ';
    $res .= sizeof($messages['error']) . ' ' . $app->lng("monitor_serverstate_error_txt") . '<br />';
    $res .= '<br />';
    if ($showAll){
        /*
         * if we have to show all, then we do it...
@@ -179,7 +184,7 @@
        /*
         * if not, we only show a link to the server...
         */
        $res .= "<a href='#' onclick='loadContent(\"monitor/show_sys_state.php?state=server&server=" . $serverId . '|' . $serverName . "\");'> More information...</a>";
        $res .= "<a href='#' onclick='loadContent(\"monitor/show_sys_state.php?state=server&server=" . $serverId . '|' . $serverName . "\");'>" . $app->lng("monitor_serverstate_moreinfo_txt") . "</a>";
    }
    $res .= '</div>';
    $res .= '</div>';
@@ -381,10 +386,33 @@
                break;
        }
    }
   if ($type == 'sys_log'){
      switch ($record['state']) {
         case 'ok':
                $messages['ok'][] = 'The System-Log is O.K. ' .
                                    "<a href='#' onclick='loadContent(\"monitor/log_list.php\");'>[more...]</a>";
                break;
            case 'warning':
                $messages['warning'][] = 'There are some warnings in your System-Log ' .
                                    "<a href='#' onclick='loadContent(\"monitor/log_list.php\");'>[more...]</a>";
                break;
            case 'error':
                $messages['error'][] = 'There are errors in your System-Log ' .
                                    "<a href='#' onclick='loadContent(\"monitor/log_list.php\");'>[more...]</a>";
                break;
            default:
                $messages['unknown'][] = 'sys-log:??? ' .
                                    "<a href='#' onclick='loadContent(\"monitor/log_list.php\");'>[more...]</a>";
                break;
        }
    }
    if ($type == 'log_clamav'){
        /* this type has no state */
    }
    if ($type == 'log_freshclam'){
   if ($type == 'log_freshclam'){
        switch ($record['state']) {
            case 'ok':
                $messages['ok'][] = 'Your Virus-protection is ok ' .
@@ -400,6 +428,7 @@
                break;
        }
    }
    if ($type == 'log_ispconfig'){
        /* this type has no state */
    }
@@ -481,4 +510,4 @@
    }
}
?>
?>