206 |
|
* and is converted from the value in the config, |
207 |
|
* which should be seconds. |
208 |
|
* |
209 |
+ |
* Note that if the alert timeout for the current monitor |
210 |
+ |
* is not configured, it will try to obtain the default |
211 |
+ |
* timeout for all Monitor's. If there is no alert timeout |
212 |
+ |
* for either the monitor or a default setting this returns 0. |
213 |
+ |
* |
214 |
|
* Note that this is dependant on the threshold value |
215 |
|
* given, the timeout is obatined from the config, then |
216 |
|
* divided by the threshold value, this allows alerts to |
217 |
|
* progress faster should a higher threshold value be passed |
218 |
|
* |
214 |
– |
* If there is no alert timeout for a |
215 |
– |
* given level, this returns 0 |
216 |
– |
* |
219 |
|
* @param level the alert level |
220 |
|
* @param thresholdLevel the threshold leve we are on |
221 |
|
*/ |
223 |
|
// 0 means we don't use this value |
224 |
|
long timeout = 0; |
225 |
|
try { |
226 |
< |
String timeoutString = _cp.getProperty("Host." + _hostname, "Monitor." + _monitorName + ".alertTimeout." + Alert.alertLevels[level]); |
226 |
> |
String timeoutString; |
227 |
> |
try { |
228 |
> |
timeoutString = _cp.getProperty("Host." + _hostname, "Monitor." + _monitorName + ".alertTimeout." + Alert.alertLevels[level]); |
229 |
> |
} catch (PropertyNotFoundException e) { |
230 |
> |
// if there is no timeout for the monitor |
231 |
> |
// check for a default |
232 |
> |
timeoutString = _cp.getProperty("Host." + _hostname, "Monitor.alertTimeout." + Alert.alertLevels[level]); |
233 |
> |
} |
234 |
|
int threshold = getLastThresholdLevel(); |
235 |
|
if (threshold > 0) { |
236 |
|
timeout = (Long.parseLong(timeoutString) / threshold) * 1000; |