Commit 6180d920 authored by root's avatar root
Browse files

Birdseye API did not respond appropriately sometimes -> sleep and retry approach was included

parent 57c1c369
......@@ -75,6 +75,10 @@ class Route_Server_stat:
else:
requested_large_community_url = "http://"+str(self.rs)+"/api/routes/count/lc-zwild/protocol/"+str(peer)+expand_community_tuple_to_rest(large_community)
requested_large_community_response = requests.get(url=requested_large_community_url)
# if we do not get a proper response from Birdseye, we sleep and retry
while (requested_large_community_response.status_code != 200):
sleep(3)
requested_large_community_response = requests.get(url=requested_large_community_url)
requested_large_community_response = requested_large_community_response.json()["count"]["routes"]
routes_counter = routes_counter + int(requested_large_community_response)
#print(eval(str(large_community)),routes_counter)
......@@ -121,7 +125,7 @@ except (Exception, e):
current_time = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')
print(current_time)
# IPv4 + IPv6 Route Server stats, we handle each RS instance (IPv4, IPv6) as a different RS
Route_Servers = ["rsx-vlan505-ipv4.gr-ix.gr","rs1-vlan505-ipv4.gr-ix.gr","rs0-vlan505-ipv4.gr-ix.gr","rs0-vlan400-ipv4.thess.gr-ix.gr","rs1-vlan400-ipv4.thess.gr-ix.gr"]+["rs1-vlan505-ipv6.gr-ix.gr","rs0-vlan505-ipv6.gr-ix.gr","rs0-vlan400-ipv6.thess.gr-ix.gr","rs1-vlan400-ipv6.thess.gr-ix.gr"]
Route_Servers = ["rs1-vlan505-ipv4.gr-ix.gr","rs0-vlan505-ipv4.gr-ix.gr","rs0-vlan400-ipv4.thess.gr-ix.gr","rs1-vlan400-ipv4.thess.gr-ix.gr"]+["rs1-vlan505-ipv6.gr-ix.gr","rs0-vlan505-ipv6.gr-ix.gr","rs0-vlan400-ipv6.thess.gr-ix.gr","rs1-vlan400-ipv6.thess.gr-ix.gr"]
for rs in Route_Servers:
rs_class = Route_Server_stat(rs)
input_to_influx = [{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment