Parts of a script

An Aruba Network Analytics Engine script is a Python script that defines which switch resources to monitor and, optionally, rules that define what actions to take when certain conditions are true.

The main structures of a script are the following:

  • Header

  • Import statements

  • Manifest

  • Parameter definitions

  • Agent class constructor, which can contain the following:

    Agent functions

    The agent constructor can contain functions that are restricted to a specific monitor, rule, or action.

    Examples of agent functions include the following:

    • The Graph, Title, and Baseline functions.

    • Functions related to agent events, such as on_agent_restart and on_parameter_change.

    • Functions related to Aruba Analytics Data Collections (ADCs).

    Monitors

    A monitor uses the REST URI of a resource to define the resource on the switch to be monitored by the agent.

    • All monitors generate time-series data about resource they monitor. The data can be viewed in time-series graphs in the Web UI.

    • Optionally, a monitor can be associated with rules that execute actions when certain network conditions are true.

    Rules

    Rules define under which conditions to execute actions.

    • Rules are optional.

    • A rule can be defined with conditions that reference multiple monitors.

    • A rule must contain a condition.

    • A rule is not required to contain actions. A rule that does not contain actions does not generate an alert when an active condition transitions to true.

    Conditions

    The condition of a rule defines the circumstance under which actions, if any, are executed. The clear condition is an optional part of the rule that determines when a network condition or event is no longer occurring.

    Actions

    Actions are the tasks done by the agent in response to defined conditions. Actions can automate many of the things an administrator might do to troubleshoot network issues. Actions are part of a rule.

    Actions are optional.