#!/bin/bash service=`echo $1 | sed -n "s/.*Service:\(.*\)State.*/\1/p"` state=`echo $1 | sed -n "s/.*State:\(.*\)/\1/p"` company=`echo $1 | sed -n "s/.*Service:\(.*\)/\1/p" | cut -c 1-6` echo $company echo $state echo $service if [ "$state" = "down" ]; then echo $service $company | telalertc -g LoadBalancer -m "web server is not responding at $service" -check "$2 status" -host 172.16.3.104 -tags $company else echo $state $service $company | telalertc -g LoadBalancer -cancelnc "$2 status" -host 172.16.3.104 -tags $company fi