Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions www/modules/centreon-clapi/core/class/centreonHost.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,26 @@ public function del($objectName) {
$this->db->query("DELETE FROM service WHERE service_register = '1' AND service_id NOT IN (SELECT service_service_id FROM host_service_relation)");
}

/**
* show_poller Action
* Must show_poller to the Host
*
* @param string $host
* @return mixed
*/

public function show_poller($host) {
/* Regular services */
$sql = "SELECT n.ns_ip_address,n.id FROM ns_host_relation ns,host h, nagios_server n WHERE ns.host_host_id=h.host_id AND ns.nagios_server_id=n.id AND h.host_name = '$host'";
$res = $this->db->query($sql);
$result = $res->fetchAll();
foreach ($result as $row) {
echo $row['ns_ip_address'];
return $row;
}
/**var_dump($result);*/
}

/**
* Tie host to instance (poller)
*
Expand Down