Skip to main content

event notification create

Contributors
Suggest changes

Create an event notification

Availability: This command is available to cluster administrators at the admin privilege level.

Description

The ` event notification create` command is used to create a new notification of a set of events defined by an event filter to one or more notification destinations.

Parameters

-filter-name <text> - Filter Name

Use this mandatory parameter to specify the name of the event filter. Events that are included in the event filter are forwarded to the destinations specified in the destinations parameter.

The filter name passed to this command must be an existing filter. For more information, see the event filter create command.

-destinations <text>,…​ - List of Event Notification Destinations

Use this mandatory parameter to specify the list of destinations to which the notification should be forwarded. Enter multiple destinations separated by a comma.

The destination passed to this command must be an existing destination. For more information, see the event destination create command.

[-access-control-role <text>] - Access Control Role (privilege: advanced)

Use this parameter to specify the access control role of the event notification. Access control role indicates the user role that created the notification and is used to control access to the notification based on RBAC rules.

Note This is an optional field. If not specified, the currently logged in user role is used. If created by the 'admin' user, the field is left unset.

Examples

The following example creates an event notification for filter name "filter1" to destinations "email_dest, snmp-traphost and syslog_dest":

cluster1::> event notification destination show
                            Hide
Name            Type        Params   Destination
--------------  ----------  ------   ---------------------
email_dest      email       false    test@example.com
snmp-traphost   snmp        true     10.27.12.1 (from "system snmp traphost")
syslog_dest     syslog      false    10.23.12.1
3 entries were displayed.

cluster1::> event filter show -filter-name filter1
Filter      Rule Rule                                    SNMP Trap
Name        Posn Type     Message Name     Severity      Type      Parameters
----------- ---- -------- ---------------- ------------- --------- -----------
filter1
            1    exclude  callhome.bad.ram *              *        *=*
            2    include  callhome.*       ALERT, ERROR   *        *=*
            3    exclude  *                *              *        *=*
3 entries were displayed.

cluster1::> event notification create -filter-name filter1 -destinations email_dest,syslog_dest,snmp-traphost

cluster1::> event notification show
ID     Filter Name       Destinations
-----  ----------------  -----------------
1      filter1           email_dest, syslog_dest, snmp-traphost