FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


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



Differences

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

Link to this comparison view

Next revision
Previous revision
os:linux:pkg:scripts:check_cmd.sh.html [2017/12/17 23:24]
kurihara created
os:linux:pkg:scripts:check_cmd.sh.html [2018/05/08 02:01] (current)
kurihara
Line 1: Line 1:
 +[[os:linux:pkg:index.html]]
 ====== check_cmd.sh ====== ====== check_cmd.sh ======
 +$FHHOME/target/scripts/check_cmd.sh
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
 #!/bin/sh #!/bin/sh
 +#=======================================================
 # check_cmd.sh # check_cmd.sh
-# +#=======================================================
- +
-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" +
-}+
  
  
 +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"
 +which expect      >/dev/null 2>&1 || echo "expect NG"
  
-#---------------------------------------------------- +#----------------------------------------------------- 
-case ${1} in +#Netowrk 
-    common) check_common +#----------------------------------------------------- 
-        ;; +which ifconfig    >/dev/null 2>&1 || echo "ifconfig NG" 
-    server) check_server +which netstat     >/dev/null 2>&1 || echo "netstat  NG" 
-        ;; +which dig         >/dev/null 2>&1 || echo "dig      NG" 
-    pc) check_pc +which host        >/dev/null 2>&1 || echo "host     NG" 
-        ;; +which nmap        >/dev/null 2>&1 || echo "nmap     NG" 
-    *) echo "$option is valid+which nc          >/dev/null 2>&1 || echo "nc       NG" 
-    ;; +which traceroute  >/dev/null 2>&|| echo "traceroute  NG
-esac+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" 
 +which ftp         >/dev/null 2>&1 || echo "ftp      NG"
  
 +#-----------------------------------------------------
 +#Peformance
 +#-----------------------------------------------------
 +which dstat       >/dev/null 2>&1 || echo "dstat    NG"
 +which iperf       >/dev/null 2>&1 || echo "iperf    NG"
  
 +#-----------------------------------------------------
 +#etc
 +#-----------------------------------------------------
 +which ccze        >/dev/null 2>&1 || echo "ccze    NG   # ccze is log colorizer"
 </sxh> </sxh>
  
Line 62: Line 47:
 \\ \\
 <WRAP box 90%> <WRAP box 90%>
-[[os:package:index.html]] +[[os:linux:pkg:index.html]] 
-<catlist -noAddPageButton -noHead>+<catlist ..:..: -noAddPageButton -noHead>
 </WRAP> </WRAP>
  


os/linux/pkg/scripts/check_cmd.sh.html.1513520692.txt.gz · Last modified: 2017/12/17 23:24 by kurihara