[Xymon] receiving sms alerts...
Bruce Ferrell
bferrell at baywinds.org
Fri Sep 8 16:46:33 CEST 2017
either of these would do the job:
php <file that contains the code below>
or a script that looks like this (adjust the first line to your php
location. and define the variables to match the info they gave you):
#!/usr/bin/php
*<?php*
*// Simple SMS send function*
*function*sendSMS($key, $to, $message, $originator) {
$URL = *"https:**//smscenter.gr/api/sms/send?key=
<http://smscenter.gr/api/sms/send?key=>" . $key . "&to=" . $to;*
$URL .= *"&text="*. urlencode($message ) . '&from=' .
urlencode($originator );
$fp = fopen($URL, 'r' );
returnfread($fp, 1024 );
}
*// Example of use*
$response = sendSMS( 'myapikey', 'recipientnumber', 'My test message',
'from' );
echo $response;
*?>*
On 9/8/17 7:17 AM, Metron 6 (six) wrote:
> hello all,
>
> i got a subscription to an SMS gateway, and the script they gave me is
> this:
>
> ------------
>
> *<?php*
>
> *// Simple SMS send function*
>
> *function*sendSMS($key, $to, $message, $originator) {
>
> $URL = *"https:**//smscenter.gr/api/sms/send?key=
> <http://smscenter.gr/api/sms/send?key=>" . $key . "&to=" . $to;*
>
> $URL .= *"&text="*. urlencode($message ) . '&from=' .
> urlencode($originator );
>
> $fp = fopen($URL, 'r' );
>
> returnfread($fp, 1024 );
>
> }
>
> *// Example of use*
>
> $response = sendSMS( 'myapikey', 'recipientnumber', 'My test message',
> 'from' );
>
> echo $response;
>
> *?>*
>
> *-------*
>
> *how could i implement it inside alerts.cfg in order to get sms alerts ?*
>
> *
> *
>
>
> --
>
> regards,
> Metron 6 (six)
>
> Metron6 at gmail.com <mailto:Metron6 at gmail.com>
>
>
>
> _______________________________________________
> Xymon mailing list
> Xymon at xymon.com
> http://lists.xymon.com/mailman/listinfo/xymon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20170908/fc8b04a9/attachment.html>
More information about the Xymon
mailing list