diff --git a/includes/polling/applications/proxmox.inc.php b/includes/polling/applications/proxmox.inc.php index 878fc67eb8..64668f5263 100644 --- a/includes/polling/applications/proxmox.inc.php +++ b/includes/polling/applications/proxmox.inc.php @@ -4,6 +4,13 @@ if (isset($config['enable_proxmox']) && $config['enable_proxmox'] && !empty($age $proxmox = $agent_data['app']['proxmox']; } +/** + * Check if a port on a Proxmox VM exists + * @param string $p Port name + * @param string $c Clustername + * @param integer $i VM ID + * @return integer|boolean The port-ID if the port exists, false if it doesn't exist + */ function proxmox_port_exists($i, $c, $p) { if ($row = dbFetchRow("SELECT pmp.id FROM proxmox_ports pmp, proxmox pm WHERE pm.id = pmp.vm_id AND pmp.port = ? AND pm.cluster = ? AND pm.vmid = ?", array($p, $c, $i))) { return $row['id']; @@ -12,6 +19,13 @@ function proxmox_port_exists($i, $c, $p) { return false; } +/** + * Check if a Proxmox VM exists + * @param integer $i VM ID + * @param string $c Clustername + * @param array $pmxcache Reference to the Proxmox VM Cache + * @return boolean true if the VM exists, false if it doesn't + */ function proxmox_vm_exists($i, $c, &$pmxcache) { if (isset($pmxcache[$c][$i]) && $pmxcache[$c][$i] > 0) {