#!/bin/bash # # lvs-vsmonitor.sh # monitor service availbility framework # #-#-# Don't run this file directly #-#-# # # create a symlink to this file, named # according to the following convention: # # lvs-.sh # # then call the symlink from the send_program line in lvs.cf # send_program = /where/it/is/lvs-yourport[name].sh %h # server=${1} port=$(basename $0 .sh) port=${port/lvs-/} [ -z $server ] && echo echo "Read header of this file: \'$0\' for how to use it" && exit 1 NetCat=$(which nc) [ -z $NetCat ] && echo "ERROR: can't find netcat. Is it installed? Exiting." && exit 1 echo $(echo | $NetCat $server $port) | \ while read -a j do k=( $(echo "${j[0]}" | tr [[:punct:]] ' ') ) echo ${k[0]} done