diff --git a/web/zm_html_view_montagestatus.php b/web/zm_html_view_montagestatus.php
index 474a6692d..1fbf053f6 100644
--- a/web/zm_html_view_montagestatus.php
+++ b/web/zm_html_view_montagestatus.php
@@ -49,8 +49,12 @@ elseif ( $status == STATE_TAPE )
$status_string = $zmSlangRecord;
}
$fps_string = sprintf( "%.2f", $fps );
-$new_alarm = ( $status > STATE_PREALARM && $last_status <= STATE_PREALARM );
-$old_alarm = ( $status <= STATE_PREALARM && $last_status > STATE_PREALARM );
+
+$is_alarmed = ( $status == STATE_ALARM || $status == STATE_ALERT );
+$was_alarmed = ( $last_status == STATE_ALARM || $last_status == STATE_ALERT );
+
+$new_alarm = ( $is_alarmed && !$was_alarmed );
+$old_alarm = ( !$is_alarmed && $was_alarmed );
$refresh = (($status>=STATE_PREALARM)&&($status<=STATE_ALERT))?1:ZM_WEB_REFRESH_STATUS;
$url = "$PHP_SELF?view=montagestatus&mid=$mid&last_status=$status";
diff --git a/web/zm_html_view_watchstatus.php b/web/zm_html_view_watchstatus.php
index 5c39610a9..c1a95c2a6 100644
--- a/web/zm_html_view_watchstatus.php
+++ b/web/zm_html_view_watchstatus.php
@@ -61,8 +61,13 @@ elseif ( $status == STATE_TAPE )
$status_string = $zmSlangRecord;
}
$fps_string = sprintf( "%.2f", $fps );
-$new_alarm = ( $status > STATE_PREALARM && $last_status <= STATE_PREALARM );
-$old_alarm = ( $status <= STATE_PREALARM && $last_status > STATE_PREALARM );
+
+$is_alarmed = ( $status == STATE_ALARM || $status == STATE_ALERT );
+$was_alarmed = ( $last_status == STATE_ALARM || $last_status == STATE_ALERT );
+
+$new_alarm = ( $is_alarmed && !$was_alarmed );
+$old_alarm = ( !$is_alarmed && $was_alarmed );
+
$refresh = (isset($force)||$forced||isset($disable)||$disabled||(($status>=STATE_PREALARM)&&($status<=STATE_ALERT)))?1:ZM_WEB_REFRESH_STATUS;
$url = "$PHP_SELF?view=watchstatus&mid=$mid&last_status=$status".(($force||$forced)?"&forced=1":"").(($disable||$disabled)?"&disabled=1":"");
diff --git a/web/zm_xhtml_view_watch.php b/web/zm_xhtml_view_watch.php
index b82e0618f..ce29c7fef 100644
--- a/web/zm_xhtml_view_watch.php
+++ b/web/zm_xhtml_view_watch.php
@@ -54,8 +54,12 @@ elseif ( $status == STATE_TAPE )
$status_string = $zmSlangRecord;
}
$fps_string = sprintf( "%.2f", $fps );
-$new_alarm = ( $status > STATE_PREALARM && $last_status <= STATE_PREALARM );
-$old_alarm = ( $status <= STATE_PREALARM && $last_status > STATE_PREALARM );
+
+$is_alarmed = ( $status == STATE_ALARM || $status == STATE_ALERT );
+$was_alarmed = ( $last_status == STATE_ALARM || $last_status == STATE_ALERT );
+
+$new_alarm = ( $is_alarmed && !$was_alarmed );
+$old_alarm = ( !$is_alarmed && $was_alarmed );
$result = mysql_query( "select * from Monitors where Function != 'None' order by Sequence" );
$monitors = array();