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
ff8efd4d
Commit
ff8efd4d
authored
2 years ago
by
rick.mollard
Browse files
Options
Downloads
Patches
Plain Diff
update
parent
9b636f8b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
findfails.py
+33
-28
33 additions, 28 deletions
findfails.py
unkSwitches-cx.txt
+65
-1
65 additions, 1 deletion
unkSwitches-cx.txt
with
98 additions
and
29 deletions
findfails.py
+
33
−
28
View file @
ff8efd4d
from
netmiko
import
ConnectHandler
from
netmiko
import
(
ConnectHandler
,
NetmikoTimeoutException
)
from
getpass
import
getpass
import
requests
import
urllib3
...
...
@@ -45,8 +45,7 @@ creds = {"username": {Ausername}, "password": {Apassword}}
for
selectIP
in
file
:
ip_add
=
selectIP
print
(
ip_add
)
session
=
requests
.
session
()
try
:
net_connect
=
ConnectHandler
(
device_type
=
"
aruba_procurve
"
,
host
=
ip_add
,
...
...
@@ -54,6 +53,7 @@ for selectIP in file:
password
=
Apassword
,
)
###############################################################################
output
=
net_connect
.
send_command
(
f
"
show port-access clients
"
)
to1
=
output
.
split
(
"
\n
"
)
...
...
@@ -64,9 +64,9 @@ for selectIP in file:
#print(to)
if
policyrole
in
to
:
print
(
to
)
to3
=
to
.
split
(
"
"
)[
0
]
output2
=
net_connect
.
send_command
(
f
"
port-access reauthenticate interface
{
to3
}
"
)
print
(
f
"
{
to3
}
Reauthentication initiated.
"
)
port
=
to
.
split
(
"
"
)[
0
]
output2
=
net_connect
.
send_command
(
f
"
port-access reauthenticate interface
{
port
}
"
)
print
(
f
"
{
port
}
Reauthentication initiated.
"
)
#output1 = [f"interface {to3}","shut","no power"]
#net_connect.send_config_set(output1)
...
...
@@ -77,3 +77,8 @@ for selectIP in file:
to
=
to
.
split
(
"
"
)[
0
]
net_connect
.
disconnect
()
except
(
NetmikoTimeoutException
)
as
error
:
print
(
"
Switch is not responding----->
"
+
ip_add
)
print
(
"
Switch is not responding----->
"
+
ip_add
)
print
(
"
Switch is not responding----->
"
+
ip_add
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
unkSwitches-cx.txt
+
65
−
1
View file @
ff8efd4d
10.171.0.10
10.171.0.12
10.171.0.15
10.171.0.16
10.171.0.19
10.171.0.20
10.171.0.21
10.171.0.23
10.171.0.24
10.171.0.26
10.171.0.27
10.171.0.28
10.171.0.29
10.171.0.30
10.171.0.31
10.171.0.32
10.171.0.33
10.171.0.34
10.171.0.35
10.171.0.37
10.171.0.38
10.171.0.39
10.171.0.40
10.171.0.41
10.171.0.42
10.171.0.43
10.171.0.44
10.171.0.45
10.171.0.47
10.171.0.48
10.171.0.49
10.171.0.50
10.171.0.51
10.171.0.52
10.171.0.53
10.171.0.54
10.171.0.55
10.171.0.56
10.171.0.57
10.171.0.58
10.171.0.59
10.171.0.60
10.171.0.61
10.171.0.62
10.171.0.63
10.171.0.64
10.171.0.65
10.171.0.66
10.171.0.67
10.171.0.68
10.171.0.69
10.171.0.70
10.171.0.71
10.171.0.72
10.171.0.73
10.171.0.74
10.171.0.11
10.171.0.13
10.171.0.14
10.171.0.17
10.171.0.18
10.171.0.25
10.171.0.36
10.171.0.46
10.171.0.75
\ No newline at end of file
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