Xymon Mailing List Archive search

Insert a newline into your custom xymon message?

5 messages in this thread

list Gabby Gibbons · Thu, 24 Sep 2020 13:16:18 +0000 (UTC) ·
Hello,
I'm wondering if there's any way to insert a newline in a message. I know it's possible to do by actually putting it on another line in the script but I don't like the way that it looks because it messes up all the indenting in the script, so that's why I was wondering if there's a newline character that xymon supports, \n doesn't work it just append a literal "\n".
An example of the way I can get it to work, but looks bad:MSG="${MSG}appended text"
How I would like it work:MSG="${MSG}\nappended text"
Thanks
list Adam Goryachev · Fri, 25 Sep 2020 00:36:08 +1000 ·
quoted from Gabby Gibbons
On 24/9/20 23:16, Gabby Gibbons via Xymon wrote:
Hello,

I'm wondering if there's any way to insert a newline in a message. I know it's possible to do by actually putting it on another line in the script but I don't like the way that it looks because it messes up all the indenting in the script, so that's why I was wondering if there's a newline character that xymon supports, \n doesn't work it just append a literal "\n".

An example of the way I can get it to work, but looks bad:
MSG="${MSG}
appended text"

How I would like it work:
MSG="${MSG}\nappended text"
What about:

MSG=`echo -en "${MSG}\nappended text\n"`

Regards,
Adam

--
list Jeremy Ruffer · Thu, 24 Sep 2020 16:13:55 +0100 ·
I'm wondering if </br> would do it.

Jeremy

On Thu, 24 Sep 2020, 15:36 Adam Goryachev, <
quoted from Adam Goryachev
user-92fd6827f6ae@xymon.invalid> wrote:
On 24/9/20 23:16, Gabby Gibbons via Xymon wrote:

Hello,

I'm wondering if there's any way to insert a newline in a message. I know
it's possible to do by actually putting it on another line in the script
but I don't like the way that it looks because it messes up all the
indenting in the script, so that's why I was wondering if there's a newline
character that xymon supports, \n doesn't work it just append a literal
"\n".

An example of the way I can get it to work, but looks bad:
MSG="${MSG}
appended text"

How I would like it work:
MSG="${MSG}\nappended text"


What about:

MSG=`echo -en "${MSG}\nappended text\n"`

Regards,
Adam

--

list Scot Kreienkamp · Thu, 24 Sep 2020 15:19:12 +0000 ·
Xymon will display HTML inline, so you can do anything HTML.  The emails it sends out are plain text by default though, so you would see any html code there.

You can try this:

MSG=?${MSG}\nAppended text?

Then your submit command would be like this:

$XYMON $XYMSERVERS "status+20 $HOSTNAME.$TESTNAME $COLOR `date` $STATUS

$(echo -e ${MSG})

?

Echo -e would interpret the newline and actually insert it at that point.


Scot Kreienkamp | Senior Systems Engineer | La-Z-Boy Corporate
One La-Z-Boy Drive | Monroe, Michigan 48162 | ? XXX-XXX-XXXX | |  ? X-XXX-XXX-XXXX  | ? user-9678697f1438@xymon.invalid
www.la-z-boy.com<http://www.la-z-boy.com>;  | facebook.com/lazboy<http://facebook.com/lazboy>;  | twitter.com/lazboy<http://twitter.com/lazboy>; | youtube.com/lazboy<http://youtube.com/lazboy>;
[cid:4C-lzbVertical_Tag_400px_d8b9412e-f3ea-46a1-99dc-a7c57261e11e.jpg]
From: Xymon <xymon-bounces at xymon.com> On Behalf Of Jeremy Ruffer
Sent: Thursday, September 24, 2020 11:14 AM
To: Adam Goryachev <user-92fd6827f6ae@xymon.invalid>
Cc: xymon <xymon at xymon.com>
Subject: Re: [Xymon] Insert a newline into your custom xymon message?

ATTENTION:   This email was sent to La-Z-Boy from an external source.     Be vigilant when opening attachments or clicking links.
quoted from Jeremy Ruffer
I'm wondering if </br> would do it.

Jeremy

On Thu, 24 Sep 2020, 15:36 Adam Goryachev, <user-92fd6827f6ae@xymon.invalid<mailto:user-92fd6827f6ae@xymon.invalid>> wrote:


On 24/9/20 23:16, Gabby Gibbons via Xymon wrote:
Hello,

I'm wondering if there's any way to insert a newline in a message. I know it's possible to do by actually putting it on another line in the script but I don't like the way that it looks because it messes up all the indenting in the script, so that's why I was wondering if there's a newline character that xymon supports, \n doesn't work it just append a literal "\n".

