<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=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"MS Reference Sans Serif";
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        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.EmailStyle17
        {mso-style-type:personal;
        font-family:"MS Reference Sans Serif","sans-serif";
        color:blue;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</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="EN-US" link="blue" vlink="purple">
<div class="Section1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D">Here's what I do –
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"># cut the message down to 150 characters (allows spatch room for<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"># a security code on echelon pages<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D">TEXT=`echo "${BBALPHAMSG}" | grep "&red"`<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D">TEXTP=`echo "!BB ! - ${BBHOSTSVC} [${ACKCODE}] $FIXED- ${TEXT}" | paste -sd" " | cut -c 1-150`<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D">The grep for &red pulls out only the lines in alphamsg that have a 'red' indicator – for tests like procs or oratab that have multiple lines. The "!BB!" is
 a holdover; I don't remember why we did it. "FIXED" will be null ("") or "FIXED" depending on the $RECOVERED value – and the entire message gets cut to the first 150 characters (our current paging package puts in it's own acknowledgement code at the start
 of the message). The paste –sd" " converts the newlines into spaces before the cut process.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D">HTH<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D">Tom<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Jarrod Hodder [mailto:Jarrod.Hodder@pmg.net.au]
<br>
<b>Sent:</b> Thursday, March 19, 2009 12:18 AM<br>
<b>To:</b> hobbit@hswn.dk<br>
<b>Subject:</b> [hobbit] SMS Alerts<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"MS Reference Sans Serif","sans-serif";
color:blue">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"MS Reference Sans Serif","sans-serif";
color:blue"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"MS Reference Sans Serif","sans-serif";
color:blue">I am trying to get a custom message sent from Hobbit via sms.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"MS Reference Sans Serif","sans-serif";
color:blue">All I want is the hostname with a short message sent after it.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"MS Reference Sans Serif","sans-serif";
color:blue"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"MS Reference Sans Serif","sans-serif";
color:blue">So far I have<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"MS Reference Sans Serif","sans-serif";
color:blue"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"MS Reference Sans Serif","sans-serif";
color:blue">#!/bin/bash<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"MS Reference Sans Serif","sans-serif";
color:blue">echo "${BBHOSTNAME:0:160} cpu is red" | gnokii --sendsms 1234567890<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"MS Reference Sans Serif","sans-serif";
color:blue"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"MS Reference Sans Serif","sans-serif";
color:blue">I am using gnokii as the gate way.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"MS Reference Sans Serif","sans-serif";
color:blue">I think my variable is what is causing the problem, can someone see where I have gorn wrong?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"MS Reference Sans Serif","sans-serif";
color:blue"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-AU" style="font-family:"Verdana","sans-serif";
color:blue">Jarrod Hodder<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><u><span lang="EN-AU" style="font-size:10.0pt;font-family:
"Verdana","sans-serif";color:blue"><o:p><span style="text-decoration:none"> </span></o:p></span></u></b></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"Verdana","sans-serif";
color:blue">Paradigm Management Group<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"Verdana","sans-serif";
color:blue">110 Livingston Avenue<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"Verdana","sans-serif";
color:blue">Kambah, ACT 2902<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"Verdana","sans-serif";
color:blue"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"Verdana","sans-serif";
color:blue">1300 735 370<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"Verdana","sans-serif";
color:blue"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU" style="font-size:10.0pt;font-family:"Verdana","sans-serif";
color:blue">Jarrod@pmg.net.au</span><span lang="EN-AU" style="font-size:10.0pt;
font-family:"Verdana","sans-serif""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-AU"><o:p> </o:p></span></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">CONFIDENTIALITY NOTICE: This email and any attachments are for the<br>
exclusive and confidential use of the intended recipient. If you are not<br>
the intended recipient, please do not read, distribute or take action in<br>
reliance upon this message. If you have received this in error, please<br>
notify us immediately by return email and promptly delete this message<br>
and its attachments from your computer system. We do not waive<br>
attorney-client or work product privilege by the transmission of this<br>
message.<br>
</font>
</body>
</html>