Esempio n. 1
0
?>
 监控了以下项目
        </div>
        <div id="mon_list">
        	<table width="100%" border="0" cellspacing="1" cellpadding="0">
  <tr id="list_title">
    <td>状态</td>
    <td>项目名称</td>
    <td>最后数据</td>
    <td>详细情况</td>
    </tr>
    <?php 
$i = 0;
foreach ($list as $k) {
    foreach ($table as $t) {
        @($result = $fun->getHistoryBySql($k->itemid, 1, $t));
        if (@$result['clock'][3]) {
            @$i++;
            ?>
  <tr <?php 
            if (($i + 1) % 2 == 0) {
                echo "class='list_2'";
            }
            ?>
>
    <td><img src="images/public/OK.png" width="15" height="15" /></td>
    <td><?php 
            echo $k->key_;
            ?>
</td>
    <td><?php 
Esempio n. 2
0
<?php

header("Content-Type: image/jpeg");
require_once '../jpgraph/jpgraph.php';
require_once '../jpgraph/jpgraph_line.php';
require_once "login.php";
require_once "config.php";
require_once "curl.php";
require_once "function.php";
if (isset($_GET["itemid"])) {
    $itemid = $_GET["itemid"];
    $key = $_GET["key"];
    $table = $_GET['table'];
    $fun = new fun();
    $result = $fun->getHistoryBySql($itemid, 100, $table);
    for ($i = 0; $i < count($result['clock']); $i++) {
        $result['clock'][$i] = date("H:i:s", $result['clock'][$i]);
    }
    showimg($result['value'], $result['clock'], $key);
} else {
    echo "<script>window.location.href='zabbix.php'</script>";
    exit;
}
function showimg($value, $clock, $key)
{
    $datay1 = $value;
    $graph = new Graph(1000, 400);
    $graph->SetScale("textlin");
    //设置图片外边距(左,右,上,下)
    $graph->img->SetMargin(100, 20, 20, 60);
    $graph->title->Set($key);
Esempio n. 3
0
$host = $fun->getHost($fun->token);
$count = count($host['name']);
echo "共监控" . $count . "台主机<br />";
for ($i = 0; $i < $count; $i++) {
    echo "hostid:<a href='zabbix.php?hostid=" . $host['hostid'][$i] . "'>" . $host['hostid'][$i] . "</a> , name:" . $host['name'][$i] . "<br />";
}
//获取主机Item
//先获取itemid才可以获取指定数据的历史内容
if (isset($hostid)) {
    $result = $fun->getItem($fun->token, $hostid);
    $result = $result->result;
    echo "<br><br>";
    echo "hostid为" . $hostid . "的有效Item有以下几个:<br />";
    foreach ($result as $key) {
        foreach ($table as $t) {
            $sql_result = $fun->getHistoryBySql($key->itemid, 1, $t);
            if (@$sql_result['clock'][3]) {
                echo "itemid:<a href='showhistory.php?itemid=" . $key->itemid . "&table=" . $t . "&key=" . $key->key_ . "'  target='_blank'>" . $key->itemid . "</a> , key_:" . $key->key_ . "&nbsp;&nbsp;&nbsp;";
                echo "<br />";
            }
        }
    }
    /*
    foreach($result as $key){
    	$rs = "itemid:<a href='showhistory.php?itemid=".$key->itemid."&key=".$key->key_."'  target='_blank'>".$key->itemid."</a> , key_:".$key->key_."&nbsp;&nbsp;&nbsp;<br />";
    	echo $rs;
    	
    	//测试用
    	//$rs=$key->key_."<br />";
    	
    	$isnull = $fun->getHistory($fun->token,$key->itemid,1);