An example of the way I can get it to work, but looks bad:
MSG="${MSG}
appended text"

How I would like it work:
MSG="${MSG}\nappended text"


What about:

MSG=`echo -en "${MSG}\nappended text\n"`

Regards,
Adam

--


This message is intended only for the individual or entity to which it is addressed. It may contain privileged, confidential information which is exempt from disclosure under applicable laws. If you are not the intended recipient, you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information. If you have received this communication in error, please notify us immediately by e-mail or by telephone at the above number. Thank you.
list Gabby Gibbons · Thu, 24 Sep 2020 17:28:15 +0000 (UTC) ·
 These all worked beautifully, thank you everyone. I think I will go with the echo -en at the xymon call, that seems to be the cleanest way to do it.
    On Thursday, September 24, 2020, 11:24:55 AM EDT, Scot Kreienkamp <user-9678697f1438@xymon.invalid> wrote:  
 
 #yiv3793110492 #yiv3793110492 -- _filtered {} _filtered {} _filtered {}#yiv3793110492 #yiv3793110492 p.yiv3793110492MsoNormal, #yiv3793110492 li.yiv3793110492MsoNormal, #yiv3793110492 div.yiv3793110492MsoNormal {margin:0in;font-size:11.0pt;font-family:sans-serif;}#yiv3793110492 a:link, #yiv3793110492 span.yiv3793110492MsoHyperlink {color:blue;text-decoration:underline;}#yiv3793110492 span.yiv3793110492EmailStyle19 {font-family:sans-serif;color:windowtext;}#yiv3793110492 .yiv3793110492MsoChpDefault {font-size:10.0pt;} _filtered {}#yiv3793110492 div.yiv3793110492WordSection1 {}#yiv3793110492 
quoted from Scot Kreienkamp
Xymon will display HTML inline, so you can do anything HTML.? The emails it sends out are plain text by default though, so you would see any html code there.?
 
 ?
 
You can try this:
 
 ?
 
MSG=?${MSG}\nAppended text?
 
 ?
 
Then your submit command would be like this:
 
 ?
 
$XYMON $XYMSERVERS "status+20 $HOSTNAME.$TESTNAME $COLOR `date` $STATUS
 
 ?
 
$(echo -e ${MSG})
 
 ?
 
?
 
 ?
 
Echo -e would interpret the newline and actually insert it at that point.?
 
 ?
 
 ?
 
 ?
 
Scot Kreienkamp | Senior Systems Engineer | La-Z-Boy Corporate
One La-Z-Boy Drive | Monroe, Michigan 48162 |?( XXX-XXX-XXXX | | ?) X-XXX-XXX-XXXX? | * user-9678697f1438@xymon.invalid

www.la-z-boy.com ?| facebook.com/lazboy??| twitter.com/lazboy | youtube.com/lazboy
quoted from Jeremy Ruffer


From: Xymon <xymon-bounces at xymon.com>On Behalf Of Jeremy Ruffer
Sent: Thursday, September 24, 2020 11:14 AM
To: Adam Goryachev <user-92fd6827f6ae@xymon.invalid>
Cc: xymon <xymon at xymon.com>
Subject: Re: [Xymon] Insert a newline into your custom xymon message?
 
 ?
 
ATTENTION: ? This email was sent to La-Z-Boy from an external source. ? ? Be vigilant when opening attachments or clicking links.
 
I'm wondering if </br> would do it.
 
 ?
 
Jeremy?
 
 ?
 
On Thu, 24 Sep 2020, 15:36 Adam Goryachev, <user-92fd6827f6ae@xymon.invalid> wrote:
 

 ?
 
On 24/9/20 23:16, Gabby Gibbons via Xymon wrote:
 

Hello,
 
 ?
 
I'm wondering if there's any way to insert a newline in a message. I know it's possible to do by actually putting it on another line in the script but I don't like the way that it looks because it messes up all the indenting in the script, so that's why I was wondering if there's a newline character that xymon supports, \n doesn't work it just append a literal "\n".
 
 ?
 
An example of the way I can get it to work, but looks bad:
 
MSG="${MSG}
 
appended text"
 
 ?
 
How I would like it work:
 
MSG="${MSG}\nappended text"
 

 ?
 
What about:
 
MSG=`echo -en "${MSG}\nappended text\n"`
 
Regards,
Adam
 
-- 
 

This message is intended only for the individual or entity to which it is addressed. It may contain privileged, confidential information which is exempt from disclosure under applicable laws. If you are not the intended recipient, you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information. If you have received this communication in error, please notify us immediately by e-mail or by telephone at the above number. Thank you.