FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


os:linux:net:index.html



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
os:linux:net:index.html [2018/02/21 23:48]
kurihara [Fabric Remote Shell Commands]
os:linux:net:index.html [2019/02/11 00:40] (current)
kurihara
Line 16: Line 16:
  
 \\ \\
-==== Fabric Temporary Run Call Examples ====+==== Fabric one-line Task Examples ====
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
Line 22: Line 22:
  
 # Interface's IP # Interface's IP
-$ fab -H $H auth.pro -- "ip a |grep inet"+$ fab -H $H  -- "ip a |grep inet"
  
 # Bonding # Bonding
-$ fab -H $H auth.pro -- egrep  "*"  /proc/net/bonding/bond* +$ fab -H $H  -- egrep  "*"  /proc/net/bonding/bond* 
-$ fab -H $H auth.pro -- egrep -i "mode|currently|status|count"  /proc/net/bonding/bond*+$ fab -H $H  -- egrep -i "mode|currently|status|count"  /proc/net/bonding/bond*
  
 # Bonding Driver # Bonding Driver
-$ fab -H $H auth.pro -- "lsmod |grep bonding"+$ fab -H $H  -- "lsmod |grep bonding"
  
 # NIC Driver # NIC Driver
-$ fab -H $H auth.pro -- for i in `ip a |grep mtu |awk -F: {'print $2'} |egrep -v "lo"` ; do echo "----------" ; echo $i ;echo "----------"; ethtool -i $i ; done+$ fab -H $H  -- for i in `ip a |grep mtu |awk -F: {'print $2'} |egrep -v "lo"` ; do echo "----------" ; echo $i ;echo "----------"; ethtool -i $i ; done
  
  
 # Routing # Routing
-$ fab -H $H auth.pro -- netstat -rn +$ fab -H $H  -- netstat -rn 
-$ fab -H $H auth.pro -- cat /etc/sysconfig/static-route+$ fab -H $H  -- cat /etc/sysconfig/static-route
  
 # nmap # nmap
-$ fab -H $H auth.pro -- sudo nmap -Pn -sT -p 22 xx.xx.xx.xx+$ fab -H $H  -- sudo nmap -Pn -sT -p 22 xx.xx.xx.xx
  
 # tcpdump # tcpdump
-$ fab -H $H auth.pro -- sudo tcpdump  udp port 53 -i any  -W1 -G30  # check 30 seconds +$ fab -H $H  -- sudo tcpdump  udp port 53 -i any  -W1 -G30  # check 30 seconds 
-$ fab -H $H auth.pro -- sudo tcpdump -n not arp and not port 123 and not port 22  -W1 -G30  # check 30 seconds+$ fab -H $H  -- sudo tcpdump -n not arp and not port 123 and not port 22  -W1 -G30  # check 30 seconds
  
 # DNS # DNS
-$ fab -H $H auth.pro -- cat /etc/resolv.conf +$ fab -H $H  -- cat /etc/resolv.conf 
-$ fab -H $H auth.pro -- host google.com +$ fab -H $H  -- host google.com 
-$ fab -H $H auth.pro -- host test-server-01 +$ fab -H $H  -- host test-server-01 
-$ fab -H $H auth.pro -- host x.x.x.x+$ fab -H $H  -- host x.x.x.x
 </sxh> </sxh>
  
Line 63: 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"] FHHOME=os.environ["FHHOME"]


os/linux/net/index.html.1519224489.txt.gz · Last modified: 2018/02/21 23:48 by kurihara