FastHandle is fast operation tools for infrastructure configurations and tests.
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
hardware:cisco:index.html [2018/02/05 01:25] kurihara [Ref. Remote Shell Commands] |
hardware:cisco:index.html [2018/02/22 23:30] (current) kurihara |
||
---|---|---|---|
Line 1: | Line 1: | ||
[[: | [[: | ||
- | ====== Cisco (cisco.py)===== | + | ====== Cisco Configuration with Fabric |
$FHHOME/ | $FHHOME/ | ||
Line 6: | Line 6: | ||
{{INLINETOC}} | {{INLINETOC}} | ||
\\ | \\ | ||
- | + | I use Fabric for simple tasks and repetitive tasks. | |
- | ===== Operation ===== | + | \\ |
+ | ===== Fabric | ||
<sxh bash toolbar: | <sxh bash toolbar: | ||
Line 14: | Line 15: | ||
</ | </ | ||
- | ==== Ref. Remote Shell Commands | + | \\ |
+ | ==== How to Check to Use Fabric in Cisco ==== | ||
<sxh bash toolbar: | <sxh bash toolbar: | ||
- | $ echo xx.xx.xx.xx | + | $ ssh user01@xx.xx.xx.xx |
</ | </ | ||
+ | |||
+ | |||
+ | /* | ||
+ | ==== Fabric Remote Shell Commands ==== | ||
+ | <sxh bash toolbar: | ||
+ | $ fab -H $HOST auth.ciscopro --set shell=False --no-pty -- show interfaces status | ||
+ | </ | ||
+ | */ | ||
+ | |||
\\ | \\ | ||
Line 29: | Line 40: | ||
from fabric.contrib import files | from fabric.contrib import files | ||
+ | env.eagerly_disconnect = False | ||
FHHOME=os.environ[" | FHHOME=os.environ[" | ||
+ | |||
# | # | ||
Line 45: | Line 58: | ||
# | # | ||
- | #cisco.termleng0 | + | #cisco.term_leng0 |
# | # | ||
@task | @task | ||
Line 55: | Line 68: | ||
# | # | ||
- | #cisco.showrun | + | #cisco.sh_run |
# | # | ||
@task | @task | ||
- | def showrun(): | + | def sh_run(): |
""" | """ | ||
- | | + | |
- | | + | |
- | return running_config | + | |
+ | # | ||
+ | # | ||
+ | # | ||
+ | @task | ||
+ | def sh_int_status(): | ||
+ | """ | ||
+ | | ||
</ | </ |
My Sites
SNS
Copyright (c) 2025 FastHandle - IT Operations Examples All Rights Reserved.