cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1106
Views
1
Helpful
1
Replies

Automatic API Event Trigger in PI

Benjamin Sealy
Cisco Employee
Cisco Employee

Hey Experts,

I am trying to wrap my head around how to automatically update a resource with information from Cisco PI using the API. What I want to do is trigger an alarm or an event and send that information instantly to a python server app. I will be able to use that information to trigger other behaviors from the app.

For instance, if an interface goes down, SYSLOG would alert PI to a CRITICAL alarm. PI would then initiate a resource update to my app.

Is there a way for PI to do this natively, or should I be considering creating an updater in my app to constantly monitor the state of a certain device and/or Live SYSLOG server?

Thanks!

-Ben

1 Reply 1

Spencer Zier
Cisco Employee
Cisco Employee

The API doesn't support for your use case, unfortunately.  Prime Infrastructure does include the Notifications API, but I don't believe it supports listening for new alarms, just device lifecycle events.  We did consider adding WebSocket support to our framework, which would allow us to update an API client in near real-time about updates to a particular API resource, but we haven't implemented against it yet.

However, the trap receiver functionality in Prime Infrastructure should cover what you need.  You'll have to setup a trap receiver (there are various Python package, like PySNMP and trapperkeeper, for this purpose) and then configure Prime Infrastructure to send the relevant traps to it (you can configure the alarm levels and categories filters to match your interests).

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: