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 | ||
|
os:package:cmd.html [2017/12/11 00:14] kurihara |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | [[os: | ||
| - | ~~NOTOC~~ | ||
| - | ====== Check Commands====== | ||
| - | |||
| - | |||
| - | ===== Operation ===== | ||
| - | |||
| - | <sxh bash toolbar: | ||
| - | $ echo a |fab -l |grep cmd. | ||
| - | $ echo a |fab auth.pro -- hostname | ||
| - | |||
| - | $ echo xx.xx.xx.xx | fab auth.pro | ||
| - | $ echo xx.xx.xx.xx | fab auth.pro | ||
| - | </ | ||
| - | |||
| - | \\ | ||
| - | ===== cmd.py ===== | ||
| - | |||
| - | <sxh python toolbar: | ||
| - | import sys | ||
| - | from fabric.api import * | ||
| - | |||
| - | FHHOME=os.environ[" | ||
| - | |||
| - | # | ||
| - | # Common | ||
| - | # | ||
| - | @task | ||
| - | def common(): | ||
| - | put(" | ||
| - | sudo(" | ||
| - | |||
| - | |||
| - | # | ||
| - | # Server | ||
| - | # | ||
| - | |||
| - | |||
| - | # | ||
| - | # PC | ||
| - | # | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | \\ | ||
| - | ===== check_cmd.sh ===== | ||
| - | <sxh bash toolbar: | ||
| - | #!/bin/sh | ||
| - | # check_cmd.sh | ||
| - | # | ||
| - | |||
| - | if [ -z $1 ]; then | ||
| - | echo " | ||
| - | exit 1 | ||
| - | fi | ||
| - | |||
| - | |||
| - | |||
| - | check_common() { | ||
| - | which rsync >/ | ||
| - | which vim >/ | ||
| - | which tree >/ | ||
| - | which wget >/ | ||
| - | |||
| - | # | ||
| - | #Netowrk | ||
| - | # | ||
| - | which ifconfig | ||
| - | which netstat | ||
| - | which dig >/ | ||
| - | which host >/ | ||
| - | which nmap >/ | ||
| - | which nc >/ | ||
| - | which traceroute | ||
| - | which tcpdump | ||
| - | which snmpget | ||
| - | which snmpwalk | ||
| - | |||
| - | # | ||
| - | #Peformance | ||
| - | # | ||
| - | which dstat >/ | ||
| - | which iperf >/ | ||
| - | } | ||
| - | |||
| - | |||
| - | |||
| - | # | ||
| - | case ${1} in | ||
| - | common) check_common | ||
| - | ;; | ||
| - | server) check_server | ||
| - | ;; | ||
| - | pc) check_pc | ||
| - | ;; | ||
| - | *) echo "$1 option is valid" | ||
| - | ;; | ||
| - | esac | ||
| - | |||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | \\ | ||
| - | <WRAP box 90%> | ||
| - | [[os: | ||
| - | <catlist -noAddPageButton -noHead> | ||
| - | </ | ||
My Sites
SNS
Copyright (c) 2025 FastHandle - IT Operations Examples All Rights Reserved.