281 |
|
* @param attributeNum the attribute to advance the alert for |
282 |
|
*/ |
283 |
|
public void escalateAlert(int attributeNum) { |
284 |
< |
setLastAlertLevel(attributeNum, getNextAlertLevel(attributeNum)); |
284 |
> |
// don't escalate if we're already on the last alert |
285 |
> |
if(getLastAlertLevel(attributeNum) != Alert.alertLevels.length -1) { |
286 |
> |
setLastAlertLevel(attributeNum, getNextAlertLevel(attributeNum)); |
287 |
> |
} |
288 |
|
try { |
289 |
|
// note if we fail to get this value, we won't process the res of this |
290 |
|
int reachFINALcount = Integer.parseInt(_cp.getProperty("Host." + _hostname, "Monitor." + _monitorName + ".reachFINALcount")); |
291 |
< |
if ((getLastAlertLevel(attributeNum) == Alert.alertLevels.length - 2) && (_maxLevelCount < reachFINALcount) ) { |
291 |
> |
if (getLastAlertLevel(attributeNum) == Alert.alertLevels.length - 2) { |
292 |
|
_maxLevelCount++; |
293 |
< |
} else { |
294 |
< |
setLastAlertLevel(attributeNum, Alert.alertFINAL); |
293 |
> |
if(_maxLevelCount >= reachFINALcount) { |
294 |
> |
setLastAlertLevel(attributeNum, Alert.alertFINAL); |
295 |
> |
} |
296 |
|
} |
297 |
|
} catch (PropertyNotFoundException e) { |
298 |
|
// we NEVER reach FINAL in this case |