Call a Specialist Today! (02) 9388 1741
Free Delivery! Free Delivery!

The Latest NetApp News
Product and Solution Information, Press Releases, Announcements

ONTAP REST APIs: Automate Notification of High-Severity Events
Posted: Fri Jul 17, 2020 09:39:14 AM
 

A priority for IT organizations is the ability to manage various levels of severity. “Severity” differs for every organization, depending on the use case. An event can be of high severity — for example, an emergency, alert, or error message — or it could be of low severity, as with a notice or informational message. Most customers want the flexibility to choose and automate which events and severity they should get notified for. ONTAP® REST APIs simplifies the event management with modernized and consolidate direct REST endpoints and Python Client Libraries, which enables users to get notified of preferred events automatically.

Events

NetApp® ONTAP® software has various types of messages for all the storage actions and operations it performs (for example, callhome.vol.space.crit, sm.syncmirror.out.of.sync). There are also predefined filters (for example, default-trap-events, important-events) that can alert you about severe events.

You can also customize your own filters that uses the predefined messages and severity levels available in ONTAP.

Before proceeding further, let’s clarify some of this terminology:

  • Filters are defined to select which events to process.
  • Destinations define where you want the events to be sent.
  • Notifications tie a filter to a destination.

Figure 1: Configure Events using CLI and ONTAP REST APIs

Here’s an example. If you want to set an email alert for any disk failure, you would perform these steps:

  • Step 1: Event configuration for email/SMTP destination
    • Configure details such as mail server, mail-from details.

  • Step 2: Creating a filter — name, message name, severity levels
    • Filter with

  • Step 3: Specifying where to send any filter events
    • Create a destination with details such as name, filter, type, mail-id.

After completing these steps, you get notifications at the destination according to the filters applied.

By using the modernized, consolidated ONTAP REST calls, you can manage events in an easier, simpler way than before. For example, you can make a single POST call to create a filter with all rules applied, rather than executing separate commands in the CLI.

The following mapping shows how each command is simplified to a direct REST call.

ONTAP® CLIONTAP® REST APIs

  • event config show

GET /support/ems

  • event notification destination create
  • event notification create

 

POST /support/ems/destinations

  • event log show

GET /support/ems/events

  • event filter create -filter-name <<filtername>>
  • event filter rule add -filter-name <<filtername>>

 

POST /support/ems/filters

Take a look at our sample script that covers three common event management use cases with REST APIs:

  • Viewing the event logs
  • Retrieving event management system messages with specific severity
  • Creating event configuration, a new filter, a new destination, and getting notified for your customized filter and destination. Please find below a code snippet for creation of destination using REST APIs.

Code Snippet

# Key Value arguments for destination creation

dataobj = {}

dataobj = {“destination”: destination, “filters”: [{“name”: filter_name}], “name”: destination_name, “type”: dest_type}

url =

“https://{}/api/support/ems/destinations/”.format(cluster)response = requests.post(url,headers=headers_inc,json=dataobj,verify=False)

 
« Return to News List