Path : /proc/2/cwd/proc/2/cwd/proc/2/cwd/proc/2/root/var/lib/zabbix/ |
Current File : //proc/2/cwd/proc/2/cwd/proc/2/cwd/proc/2/root/var/lib/zabbix/discovery_esxivms.sh |
#!/bin/bash node=$1 snapdir=$2 timeout 10 ssh -oStrictHostKeyChecking=no -q $node exit 2>/dev/null if [ $? -ne 0 ] then echo "-1" exit 1 else vminhostlist=$(timeout 10 ssh $node find $snapdir -maxdepth 1 -type d 2>/dev/null | /usr/bin/awk 'BEGIN {first=1; printf "%s","{\"data\":["} {if (first != 1) printf "%s",","; first=0; printf "{\"{#FOLDER_NAME}\":\"%s\"}",$$1} END {print "]}"}') echo $vminhostlist fi