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 Last revision Both sides next revision | ||
os:linux:net:index.html [2018/01/10 01:27] kurihara [net.py] |
os:linux:net:index.html [2018/03/14 00:33] kurihara |
||
---|---|---|---|
Line 1: | Line 1: | ||
[[: | [[: | ||
- | ====== Network Configuration (net.py) ====== | + | ====== |
$FHHOME/ | $FHHOME/ | ||
Line 8: | Line 8: | ||
- | ===== Operation ===== | + | ===== Operation |
<sxh bash toolbar: | <sxh bash toolbar: | ||
- | $ fab -l |grep net | + | $ fab -l |grep -F net. |
</ | </ | ||
- | ==== Remote Shell Commands | + | \\ |
+ | ==== Fabric one-line Task Examples | ||
<sxh bash toolbar: | <sxh bash toolbar: | ||
Line 42: | Line 43: | ||
# tcpdump | # tcpdump | ||
- | $ fab -H $H auth.pro -- sudo tcpdump | + | $ fab -H $H auth.pro -- sudo tcpdump |
- | $ fab -H $H auth.pro -- sudo tcpdump -n not arp and not port 123 and not port 22 -W1 -G60 | + | $ fab -H $H auth.pro -- sudo tcpdump -n not arp and not port 123 and not port 22 -W1 -G30 # check 30 seconds |
# DNS | # DNS | ||
Line 62: | Line 63: | ||
from fabric.api import * | from fabric.api import * | ||
from fabric.contrib import files | from fabric.contrib import files | ||
+ | from datetime import datetime | ||
FHHOME=os.environ[" | FHHOME=os.environ[" | ||
Line 81: | Line 83: | ||
def set_bond(ip, | def set_bond(ip, | ||
backup_config() | backup_config() | ||
+ | date = datetime.now().strftime(' | ||
# put | # put | ||
put(" | put(" | ||
Line 87: | Line 90: | ||
# bond | # bond | ||
- | sed("/ | + | sed("/ |
- | sed("/ | + | sed("/ |
# nic1 | # nic1 | ||
- | sed("/ | + | sed("/ |
- | sed("/ | + | sed("/ |
# nic2 | # nic2 | ||
- | sed("/ | + | sed("/ |
- | sed("/ | + | sed("/ |
run(" | run(" |
My Sites
SNS
Copyright (c) 2024 FastHandle - IT Operations Examples All Rights Reserved.