RGM 呼叫 Update 方法以通知正在執行的資源其特性已變更。可以為 xfnts 資料服務變更的唯一特性關係到故障監視器。因此,每當更新特性時,xfnts_update 方法將呼叫 scds_pmf_restart_fm() 以啟動故障監視器。
/* check if the Fault monitor is already running and if so stop * and restart it. The second parameter to scds_pmf_restart_fm() * uniquely identifies the instance of the fault monitor that needs * to be restarted. */ scds_syslog(LOG_INFO, "Restarting the fault monitor."); result = scds_pmf_restart_fm(scds_handle, 0); if (result != SCHA_ERR_NOERR) { scds_syslog(LOG_ERR, "Failed to restart fault monitor."); /* Free up all the memory allocated by scds_initialize */ scds_close(&scds_handle); return (1); } scds_syslog(LOG_INFO, "Completed successfully.");
如果有多個實例,scds_pmf_restart_fm() 的第二個引數會將故障監視器的實例唯一識別為將要重新啟動。範例中的值 0 表示僅有一個故障監視器的實例。