Xymon Mailing List Archive search

display multiple line status

list Jeremy Laidman
Fri, 10 May 2013 10:19:22 +1000
Message-Id: <CAAnki7A0M-DCMGwdPijH0sR=7=user-0670b7630054@xymon.invalid>

I don't think the xymon command will do any escaping.  Instead you need to
pass the newline literally.  Why is it you can't use a file?  Knowing why
you're constrained would make it easier to propose a suitable solution.

You could do something like this:

$XYMON $XYMSRV "status www,foo,com.http green `date` Web OK
second line"

Or to make it more readable:

NL='
' # newline
$XYMON $XYMSRV "status www,foo,com.http green `date` Web OK${NL}second line"

Or maybe this would work for you:

printf "status www,foo,com.http green `date` Web OK\nsecond line\n" | $XYMON
$XYMSRV "@"

Or of you don't like to use printf:

{ echo "status www,foo,com.http green `date` Web OK"; echo "second line\n";
} | $XYMON $XYMSRV "@"

Cheers
Jeremy


On 10 May 2013 10:02, P Yeung <user-087b596b835c@xymon.invalid> wrote:
I am using xymon 4.3.11.

Using the example shown in "man xymon",
$XYMON $XYMSRV "status www,foo,com.http green `date` Web OK"
I can see the status displayed as a single line in the xymon server.

    Thu May 9 16:52:07 PDT 2013 Web OK

I need to display multiple lines to the xymon server, with the data in the
command line rather than a file.  I tried,
$XYMON $XYMSRV "status www,foo,com.http green `date` Web OK\n second
line"
But the status is displayed in one line instead of two in the xymon server

     Thu May 9 16:52:47 PDT 2013 Web OK\n second line

What escape character should I use to specify new line?

Thanks
P Yeung