Update api.zabbix.php

This commit is contained in:
Namhyeon Go 2019-04-09 19:41:44 +09:00 committed by GitHub
parent 847edab82e
commit 613761a505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,27 @@
<?php
loadHelper("zabbix.api");
$authenticate = zabbix_authenticate("127.0.0.1", "Admin", "zabbix");
$authenticate = zabbix_authenticate("192.168.0.90", "Admin", "zabbix");
echo "<h1>Zabbix API</h1>";
echo "<h2>Authenticate</h2>";
echo "<pre>";
var_dump($authenticate);
echo "</pre>";
echo "<h2>Zabbix Hosts</h2>";
$hosts = zabbix_retrieve_hosts();
echo "<pre>";
var_dump($hosts);
echo "<pre>";
foreach($hosts->result as $host) {
$items = zabbix_get_items($host->hostid);
echo "<h2>(Host ID: " . $host->hostid . ") " . $host->host . "</h2>";
echo "<pre>";
$items = zabbix_get_items($host->hostid);
var_dump($items);
echo "<pre>";
}