reasonableframework/route/api.zabbix.php

23 lines
472 B
PHP
Raw Permalink Normal View History

2019-04-09 06:11:37 +00:00
<?php
2019-04-15 04:33:01 +00:00
/**
* @file api.zabbix.php
* @date 2019-04-15
2022-11-25 14:15:20 +00:00
* @author Go Namhyeon <abuse@catswords.net>
2019-04-15 04:33:01 +00:00
* @brief Zabbix API
*/
2019-04-09 06:11:37 +00:00
loadHelper("zabbix.api");
2019-04-15 04:32:31 +00:00
$data = array();
2019-04-15 07:02:59 +00:00
$data['authenticate'] = zabbix_authenticate();
2019-04-15 04:32:31 +00:00
$data['hosts'] = zabbix_retrieve_hosts();
$data['items'] = array();
2019-04-09 10:41:44 +00:00
2019-04-15 04:32:31 +00:00
foreach($data['hosts']->result as $host) {
$data['items'][$host->hostid] = zabbix_get_items($host->hostid);
2019-04-09 10:41:44 +00:00
}
2019-04-15 04:32:31 +00:00
header("Content-type: application/json");
echo json_encode($data);