Xymon Mailing List Archive search

SMS Alerts

list D. - Gdi/snb Kip
Thu, 19 Mar 2009 11:43:29 +0100
Message-Id: <user-8bb30f7a1352@xymon.invalid>

Your suggestion indicates you do not understand what he was trying to do
:)
He was trying to cut the hostname short, by having a maximum of 160
characters.
http://tldp.org/LDP/abs/html/string-manipulation.html (see the section
Substring Extraction)
 
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)
So putting the :0:160 outside the brackets would not yield the desired
result.
On the other hand, hostnames rarely go that long, so cutting it short
seems quite useless. 
 
I 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?
Otherwise, I don't see anything wrong with your syntax.


Van: Galen Johnson [mailto:user-87f955643e3d@xymon.invalid] 
Verzonden: donderdag 19 maart 2009 7:53
Aan: user-ae9b8668bcde@xymon.invalid
Onderwerp: [hobbit] RE: SMS Alerts


try:

echo "${BBHOSTNAME}:0:160 cpu is red" | gnokii --sendsms 1234567890

 
From: Jarrod Hodder [mailto:user-ee4213dc04dd@xymon.invalid] 
Sent: Thursday, March 19, 2009 12:18 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] SMS Alerts

 
Hello,

 
I am trying to get a custom message sent from Hobbit via sms.

All I want is the hostname with a short message sent after it.

 
So far I have

 
#!/bin/bash

echo "${BBHOSTNAME:0:160} cpu is red" | gnokii --sendsms 1234567890

 
I am using gnokii as the gate way.

I think my variable is what is causing the problem, can someone see
where I have gorn wrong?

 
Jarrod Hodder

 
Paradigm Management Group

110 Livingston Avenue

Kambah, ACT 2902

 
1300 735 370

 
user-11207c576d6b@xymon.invalid