i cant get it to work....
this is from alerts.cfg
HOST=%^mt-* SERVICE=conn MAIL ezhellas at gmail.com REPEAT=30 RECOVERED SCRIPT /usr/local/bin/smsalert.sh 306944420303 FORMAT=SMSthis is smsalert.sh
this is smsalert.sh
#!/bin/bash echo "Parameters passed by Xymon to the smsalert.sh script: "$RCPT ":" $BBALPHAMSG >> /usr/local/bin/logsms.txt /usr/local/bin/sendsms.sh $RCPT $BBALPHAMSG
and this is sendsms.sh
#!/bin/bash RCPTTO=$1 RCPTTEXT=$2 echo "parameters passed to sendsms.sh are " $RCPTTO ":" $RCPTTEXT >> /usr/local/bin/logsms.txt curl -v -u <username>:<password> ' https://www.prosms.gr/secure/api/index.php?mobile_number='$RCPTTO'&originator=EZHellas&text='$RCPTTEXT'&request_delivery=true'
/usr/local/bin/logsms.txt
This is whats written to the log file:
Parameters passed by Xymon to the smsalert.sh script: 306944420303 : mt-PASCHALIDIS-SERRES:conn red [666942] &red 10.122.90.26 is unreachable parameters passed to sendsms.sh are 306944420303 : mt-PASCHALIDIS-SERRES:conn 1|75739990|248
and of course i receive a cropped sms message... anyone can help ?
On Fri, Sep 8, 2017 at 5:46 PM, Bruce Ferrell <bferrell at baywinds.org> wrote:
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=" . $key .
"&to=" . $to;
$URL .= "&text=" . urlencode( $message ) . '&from=' .
urlencode( $originator );
$fp = fopen( $URL, 'r' ); return fread( $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=" . $key .
"&to=" . $to;
$URL .= "&text=" . urlencode( $message ) . '&from=' .
urlencode( $originator );
$fp = fopen( $URL, 'r' ); return fread( $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
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
--
regards, Metron 6 (six)
Metron6 at gmail.com