Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rm-pythonScripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
network-tools
rm-pythonScripts
Commits
c3a8f4f6
Commit
c3a8f4f6
authored
2 years ago
by
rick.mollard
Browse files
Options
Downloads
Patches
Plain Diff
LLDP update
parent
2861cbe9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
highTransitions.py
+5
-1
5 additions, 1 deletion
highTransitions.py
with
5 additions
and
1 deletion
highTransitions.py
+
5
−
1
View file @
c3a8f4f6
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment