diff --git a/doc/API/API-Docs.md b/doc/API/API-Docs.md index 285d2bd287..d6104cfd10 100644 --- a/doc/API/API-Docs.md +++ b/doc/API/API-Docs.md @@ -727,6 +727,7 @@ Input: - up: Only devices that are up - down: Only devices that are down - disabled: Disabled devices + - os: search by os type - mac: search by mac address - ipv4: search by IPv4 address - ipv6: search by IPv6 address (compressed or uncompressed) diff --git a/html/includes/api_functions.inc.php b/html/includes/api_functions.inc.php index 532a34db82..f49de0e7d6 100644 --- a/html/includes/api_functions.inc.php +++ b/html/includes/api_functions.inc.php @@ -220,6 +220,9 @@ function list_devices() $sql = "`status`='0' AND `ignore`='0' AND `disabled`='0'"; } elseif ($type == 'disabled') { $sql = "`disabled`='1'"; + } elseif ($type == 'os') { + $sql = "`os`=?"; + $param[] = $query; } elseif ($type == 'mac') { $join = " LEFT JOIN `ports` ON `devices`.`device_id`=`ports`.`device_id` LEFT JOIN `ipv4_mac` ON `ports`.`port_id`=`ipv4_mac`.`port_id` "; $sql = "`ipv4_mac`.`mac_address`=?";