FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


Sidebar


Top     SiteMap

Manager Server

Target Server

$FHHOME/bin/xxx.sh | xxxx.exp













.

os:linux:pkg:scripts:check_cmd.sh.html



This is an old revision of the document!


pkg

check_cmd.sh

$FHHOME/scripts/check_cmd.sh

#!/bin/sh
#=======================================================
# check_cmd.sh
# How to use
#     check_cmd.sh  common
#=======================================================

if [ -z $1 ]; then
    echo "Error:  argument is null"
    exit 1
fi



check_common() {
    which rsync       >/dev/null 2>&1 || echo "rsync NG"
    which vim         >/dev/null 2>&1 || echo "vim   NG"
    which tree        >/dev/null 2>&1 || echo "tree  NG"
    which wget        >/dev/null 2>&1 || echo "wget  NG"

    #-----------------------------------------------------
    #Netowrk
    #-----------------------------------------------------
    which ifconfig    >/dev/null 2>&1 || echo "ifconfig NG"
    which netstat     >/dev/null 2>&1 || echo "netstat  NG"
    which dig         >/dev/null 2>&1 || echo "dig      NG"
    which host        >/dev/null 2>&1 || echo "host     NG"
    which nmap        >/dev/null 2>&1 || echo "nmap     NG"
    which nc          >/dev/null 2>&1 || echo "nc       NG"
    which traceroute  >/dev/null 2>&1 || echo "traceroute  NG"
    which tcpdump     >/dev/null 2>&1 || echo "tcpdump  NG"
    which snmpget     >/dev/null 2>&1 || echo "snmpget  NG"
    which snmpwalk    >/dev/null 2>&1 || echo "snmpwalk  NG"

    #-----------------------------------------------------
    #Peformance
    #-----------------------------------------------------
    which dstat       >/dev/null 2>&1 || echo "dstat    NG"
    which iperf       >/dev/null 2>&1 || echo "iperf    NG"
}



#----------------------------------------------------
case ${1} in
    common) check_common
        ;;
    server) check_server
        ;;
    pc) check_pc
        ;;
    *) echo "$1 option is valid"
    ;;
esac





os/linux/pkg/scripts/check_cmd.sh.html.1514824880.txt.gz ยท Last modified: 2018/01/02 01:41 by kurihara