<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = 
"urn:schemas-microsoft-com:vml" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word" xmlns:x = 
"urn:schemas-microsoft-com:office:excel" xmlns:p = 
"urn:schemas-microsoft-com:office:powerpoint" xmlns:a = 
"urn:schemas-microsoft-com:office:access" xmlns:dt = 
"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s = 
"uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs = 
"urn:schemas-microsoft-com:rowset" xmlns:z = "#RowsetSchema" xmlns:b = 
"urn:schemas-microsoft-com:office:publisher" xmlns:ss = 
"urn:schemas-microsoft-com:office:spreadsheet" xmlns:c = 
"urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc = 
"urn:schemas-microsoft-com:office:odc" xmlns:oa = 
"urn:schemas-microsoft-com:office:activation" xmlns:html = 
"http://www.w3.org/TR/REC-html40" xmlns:q = 
"http://schemas.xmlsoap.org/soap/envelope/" XMLNS:D = "DAV:" xmlns:mt = 
"http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2 = 
"http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ois = 
"http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir = 
"http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds = 
"http://www.w3.org/2000/09/xmldsig#" xmlns:dsp = 
"http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc = 
"http://schemas.microsoft.com/data/udc" xmlns:xsd = 
"http://www.w3.org/2001/XMLSchema" xmlns:sub = 
"http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec = 
"http://www.w3.org/2001/04/xmlenc#" xmlns:sp = 
"http://schemas.microsoft.com/sharepoint/" xmlns:sps = 
"http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi = 
"http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs = 
"http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf = 
"http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p = 
"http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf = 
"http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss = 
"http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi = 
"http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi = 
"http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver = 
"http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m = 
"http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels = 
"http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp = 
"http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t = 
"http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m = 
"http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl = 
"http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl = 
"http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" 
XMLNS:Z = "urn:schemas-microsoft-com:" xmlns:st = ""><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.5512" name=GENERATOR>
<STYLE>@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Tahoma;
}
@font-face {
        font-family: Verdana;
}
@font-face {
        font-family: MS Reference Sans Serif;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.EmailStyle17 {
        FONT-WEIGHT: normal; COLOR: blue; FONT-STYLE: normal; FONT-FAMILY: "MS Reference Sans Serif","sans-serif"; TEXT-DECORATION: none; mso-style-type: personal
}
SPAN.EmailStyle18 {
        COLOR: #1f497d; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-reply
}
.MsoChpDefault {
        FONT-SIZE: 10pt; mso-style-type: export-only
}
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 vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=421453010-19032009><FONT face=Arial 
color=#0000ff size=2>Your suggestion indicates you do not understand what he was 
trying to do :)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=421453010-19032009><FONT face=Arial 
color=#0000ff size=2>He was trying to cut the hostname short, by having a 
maximum of 160 characters.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=421453010-19032009><FONT face=Arial 
color=#0000ff size=2><A 
href="http://tldp.org/LDP/abs/html/string-manipulation.html">http://tldp.org/LDP/abs/html/string-manipulation.html</A> (see 
the section <STRONG><FONT face="Times New Roman" color=#000000 size=3>Substring 
Extraction)</FONT></STRONG></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=421453010-19032009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=421453010-19032009><FONT face=Arial 
color=#0000ff size=2>It is a feature for BASH shells, but maybe some modern 
Bourne shells have it as well (I know I used it on some modern HP/UX with 
their standard /bin/sh)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=421453010-19032009><FONT face=Arial 
color=#0000ff size=2>So putting the :0:160 outside the brackets would not yield 
the desired result.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=421453010-19032009><FONT face=Arial 
color=#0000ff size=2>On the other hand, hostnames rarely go that long, so 
cutting it short seems quite useless. </FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=421453010-19032009></SPAN><FONT face=Arial><FONT 
color=#0000ff><FONT size=2>I<SPAN class=421453010-19032009> am not familiar with 
gnokii, but does it actually take a message from stdin? Or does it normally use 
a 'gnokii --sendsms <number> <message>' 
format?</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT><FONT color=#0000ff><FONT size=2><SPAN 
class=421453010-19032009></SPAN></FONT></FONT></FONT><SPAN 
class=421453010-19032009></SPAN><FONT face=Arial><FONT color=#0000ff><FONT 
size=2>O<SPAN class=421453010-19032009>therwise, I don't see anything wrong with 
your syntax.</SPAN></FONT></FONT></FONT><BR></DIV>
<DIV class=OutlookMessageHeader lang=nl dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Van:</B> Galen Johnson 
[mailto:Galen.Johnson@sas.com] <BR><B>Verzonden:</B> donderdag 19 maart 2009 
7:53<BR><B>Aan:</B> hobbit@hswn.dk<BR><B>Onderwerp:</B> [hobbit] RE: SMS 
Alerts<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><SPAN 
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">try:<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'">echo 
"${BBHOSTNAME}:0:160 cpu is red" | gnokii --sendsms 
1234567890<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"><o:p> </o:p></SPAN></P>
<DIV>
<DIV 
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=MsoNormal><B><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN 
style="FONT-SIZE: 10pt; 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: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'">Hello,<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'">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: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'">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: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'">So 
far I have<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'">#!/bin/bash<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'">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: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'">I 
am using gnokii as the gate way.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'">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: 10pt; COLOR: blue; FONT-FAMILY: 'MS Reference Sans Serif','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><B><SPAN lang=EN-AU 
style="COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">Jarrod 
Hodder<o:p></o:p></SPAN></B></P>
<P class=MsoNormal><B><U><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"><o:p><SPAN 
style="TEXT-DECORATION: none"> </SPAN></o:p></SPAN></U></B></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">Paradigm 
Management Group<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">110 
Livingston Avenue<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">Kambah, 
ACT 2902<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">1300 
735 370<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-AU 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Verdana','sans-serif'">Jarrod@pmg.net.au</SPAN><SPAN 
lang=EN-AU 
style="FONT-SIZE: 10pt; 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></BODY></HTML>