I have an issue with API of Cisco Prime Infrastructure.
I will try to explain at my best the problem I have :
First of all , I need to monitor all devices that are connected to the Prime infrastructure in proactive.
For that I have a script, this will run every 5 minutes to get information.
The first Section connect to the API and get all devices with status Unreachable.
The Second section connect to the API and get all new events that contain "is down" into description
The Third section connect to the API and get all new events that contain "is up" into description.
This means I have 3 connections every 5 minutes to the API.
if in the events section they have more than 100 new events, then to know how many connection will be made we need to take the number of new events divided by 100.
Ex.: 450 new events will make 5 connections.
When I start the script everything goes well. But after 30 minutes when I try to connect to the API, I receive this error :
The remote server returned an error: (401) Unauthorized
Is anyone can help me with this issue?
Thanks you for help in advance
you need to add a connection close to your http request. This not well explained in the Cisco docs.
And you only run into this issue when you issue a lot of requests one after the other, because you are creating new sessions each time.
add this to your http request header
Thanks you for your help.
I just change my request by HttpWebRequest in Asp.net
And I add KeepAlive = false
And now everything work fine.