在資料服務範例被置於線上之後,RGM 將呼叫 Monitor_start 方法來啟動 dns_probe 方法。
本小節說明應用程式範例之 Monitor_start 方法的主要部分。本小節並不說明所有回呼方法的共用功能性,例如 parse_args() 函數。本小節也不說明如何使用 syslog() 函數。為所有方法提供共用功能性說明共用功能性。
如需 Monitor_start 方法的完整清單,請參閱Monitor_start 方法程式碼清單。
此方法使用 PMF (pmfadm) 啟動探測。
Monitor_start 方法將獲取 RT_basedir 特性的值,以建構 PROBE 程式的完整路徑名稱。此方法透過使用 pmfadm 的無限重試選項 (-n -1 和 -t -1) 啟動探測, 也就是說,如果探測無法啟動, PMF 將在無限時間內無數次嘗試啟動探測。
# Find where the probe program resides by obtaining the value of the # RT_basedir property of the resource. RT_BASEDIR=`scha_resource_get -O RT_basedir -R $RESOURCE_NAME -G \ $RESOURCEGROUP_NAME` # Start the probe for the data service under PMF. Use the infinite retries # option to start the probe. Pass the resource name, type, and group to the # probe program. pmfadm -c $RESOURCE_NAME.monitor -n -1 -t -1 \ $RT_BASEDIR/dns_probe -R $RESOURCE_NAME -G $RESOURCEGROUP_NAME \ -T $RESOURCETYPE_NAME