Skip to content

Event API

In this lab we will be creating custom log events on one of our virtual switches, then using the Event API link on our lab landing screen to view them. This demonstrates how simple it is to create a new Event rule in CVP to forward alerts to a webhook or other receiver.

Lab Tasks

  1. Start by logging into CVP (if you aren’t already) and clicking on Events on the left navigation bar.

  2. Now click on Notifications on the upper right, to customize Event Notification settings.

    Notifications

  3. Click on Receivers on the left.

  4. Now click on + Add Receiver and name it My Receiver.

  5. Click on + Add Configuration, then choose Webhook (HTTP).

    Receiver

  6. In the Target URL field, paste the following:

    http://192.168.0.1:5000/alert
    
  7. Leave the other options unchecked and click Save on the upper right side of the screen.

    Target

  8. Now that we have a receiver to send our events to, we have to configure a rule to tell CVP what to send to this receiver.

    1. To do this, click on Rules on the left side of the screen, and then click + Add Rule.

      Rules

    2. Leave the Add Conditions section at the default values.

    3. In the Receiver section, click the drop down and select My Receiver, then click Save in the upper right corner.

      Rule Receiver

Testing

That’s it! Now we can create a test alert to make sure it works.

  1. Click on Status on the left.

  2. In the Test Notification Sender section, select any severity, and event type, any device, any interface, and then click Send Test Notification.

    Test Notification

  3. Now go back to your lab landing page and click on Event Alert API link.

    Event Alert API

  4. You may need to refresh the page a few times but you should see your test alert come through after a minute or two.

    Event Alert

Success

Lab Complete!