// Get the Open DB connection from the Context NameSpace var oDb = Context.GetDB; if (null == oDb) { Context.SetResult( 1, " Problem creating the PRO DB object"); } else { // Get the device ID var nDeviceID = Context.GetProperty("DeviceID"); // Definition of max ping value in millisec var nMaxRoundTripTime_Avg = 30; // Retrieve the nPivotStatisticalMonitorTypeToDeviceID var sSql = "SELECT nPivotStatisticalMonitorTypeToDeviceID from PivotStatisticalMonitorTypeToDevice WHERE nDeviceID = " + nDeviceID; var oRs = oDb.Execute(sSql); var nPivotStatisticalMonitorTypeToDeviceID = oRs("nPivotStatisticalMonitorTypeToDeviceID"); // Fonction getDataRs() du fichier rdcpingreport var sSql2 ="SELECT nRoundTripTime_Avg FROM StatisticalPing WHERE nPivotStatisticalMonitorTypeToDeviceID = " + nPivotStatisticalMonitorTypeToDeviceID; var oRs2 = oDb.Execute(sSql2); var nRoundTripTime_Avg = oRs2("nRoundTripTime_Avg"); if ( !oRs.EOF ) { // Display various columns in the debug log (Event Viewer). var sDisplay; sDisplay = "" + nPivotStatisticalMonitorTypeToDeviceID; Context.LogMessage("nPivotStatisticalMonitorTypeToDeviceID=" + sDisplay); sDisplay = "" +nRoundTripTime_Avg; Context.LogMessage("nRoundTripTime_Avg=" + sDisplay); } if ( nRoundTripTime_Avg > nMaxRoundTripTime_Avg) { Context.SetResult( 1, " Failure : ping delay of this device is high of the specified value"); } else { Context.SetResult( 0, " Ok"); } }