Esempio n. 1
0
 protected function getLilacServiceById($id)
 {
     // Get service info
     $res = $this->dbConn->query("select * from nagios_services where service_id = " . $id);
     if ($res) {
         $row = $res->fetch();
         // Okay, let's see
         if (!empty($row['host_id'])) {
             $hostName = $this->getHostNameById($row['host_id']);
             return NagiosServicePeer::getByHostAndDescription($hostName, $row['service_description']);
         }
         if (!empty($row['host_template_id'])) {
             $hostTemplateName = $this->getHostTemplateNameById($row['host_template_id']);
             return NagiosServicePeer::getByHostTemplateAndDescription($hostTemplateName, $row['service_description']);
         }
         if (!empty($row['hostgroup_id'])) {
             $hostgroupName = $this->getHostGroupNameById($row['hostgroup_id']);
             return NagiosServicePeer::getByHostgroupAndDescription($hostgroupName, $row['service_description']);
         }
     }
     return false;
 }