Xymon Mailing List Archive search

receiving sms alerts...

list Bruce Ferrell
Fri, 8 Sep 2017 07:46:33 -0700
Message-Id: <user-210b95337219@xymon.invalid>

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)

user-17e4b93d552a@xymon.invalid <mailto:user-17e4b93d552a@xymon.invalid>