#!/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 n +ot responding at $service" -check "$2 status" -host 172.16.3.104 -tag +s $company else echo $state $service $company | telalertc -g LoadBalancer -can +celnc "$2 status" -host 172.16.3.104 -tags $company fi
Edit: davorg - added code tags
In reply to Converting bash script to perl by mlsrar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |