Пример #1
0
// Login
if (isset($zabbixAuthHash) && strlen($zabbixAuthHash) > 0) {
    // Try it with the authentication hash we have
    $zabbix->setAuthToken($zabbixAuthHash);
} elseif (strlen($zabbix->getUsername()) > 0 && strlen($zabbix->getPassword()) > 0 && strlen($zabbix->getZabbixApiUrl()) > 0) {
    // Or try it with our info from the cookies
    $zabbix->login();
}
if (!$zabbix->isLoggedIn()) {
    header("Location: index.php");
    exit;
}
require_once "template/header.php";
if ($zabbix->isLoggedIn()) {
    // Retrieve the data in one go
    $zabbix_auth = $zabbix->getAuthToken();
    $zabbix_version = $zabbix->getVersion();
}
?>

<div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
        <ul class="breadcrumb">
            <li>
                <a href="index.php">Home</a> <span class="divider">/</span>
            </li>
            <li class="active">
                About
            </li>
        </ul>
    </div>
Пример #2
0
    // Populate our class
    $zabbix->setUsername($zabbixUser);
    $zabbix->setPassword($zabbixPass);
    $zabbix->setZabbixApiUrl($zabbixApi);
    // Login
    if (strlen($zabbix->getUsername()) > 0 && strlen($zabbix->getPassword()) > 0 && strlen($zabbix->getZabbixApiUrl()) > 0) {
        $zabbix->login();
    }
}
//$zabbix->Login("mattias_api", "test");
if ($zabbix->isLoggedIn()) {
    // Authenticated, save cookie
    setcookie("zabbixUsername", $zabbix->getUsername(), $arrSettings["cookieExpire"]);
    setcookie("zabbixPassword", $zabbix->getPassword(), $arrSettings["cookieExpire"]);
    setcookie("zabbixApi", $zabbix->getZabbixApiUrl(), $arrSettings["cookieExpire"]);
    setcookie("zabbixAuthHash", $zabbix->getAuthToken(), $arrSettings["cookieExpire"]);
}
// "templates"
require_once "template/header.php";
if ($zabbix->isLoggedIn()) {
    // Retrieve the data in one go
    $zabbix_auth = $zabbix->getAuthToken();
    // Get all active triggers (for the counter on homepage);
    $triggersActive = $zabbix->getTriggersActive($arrSettings["minimalSeverity"]);
    if (!is_array($triggersActive)) {
        $triggersActive = array();
    }
    ?>
<div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">