コード例 #1
0
 /**
  * Export
  *
  * @return void
  */
 public function export()
 {
     parent::export();
     $obj = new Centreon_Object_Relation_Contact_Group_Contact();
     $elements = $obj->getMergedParameters(array("cg_name"), array("contact_name"), -1, 0, "cg_name");
     foreach ($elements as $element) {
         echo $this->action . $this->delim . "addcontact" . $this->delim . $element['cg_name'] . $this->delim . $element['contact_name'] . "\n";
     }
 }
コード例 #2
0
 /**
  * Export
  *
  */
 public function export()
 {
     // generic add & setparam
     parent::export();
     // handle host relationships
     $this->exportHostRel();
     // handle hostgroup relationships
     $this->exportHostgroupRel();
     // handle service relationships
     $this->exportServiceRel();
     // handle servicegroup relationships
     $this->exportServicegroupRel();
     // handle periods
     $this->exportPeriods();
 }
コード例 #3
0
 /**
  * Export
  *
  * @return void
  */
 public function export()
 {
     parent::export();
     $sgs = $this->object->getList(array($this->object->getPrimaryKey(), $this->object->getUniqueLabelField()));
     $relobjSvc = new Centreon_Object_Relation_Service_Group_Service();
     $objSvc = new Centreon_Object_Relation_Host_Service();
     $relobjHgSvc = new Centreon_Object_Relation_Service_Group_Host_Group_Service();
     $objHgSvc = new Centreon_Object_Relation_Host_Group_Service();
     foreach ($sgs as $sg) {
         $sgId = $sg[$this->object->getPrimaryKey()];
         $sgName = $sg[$this->object->getUniqueLabelField()];
         $existingRelationIds = $relobjSvc->getHostIdServiceIdFromServicegroupId($sgId);
         foreach ($existingRelationIds as $val) {
             $elements = $objSvc->getMergedParameters(array('host_name'), array('service_description'), -1, 0, "host_name,service_description", "ASC", array("service_id" => $val['service_id'], "host_id" => $val['host_id']), "AND");
             foreach ($elements as $element) {
                 echo $this->action . $this->delim . "addservice" . $this->delim . $sgName . $this->delim . $element['host_name'] . "," . $element['service_description'] . "\n";
             }
         }
         $existingRelationIds = $relobjHgSvc->getHostGroupIdServiceIdFromServicegroupId($sgId);
         foreach ($existingRelationIds as $val) {
             $elements = $objHgSvc->getMergedParameters(array('hg_name'), array('service_description'), -1, 0, null, null, array("hg_id" => $val['hostgroup_id'], "service_id" => $val['service_id']), "AND");
             foreach ($elements as $element) {
                 echo $this->action . $this->delim . "addhostgroupservice" . $this->delim . $sgName . $this->delim . $element['hg_name'] . "," . $element['service_description'] . "\n";
             }
         }
     }
 }
コード例 #4
0
 /**
  * Export
  *
  * @return void
  */
 public function export()
 {
     parent::export();
     $relObj = new Centreon_Object_Relation_Host_Group_Host();
     $hostObj = new Centreon_Object_Host();
     $hgFieldName = $this->object->getUniqueLabelField();
     $hFieldName = $hostObj->getUniqueLabelField();
     $elements = $relObj->getMergedParameters(array($hgFieldName), array($hFieldName), -1, 0, $hgFieldName, null);
     foreach ($elements as $element) {
         echo $this->action . $this->delim . "addhost" . $this->delim . $element[$hgFieldName] . $this->delim . $element[$hFieldName] . "\n";
     }
 }