<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-mailStijl17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=NL link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Im using this:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>In alerts<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>script /home/xymon/server/sms/smsalert.pl 31xxxxxx FORMAT=sms<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>/home/xymon/server/sms/smsalert.pl:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>=================================<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>#!/bin/sh<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>/home/xymon/server/sms/sendsms.php $RCPT "$BBALPHAMSG"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div style='mso-element:para-border-div;border:none;border-bottom:double windowtext 2.25pt;padding:0cm 0cm 1.0pt 0cm'><p class=MsoNormal style='border:none;padding:0cm'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>/home/xymon/server/sms/sendsms.php:<o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>#!/usr/bin/php<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><?php<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>$gsm = $argv[1];<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>$message = $argv[2];<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>mail('xxxxx@gmail.com', 'Monitor Alert', $message .  $gsm);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>$file = fopen("http://www.targetsms.nl/service/sendsms?username=xxxx&handle=7840ea16c7f3001fe86152bef5b6b727&aff=32879&soort=SMS&originator=Monitor+Alert&to=$gsm&message=$message","r");;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>?><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Van:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Xymon [mailto:xymon-bounces@xymon.com] <b>Namens </b>Metron 6 (six)<br><b>Verzonden:</b> woensdag 13 september 2017 02:47<br><b>Aan:</b> Bruce Ferrell <bferrell@baywinds.org><br><b>CC:</b> xymon@xymon.com<br><b>Onderwerp:</b> Re: [Xymon] receiving sms alerts...<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><div><p class=MsoNormal>i cant get it to work....<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>this is from alerts.cfg<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal> 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<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>this is smsalert.sh<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>#!/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<o:p></o:p></p></div><div><p class=MsoNormal>and this is sendsms.sh<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>#!/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<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>This is whats written to the log file:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>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<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>and of course i receive a cropped sms message...<o:p></o:p></p></div><div><p class=MsoNormal>anyone can help ?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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/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/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>> _______________________________________________<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/mailman/listinfo/xymon</a><br>><br>><br>><br>> _______________________________________________<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/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><o:p></o:p></p></div></div></div></body></html>