From c3a8f4f648666047b749281407310bdc6591d06f Mon Sep 17 00:00:00 2001
From: "rick.mollard" <rick.mollard@nebraska.edu>
Date: Tue, 12 Jul 2022 16:03:48 -0500
Subject: [PATCH] LLDP update

---
 highTransitions.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/highTransitions.py b/highTransitions.py
index 9003aec..aa984cc 100644
--- a/highTransitions.py
+++ b/highTransitions.py
@@ -72,10 +72,14 @@ for selectIP in file:
                             get_lldp = session.get(f"https://{self}/rest/v10.04/system/interfaces/{Switch}%2F1%2F{SwitchPort}/lldp_neighbors?attributes=neighbor_info&depth=4&selector=status&filter=")
                             lldpModel = f"{get_lldp.json()}"
                             split_lldpModel = lldpModel.split(", ")
+                            
                             count=3
                             while count < len(split_lldpModel):  # This handles errors when no lldp info is found.
-                                final_lldp = split_lldpModel[3]
+                                #final_lldp = split_lldpModel[3]
+                                lsplit_lldp = lldpModel.split("'chassis_description': '",1)[1]
+                                final_lldp = lsplit_lldp.split("', ",1)[0]
                                 count += 1
+                            #print(final_lldp)
                             print(f"Port: {Switch}/1/{SwitchPort} {str_LinkTransitions} --- {final_lldp}")
 
                         final_lldp = "No LLDP Info"  # Default value if no lldp info is retreived
-- 
GitLab