Configuring Alerts Using the CLI
Alerts can also be configured from the CLI using the
configuration alerts context. See Tasks for step-by-step
instructions for configuring these in the CLI.
Adding a Threshold Alert
-
Enter the configuration alerts thresholds context,
and enter the create command.
-
Enter set statname=where [name is the desired statistic to monitor.
To determine the CLI name, enter set statname= and press Tab. For
details on each statistic, see Statistics in Oracle ZFS Storage Appliance Analytics Guide
and click on
the statistic names.
-
Enter set limit=where [number is the desired
threshold.
-
Enter commit. Make note of the "watch" identifier,
the threshold ID, if you want to later add an alert action for this
threshold alert.
-
Enter list to determine the name, including
number, of the new threshold alert. Look for a threshold with the same
limit and statistic name that you just set.
-
Enter select threshold-where [number is the same
number identified in the previous step.
-
Enter list. If necessary, correct any arguments
now. By default, the minimum post, frequency, and minimum cleared
arguments are set to 5 minutes. This means an alert is posted only if
the threshold has been breached for at least 5 minutes, reposts every 5
minutes, and posts after the threshold has cleared for 5 minutes.
-
Enter done, and then enter done
again.
Adding an Alert Action
-
Enter the configuration alerts actions context,
and enter the create command.
-
Go to the "category" property by entering get category =
(unset).
-
Enter set category=thresholds.
-
Enter set thresholdid=where [id is the identifier that was
automatically created for the threshold alert.
-
Enter commit.
-
Enter list to determine the name, including
number, of the new alert action. Look for a threshold without an
assigned action and handler.
-
Enter select actions-where [number is the same
number identified in the previous step.
-
Enter action, and then enter
get.
-
By default, the alert type is email. If this is what you want, skip
to the next step. If not, enter set handler=where [type is either
snmptrap, syslog,
resumedataset, suspenddataset,
resumeworksheet,
suspendworksheet, or
executeworkflow. Then enter
get to view the needed arguments. Only
snmptrap and syslog do not
have arguments.
-
Set each needed argument. For example, to set a subject line for an
email alert, enter set subject=where [subject is the
desired email subject line.
-
Use the show command to ensure all arguments have
been entered.
-
Enter commit, and then enter
list. If necessary, correct any arguments
now.
-
Enter done, and then enter done
again.