- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Reset switch port script.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2019 07:35 AM
Hi,
I'm looking if there is way to reset all the switch ports the ones showing in "Ports in Error Disable State"?
Thanks,
Re: Reset switch port script.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2019 07:56 AM
You can start here with this script
https://github.com/infobloxopen/netmri-toolkit/blob/master/CCS/Scripts/Port%20Security.ccs
This one 'Enable Port Security and add mac-address to the port config' but you can modify this to get what you are looking for.
Additional script
https://github.com/infobloxopen/netmri-toolkit
Reply with your completed script or if you got stuck!
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com
Re: Reset switch port script.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2019 10:50 AM
Thanks SBaksh! I will check it and let you now.
Re: Reset switch port script.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2021 10:22 AM
I'm getting this error
Unable to run this job:
Validation failed: Validate job *** ERROR: (Line 20) Duplicate attribute found 'Script' ***
My script:
###########################################################################
## Export of Script: Reset Ports on err-disabled Status
## Script-Level: 3
## Script-Category:
## Script-Language: CCS
###########################################################################
Script:
Port on err-disabled Status
Script-Description:
'Reset Ports on err-disabled Status'
Script-Filter:
$vendor eq "Cisco"
############################
Action:
Show Port on err-disabled Status
Action-Commands:
show int status | i err-disabled
############################
Action:
Show int status
Action-Commands:
SET: $UpdatePort = "no"
show int status | i err-disabled
Output-Triggers:
Process Port Status
##########################
Trigger:
Process Port Status
Trigger-Description:
Process the output of the show command to find the port with err-disabled
Trigger-Variables:
$port string
Trigger-Template:
[[$port]]\s*(err-disabled)
Trigger-Commands:$UpdatePort eq "no"}
DEBUG: config t
Trigger-Commands:
DEBUG: int $port
DEBUG: shut
DEBUG: no shut
SET: $UpdatePort = "yes"
###################
Action:
End
Re: Reset switch port script.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2021 10:49 AM
Remove the following lines from the script
########################################################################### ## Export of Script: Reset Ports on err-disabled Status ## Script-Level: 3 ## Script-Category: ## Script-Language: CCS ########################################################################### Script: Port on err-disabled Status Script-Description: 'Reset Ports on err-disabled Status'
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com
Re: Reset switch port script.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2021 10:57 AM
Re: Reset switch port script.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2021 10:59 AM
You are missing a open { bracket
Trigger-Commands:$UpdatePort eq "no"} should be Trigger-Commands:{$UpdatePort eq "no"}
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com
Re: Reset switch port script.
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2021 11:01 AM - edited 09-29-2021 11:07 AM
Also, you can join us on Dis cord
https://discord.gg/QebESC3T7X
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com