<div dir="ltr"><div>i cant get it to work....</div><div><br></div><div>this is from alerts.cfg</div><div><br></div>







 HOST=%^mt-* SERVICE=conn<br>      MAIL <a href="mailto:ezhellas@gmail.com">ezhellas@gmail.com</a> REPEAT=30 RECOVERED<br>      SCRIPT /usr/local/bin/smsalert.sh 306944420303 FORMAT=SMSthis is smsalert.sh<div><br></div><div>this is smsalert.sh<br></div><div><br></div><div>#!/bin/bash<br>echo "Parameters passed by Xymon to the smsalert.sh script: "$RCPT ":" $BBALPHAMSG >> /usr/local/bin/logsms.txt<br>/usr/local/bin/sendsms.sh $RCPT $BBALPHAMSG<br><br></div><div>and this is sendsms.sh</div><div><br></div>#!/bin/bash<br>RCPTTO=$1<br>RCPTTEXT=$2<br>echo "parameters passed to sendsms.sh are " $RCPTTO ":" $RCPTTEXT >> /usr/local/bin/logsms.txt<br>curl -v -u <username>:<password> '<a href="https://www.prosms.gr/secure/api/index.php?mobile_number='$RCPTTO'&originator=EZHellas&text='$RCPTTEXT'&request_delivery=true">https://www.prosms.gr/secure/api/index.php?mobile_number='$RCPTTO'&originator=EZHellas&text='$RCPTTEXT'&request_delivery=true</a>' >> /usr/local/bin/logsms.txt<div><br></div><div>This is whats written to the log file:</div><div><br></div>Parameters passed by Xymon to the smsalert.sh script: 306944420303 : mt-PASCHALIDIS-SERRES:conn red [666942] &red 10.122.90.26 is unreachable<br>parameters passed to sendsms.sh are  306944420303 : mt-PASCHALIDIS-SERRES:conn<br>1|75739990|248<div><br></div><div>and of course i receive a cropped sms message...</div><div>anyone can help ?</div><div><br></div><div><br></div><div>On Fri, Sep 8, 2017 at 5:46 PM, Bruce Ferrell <<a href="mailto:bferrell@baywinds.org" target="_blank">bferrell@baywinds.org</a>> wrote:<br>><br>> either of these would do the job:<br>><br>> php <file that contains the code below><br>><br>> 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):<br>><br>><br>> #!/usr/bin/php<br>> <?php<br>><br>>         // Simple SMS send function<br>><br>>         function sendSMS($key, $to, $message, $originator) {<br>><br>>                 $URL = "<a href="https://smscenter.gr/api/sms/send?key=" target="_blank">https://smscenter.gr/api/sms/<wbr>send?key=</a>" . $key . "&to=" . $to;<br>><br>>                 $URL .= "&text=" . urlencode( $message ) . '&from=' . urlencode( $originator );<br>><br>>                 $fp = fopen( $URL, 'r' );<br>><br>>                 return fread( $fp, 1024 );<br>><br>>         }<br>><br>>         // Example of use <br>><br>>         $response = sendSMS( 'myapikey', 'recipientnumber', 'My test message', 'from' );<br>><br>>         echo $response;<br>><br>> ?><br>><br>><br>><br>> On 9/8/17 7:17 AM, Metron 6 (six) wrote:<br>><br>> hello all, <br>><br>> i got a subscription to an SMS gateway, and the script they gave me is this:<br>><br>> ------------<br>><br>> <?php<br>><br>>         // Simple SMS send function<br>><br>>         function sendSMS($key, $to, $message, $originator) {<br>><br>>                 $URL = "<a href="https://smscenter.gr/api/sms/send?key=" target="_blank">https://smscenter.gr/api/sms/<wbr>send?key=</a>" . $key . "&to=" . $to;<br>><br>>                 $URL .= "&text=" . urlencode( $message ) . '&from=' . urlencode( $originator );<br>><br>>                 $fp = fopen( $URL, 'r' );<br>><br>>                 return fread( $fp, 1024 );<br>><br>>         }<br>><br>>         // Example of use <br>><br>>         $response = sendSMS( 'myapikey', 'recipientnumber', 'My test message', 'from' );<br>><br>>         echo $response;<br>><br>> ?><br>><br>> -------<br>><br>> how could i implement it inside alerts.cfg in order to get sms alerts ?<br>><br>><br>><br>> --<br>><br>> regards,<br>> Metron 6 (six)<br>><br>> <a href="mailto:Metron6@gmail.com" target="_blank">Metron6@gmail.com</a><br>><br>><br>><br>> ______________________________<wbr>_________________<br>> Xymon mailing list<br>> <a href="mailto:Xymon@xymon.com" target="_blank">Xymon@xymon.com</a><br>> <a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/<wbr>mailman/listinfo/xymon</a><br>><br>><br>><br>> ______________________________<wbr>_________________<br>> Xymon mailing list<br>> <a href="mailto:Xymon@xymon.com" target="_blank">Xymon@xymon.com</a><br>> <a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/<wbr>mailman/listinfo/xymon</a><br>><br><br><br><br>--<br><br>regards,<br>Metron 6 (six)<br><br><a href="mailto:Metron6@gmail.com" target="_blank">Metron6@gmail.com</a></div></div>