mlsrar has asked for the wisdom of the Perl Monks concerning the following question:
#!/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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Converting bash script to perl
by gellyfish (Monsignor) on Jun 28, 2006 at 16:12 UTC | |
|
Re: Converting bash script to perl
by marto (Cardinal) on Jun 28, 2006 at 16:12 UTC | |
|
Re: Converting bash script to perl
by ptum (Priest) on Jun 28, 2006 at 16:06 UTC | |
|
Re: Converting bash script to perl
by Moron (Curate) on Jun 28, 2006 at 16:22 UTC | |
|
Re: Converting bash script to perl
by shmem (Chancellor) on Jun 28, 2006 at 16:08 UTC | |
|
Re: Converting bash script to perl
by mikasue (Friar) on Jun 28, 2006 at 16:51 UTC | |
|
Re: Converting bash script to perl
by jesuashok (Curate) on Jun 28, 2006 at 16:20 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |