Exemple #1
0
</div>

<div class="container">
    <h2><?php 
    echo $host->host;
    ?>
</h2>

    <h3>Host details</h3>
    <p>
        Host: <?php 
    echo $host->host;
    ?>
 <br />
        <?php 
    if ($zabbix->getVersion() == '1.4') {
        /* Zabbix 2.x compatible */
        echo "Name: " . $host->name . "<br />";
        echo "<h3>Interfaces</h3>";
        $interfaces = (array) $host->interfaces;
        if (is_array($interfaces) && count($interfaces) > 0) {
            foreach ($host->interfaces as $interfaceId => $interfaceValue) {
                echo "DNS: " . $interfaceValue->dns . "<br />";
                echo "IP: " . $interfaceValue->ip . "<br />";
                echo "Zabbix Agent Port: " . $interfaceValue->port . "<br /><br />";
            }
        } else {
            echo '<div class="alert alert-info">This host does not have any configured interfaces.</div>';
        }
    } else {
        /* Zabbix 1.8 compatible */
Exemple #2
0
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>
</div>