#!/usr/bin/php findOneByLocal(true); //$loc_amh = AlarmingManagementHostQuery::create()->findOneByName("LOALMGHO"); if ($loc_amh == NULL) { // Create Local Alarming Management Host $loc_amh = new AlarmingManagementHost(); $loc_amh->setName($lamh_name); $loc_amh->setHostAddr($lamh_host_addr); $loc_amh->setLocal(true); $loc_amh->save(); } //*** //*** Null Alarm Event Descriptor //*** // check null aed $naed = AlarmEventDescriptorQuery::create()->findOneByName("null"); if ($naed == null) { // create null aed $naed = new AlarmEventDescriptor(); $naed->setName("null"); $naed->setEvtSpec(new EventSpec(EventSel::FREE_FORM, "null")); $naed->save(); } //*** //*** Standard Alarm Severity Assignment Rule //*** // Attributes of Standard Alarm Severity Assignment Rule (constant on all events) $sasar_name = 'STALSARU'; $sasar_precedence = 1; $sasar_sev_serv_indep = new AlarmSevty(AlarmSevty::AS_MAJ); $sasar_sev_serv_unaff = new AlarmSevty(AlarmSevty::AS_MIN); $sasar_sev_serv_aff = new AlarmSevty(AlarmSevty::AS_CRIT); $sasar_evt_sel_mode = new SelectMode(SelectMode::SM_EXCL); // Check existence of Standard Alarm Severity Assignment Rule $std_asar = AlarmSeverityAssignmentRuleQuery::create()->findOneByName($sasar_name); if ($std_asar == NULL) { // Create Standard Alarm Severity Assignment Rule $std_asar = new AlarmSeverityAssignmentRule(); $std_asar->setName($sasar_name); $std_asar->setPrecedence($sasar_precedence); $std_asar->setSevServIndep($sasar_sev_serv_indep); $std_asar->setSevServUnaff($sasar_sev_serv_unaff); $std_asar->setSevServAff($sasar_sev_serv_aff); $std_asar->setEvtSelMode($sasar_evt_sel_mode); $std_asar->save(); } //*** //*** Standard Alarm Balance Monitor //*** // Attributes of Standard Alarm Balance Monitor (monitors all events) $sabm_name = 'STALBAMO'; $sabm_uncfd_asta_bal = new AlarmBalance(); $sabm_cfd_asta_bal = new AlarmBalance(); $sabm_evt_sel_mode = new SelectMode(SelectMode::SM_EXCL); // Check existence of Standard Balance Monitor $std_abm = AlarmBalanceMonitorQuery::create()->findOneByName($sabm_name); if ($std_abm == NULL) { // Create Standard Alarm Balance Monitor $std_abm = new AlarmBalanceMonitor(); $std_abm->setName($sabm_name); $std_abm->setUncfdAstaBal($sabm_uncfd_asta_bal); $std_abm->setCfdAstaBal($sabm_cfd_asta_bal); $std_abm->setEvtSelMode($sabm_evt_sel_mode); $std_abm->save(); } //check null bes of STALBAMO $nbes = BalancingEventSelectorQuery::create()->findOneByAedId($naed->getId()); if ($nbes == null) { //create null bes $nbes = new BalancingEventSelector(); $nbes->setAbmId($std_abm->getId()); $nbes->setAedId($naed->getId()); $nbes->save(); } //*** //*** Standard Alarm Forwarding Instruction //*** // Attributes of Standard Alarm Forwarding Instruction (to localhost) $safi_name = 'STALFWIN'; $safi_adm_sta = new AdminState(AdminState::AD_UNLOCK); $safi_evt_sel_mode = new SelectMode(SelectMode::SM_EXCL); // Check existence of Standard Alarm Forwarding Instruction $std_afi = AlarmForwardingInstructionQuery::create()->findOneByName($safi_name); if ($std_afi == NULL) { // Create Standard Alarm Forwarding Instruction $std_afi = new AlarmForwardingInstruction(); $std_afi->setName($safi_name); $std_afi->setAdminState($safi_adm_sta); $std_afi->setEvtSelMode($safi_evt_sel_mode); $std_afi->save(); } //check local dhs of STALFWIN $ldhs = DestinationHostSelectorQuery::create()->findOneByAmhId($loc_amh->getId()); if ($ldhs == null) { //create local dhs $ldhs = new DestinationHostSelector(); $ldhs->setAfiId($std_afi->getId()); $ldhs->setAmhId($loc_amh->getId()); $ldhs->save(); } ?>