Callback actions

Callback actions are callback functions that call other Python methods in the script to perform further processing. Callback actions can also call predefined actions and functions that have been imported from the supported Python modules or third-party libraries.

Callback actions are executed when the condition of a rule is true. If a callback action calls a predefined action, that predefined action is executed asynchronously. Callback actions time out after five minutes. This timeout interval is not editable.

This example contains a callback action, action_high_poll_interval, that calls the predefined actions ActionSyslog and ActionCLI:

        uri = '/rest/v1/system?attributes=resource_utilization_poll_interval'
        self.m = Monitor(uri, name='My Monitor')
        self.r = Rule('Resource Utilization Poll Interval')
        self.r.condition('{} > 100 for 30 seconds', [self.m])

    def action_high_poll_interval(self, event):
        ActionSyslog('High Poll Interval')
        ActionCLI("show running-config")

Aruba Network Analytics Engine agent sandboxes run in the default VRF. If a script has a function that requires access to the Internet, this function fails unless the switch administrator configures a DNS name server on the default VRF.

When a condition is met, an event is generated and the callback action is executed using the event details. The event parameter passed to the callback action contains those event details.

The event parameter contains a dictionary of key-value pairs. The dictionary includes the following keys:


The labels created by the time-series database.


The name of the condition that triggers the event.


The name of the monitor.


The name of the time series metric.


The value of the time series metric.


The timestamp of the generated event.


The description of the condition that triggered the event.