Skip to main content
Version: 8.1

system.alarm.acknowledge

This function is used in Python Scripting.

Description

Acknowledges any number of alarms, specified by their event ids. The event id is generated for an alarm when it becomes active, and it is used to identify a particular event from other events for the same source. The alarms will be acknowledged by the logged in user making the call. Additionally, acknowledgement notes may be included and will be stored along with the acknowledgement.

This function uses different parameters based on the scope of the script calling it. Both versions are listed below.

Client Permission Restrictions

Permission Type: Alarm Management

Client access to this scripting function is blocked to users that do not meet the role/zone requirements for the above permission type. This function is unaffected when run in the Gateway scope.

Syntax - Client Scripts

system.alarm.acknowledge(alarmIds, [notes])

Parameters

TypeParameterDescription
String[]alarmIdsList of alarm event ids (uuids) to acknowledge.
StringnotesA string that will be used as the Ack Note on each acknowledged alarm event. If set to None , then an Ack Note note will not be assigned to the alarm event

Returns

Nothing

Changed in 8.1.15
As of 8.1.15, the function now returns the following:

List[String] almIds - List of alarm event ids (UUIDs) that were unable to be acknowledged successfully.

Scope

Vision Client

Syntax - Gateway Scripts

system.alarm.acknowledge(alarmIds, notes, username)

Parameters

TypeParameterDescription
List[String]alarmIdsList of alarm event ids (UUIDs) to acknowledge.
StringnotesA string that will be used as the Ack Note on each acknowledged alarm event. If set to None , then an Ack Note note will not be assigned to the alarm event.
StringusernameThe user that acknowledged the alarm.

Returns

Nothing

Changed in 8.1.15
As of 8.1.15, the function now returns the following:

List[String] almIds - List of alarm event ids (UUIDs) that were unable to be acknowledged successfully.

Scope

Gateway, Perspective Session

Code Examples

Example #1
# This example shows the basic syntax for acknowledging an alarm from a client-based script
system.alarm.acknowledge(['c27c06d8-698f-4814-af89-3c22944f58c5'],'Saw this alarm, did something about it.')
Example #2
# This example shows the basic syntax for acknowledging an alarm from a gateway-based script
system.alarm.acknowledge(['c27c06d8-698f-4814-af89-3c22944f58c5'],'Saw this alarm, did something about it.', 'admin')
Example #3
# This code snippet could be used as a mouseReleased event handler on a Table component (not an Alarm Status Table component)
# whose data was the return value of the system.alarm.queryStatus function.
# It presents a right-click menu to acknowledge the currently selected alarms (for more than one, the table must be set to allow multiple selection).
# This example does not ask for an ack message, and therefore might fail if the alarms we're attempting to acknowledge require notes.
# Also, note that the system will ignore any alarms that have already been acknowledged.

if event.button==3:
rows = event.source.selectedRows
data = event.source.data
if len(rows)>0:
uuids = [str(data.getValueAt(r,'EventId')) for r in rows]
def ack(event, uuids=uuids):
import system
system.alarm.acknowledge(uuids, None)
menu = system.gui.createPopupMenu({'Acknowledge':ack})
menu.show(event)