log(__CLASS__, "processAlarm($inst_addr, $evt_spec, $evt_impct)"); try { if ($evt_impct == "SRV_REST") { AlarmManagement::processAlarm( new InstAddr(InstAddrSel::IP4, trim($inst_addr)), date('y.m.d h:i:s'), new EventSpec(EventSel::FREE_FORM, trim($evt_spec)), null, new AlarmSevty(AlarmSevty::AS_CLEAR)); } else { switch ($evt_impct) { case "SRV_AFF": $serinv = new ServInfl(ServInfl::SI_AFF); break; case "SRV_NAFF": $serinv = new ServInfl(ServInfl::SI_NONAFF); break; case "SRV_IDP": $serinv = new ServInfl(ServInfl::SI_INDEP); break; default: throw new Exception("Unknown event impact $evt_impct"); } AlarmManagement::processAlarm( new InstAddr(InstAddrSel::IP4, trim($inst_addr)), date('y.m.d h:i:s'), new EventSpec(EventSel::FREE_FORM, trim($evt_spec)), $serinv); return 0; } } catch(Exception $e) { $logger->logException(__CLASS__, $e); return 99; } return 0; } /** * Funktion mit mehreren Parametern und ohne Rückgabewerte * @return int to be defined (greater 0: error values) * @param string $inst_addr Instance Address: alarm source */ public static function triggerWatchdog( $inst_addr) // instance address { $xml= "free_form/$inst_addr"; require_once 'AlarmInterface/AlarmInterfaceAdministration.php'; $ai = new AlarmInterfaceAdministration(); return $ai->triggerWatchdog($xml); /* // define user $user = getenv("USER"); if ($user == "") putenv("USER=soap"); // load common Configuration include 'AlarmInterface/Watchdog/ConfigurationData.php'; Config::setConfiguration($configurationData); // Logging $logger = Logger::getInstance(); $logger->log(__CLASS__, "function: triggerWatchdog"); $logger->log(__CLASS__, "InstanceAddress " . $inst_addr); $ta = null; try { // start transaction $ta = Transaction::getInstance("AlarmInterface"); $ta->startTA(); // call implementation require_once 'AlarmInterface/Watchdog/Watchdog.php'; require_once 'AlarmManagement/DataTypes/InstAddr.php'; Watchdog::trigger(new InstAddr(InstAddrSel::FREE_FORM, trim($inst_addr))); // commit TA $ta->commitTA(); return 0; } catch(Exception $e) { // rollback TA $logger->logException(__CLASS__, $e); if ($ta) $ta->rollbackTA(); return 99; }*/ } }