cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl with exec from a shell script

From: Harry Sufehmi <milis-ktr_at_harrysufehmi.com>
Date: Mon, 10 Feb 2003 11:53:10 -0000 (GMT Standard Time)

Ralph Mitchell said:
> Assuming you've got Tcl installed, and I'd be surprised if you haven't, this
> will do the trick:
> Save the above to something like: /usr/local/bin/urlencode
>
> In your script, do something like this for any POST variable with
> non-alphanumeric values:
> msgarg=`/usr/local/bin/urlencode MESSAGE
> "$BBHOSTSVC-$BBCOLORLEVEL-$BBALPHAMSG&ORIGIN=bbserver"`
>
> /usr/local/bin/curl -x 10.90.193.209:8080 -d $msgarg -d .... -d .....
> http://smsgate.....

Brilliant idea Ralph!
Actually I haven't got Tcl installed (the server's installation is pretty much
minimalist) and I'm not familiar at all with Tcl, so I think I'll use php
instead.

But your idea really hit the spot.
I'll get this done and let you know of the result.

> Also, I'm curious, why are you exec'ing curl? Does the script not do anything
> else? Such as capture the return code from curl and report to someone (Big
> Brother?) if it fails to send the pager message...

Actually it'll email us, but something happened just recently.

Basically, I work in a team that (among other things) maintains our company's
Testlab. As the name implies, we hosts servers that's being used for testing.
So servers availability wasn't that much of priority - BB notifying us of any
problem via email is already more than enough.

However, suddenly we started to host production servers as well...

So naturally we need a better level of monitoring. Email just doesn't cut it
anymore, since we don't check our email, like, every 5 minutes. We need
something that will notify us much quicker than that.
Hence this attempt on SMS notification.

If this works, I'll give a feedback on BB team as well. At the moment, their SMS
notification involves messing around with kermit protocol (wow) and such - it's
just way over my head.

OK, gotta give this a try now.

cheers,
-HS

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Received on 2003-02-10