augure
01-04-2006, 05:27 PM
Hello,
ca serait sympa si l'on pouvait organiser la vue 'surveillance' d'un servicegroup par host.
Si l'on ajoute un peu n'importe comment les services on se retrouve vite avec tout melangé.
J'ai fait un patch vite fait pour mais il y a surement plus propre :
--- class/OreonDatabase.class.php.orig 2006-01-04 16:43:26.000000000 +0100
+++ class/OreonDatabase.class.php 2006-01-04 17:33:59.000000000 +0100
@@ -1336,7 +1336,7 @@
function getServiceGroupService($serviceGroup, $service = -1)
{
if (isset($serviceGroup) && $serviceGroup != -1) {
- $req = "SELECT * FROM servicegroup_relation WHERE servicegroup_sg_id = ".$serviceGroup->get_id()."";
+ $req = "SELECT servicegroup_relation.* FROM servicegroup_relation, host_service_relation WHERE servicegroup_relation.servicegroup_sg_id = ".$serviceGroup->get_id()." and servicegroup_relation.service_service_id = host_service_relation.service_service_id ORDER by host_service_relation.host_host_id";
$this->database->query($req);
$ret_ss = array();
for ($i = 0; ($service = $this->database->fetch_array()); $i++)
ca serait sympa si l'on pouvait organiser la vue 'surveillance' d'un servicegroup par host.
Si l'on ajoute un peu n'importe comment les services on se retrouve vite avec tout melangé.
J'ai fait un patch vite fait pour mais il y a surement plus propre :
--- class/OreonDatabase.class.php.orig 2006-01-04 16:43:26.000000000 +0100
+++ class/OreonDatabase.class.php 2006-01-04 17:33:59.000000000 +0100
@@ -1336,7 +1336,7 @@
function getServiceGroupService($serviceGroup, $service = -1)
{
if (isset($serviceGroup) && $serviceGroup != -1) {
- $req = "SELECT * FROM servicegroup_relation WHERE servicegroup_sg_id = ".$serviceGroup->get_id()."";
+ $req = "SELECT servicegroup_relation.* FROM servicegroup_relation, host_service_relation WHERE servicegroup_relation.servicegroup_sg_id = ".$serviceGroup->get_id()." and servicegroup_relation.service_service_id = host_service_relation.service_service_id ORDER by host_service_relation.host_host_id";
$this->database->query($req);
$ret_ss = array();
for ($i = 0; ($service = $this->database->fetch_array()); $i++)