changed how zabbix syncs

This commit is contained in:
Luca Haid
2025-04-14 13:52:17 +02:00
parent 1dd0c1de3b
commit 7c30a356dc
6 changed files with 21 additions and 166 deletions

View File

@@ -32,13 +32,6 @@ class Zabbix {
return json_decode($result, true);
}
public function getAllCongestionInterfaces() {
$response = $this->zabbixRequest('item.get', array(
'search' => array('name' => array("Congestion")),
));
return $response['result'];
}
public function getHostById($hostId) {
$response = $this->zabbixRequest('host.get', array(
'hostids' => $hostId
@@ -57,11 +50,19 @@ class Zabbix {
return $response['result'];
}
public function getHosts($hostname) {
$response = $this->zabbixRequest('host.get', array(
'search' => array('name' => array($hostname))
));
return $response['result'];
public function getHosts($hostname = null, $ip = null) {
if ($hostname) {
$response = $this->zabbixRequest('host.get', array(
'search' => array('name' => array($hostname))
));
return $response['result'];
} elseif ($ip) {
$response = $this->zabbixRequest('host.get', array(
'search' => array('ip' => array($ip))
));
return $response['result'];
}
return [];
}
public function getHostInterfaceItems($hostId) {