start:switchdiscover_h
os:Linux
decription:help
cmd:switchdiscover -h
check:rc==0
check:output=~Usage
end
start:switchdiscover_range_default
cmd:switchdiscover --range $$range
check:rc==0
check:output=~Discovering switches using nmap
check:output=~switch
end
start:switchdiscover_range_default_w
cmd:lsdef -l switch -z >/tmp/switch.standa
cmd:rmdef switch
cmd:switchdiscover --range $$range -w
check:rc==0
check:output=~Discovering switches using nmap
check:output=~switch
check:output=~Writing the data into xCAT DB
cmd: lsdef |grep switch
check:rc==0
check:output=~switch
cmd:rmdef switch
check:rc==0
cmd:cat /tmp/switch.standa |mkdef -z
cmd:rm -rf /tmp/switch.standa
check:rc==0
end
start:switchdiscover_range_s
cmd:switchdiscover --range $$range -s nmap
check:rc==0
check:output=~Discovering switches using nmap
check:output=~switch
end
start:switchdiscover_range_r
cmd:switchdiscover --range $$range -r
check:rc==0
check:output=~Discovering switches using nmap
check:output=~xml
cmd:rm -rf switchdiscover_range_r.log
cmd:switchdiscover --range $$range -r > switchdiscover_range_r.log
check:rc==0
cmd:if [ "__GETNODEATTR($$CN,os)__" != "sles11.4" ]; then cat switchdiscover_range_r.log | grep "/usr/bin/nmap -sn -oX - $$range"; else cat switchdiscover_range_r.log | grep "/usr/bin/nmap -sP -oX - $$range";fi
check:output=~/usr/bin/nmap -s(n|P) -oX - $$range
cmd:rm -rf switchdiscover_range_r.log
end
start:switchdiscover_range_x
cmd:switchdiscover --range $$range -x
check:rc==0
check:output=~Discovering switches using nmap
check:output=~<Switch>
check:output=~<groups>switch</groups>
end
start:switchdiscover_range_z
cmd:switchdiscover --range $$range -z
check:rc==0
check:output=~Discovering switches using nmap
check:output=~nodetype=switch
check:output=~groups=switch
end

start:switchdiscover_range_z_V
cmd:switchdiscover --range $$range -z -V
check:rc==0
check:output=~Discovering switches using nmap
check:output=~xml
check:output=~nodetype=switch
check:output=~groups=switch
cmd:rm -rf switchdiscover_range_z_V.log
cmd:switchdiscover --range $$range -z -V > switchdiscover_range_z_V.log
check:rc==0
cmd:if [ "__GETNODEATTR($$CN,os)__" != "sles11.4" ]; then cat switchdiscover_range_z_V.log | grep "Process command: /usr/bin/nmap -sn -oX - $$range"; else cat switchdiscover_range_z_V.log | grep "Process command: /usr/bin/nmap -sP -oX - $$range";fi
check:output=~Process command: /usr/bin/nmap -s(n|P) -oX - $$range
cmd:rm -rf switchdiscover_range_z_V.log
end




