Xymon Mailing List Archive search

xymon communications program (server/bin/xymon) reading from stdin - first line only?

4 messages in this thread

list Glauber Ribeiro · Thu, 29 Mar 2018 17:03:57 +0000 ·
Recently I tried to modify one of my xymon extension scripts, which passes the message data to the xymon command on the command line, to pass it via STDIN instead.

It worked (sort of), but I was not able to get xymon to process more than the first line of the message (the one with color, status, timestamp). The rest of the message seemed to be ignored.

This is xymon version 4.3.27. Is that a known problem?

Thanks,

glauber
list Schminke_Erik_D · Fri, 30 Mar 2018 09:09:34 -0500 ·
Do you have a sample of the data you're trying to send with the xymon
command?  Also, can you provide the specific command you're running to try
to send?

Depending on the nature of the test this extension is sending, only the
first line may be relevant.

For me, most of my extensions send "status" messages.  From the manpage,
the format for that is:

status[+LIFETIME][/group:GROUP] HOSTNAME.TESTNAME COLOR <additional text>

The manpage also states:

The "additional text" normally includes a local timestamp and a summary of
the test result on the first line. Any lines following the first one are
free-form, and can include any information that may be useful to diagnose
the problem being reported.

For me, the "additional text" will show up on the page for the "service
status" pages, but no real action is taken on them.  That is of course, the
"additional text" is setup to be collected for graphing.

So again... sample of data and command you're running would be helpful and
"what are you expecting to happen".

Thanks,


Erik D. Schminke | Associate Systems Programmer
Hormel Foods Corporation | One Hormel Place | Austin, MN XXXXX
Phone: (XXX) XXX-XXXX
user-15513f33c451@xymon.invalid | www.hormelfoods.com
list John Thurston · Fri, 30 Mar 2018 08:26:13 -0800 ·
I suspect you need to double-quote the final string. Without that, I suspect the xymon command is only reading everything up to the first line feed.

Can you provide an explicit example? ie "This worked...this didn't"

--
    Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Department of Administration
State of Alaska
quoted from Glauber Ribeiro

On 3/29/2018 9:03 AM, Ribeiro, Glauber wrote:
Recently I tried to modify one of my xymon extension scripts, which passes the message data to the xymon command on the command line, to pass it via STDIN instead.

It worked (sort of), but I was not able to get xymon to process more than the first line of the message (the one with color, status, timestamp). The rest of the message seemed to be ignored.
list Glauber Ribeiro · Fri, 30 Mar 2018 17:17:03 +0000 ·
It's backward of that: the string in the command line worked (I didn't have to double-quote it because I wasn't running xymon from the shell, but from a Unix "system" call, via perl). When I tried the same string being fed via STDIN (passing - in the command line), it got processed up to the first newline. I also tried the --merge parameter (sending the first line in the commandline and the rest via stdin), but that errored out.

It's not a big problem - I just reverted to using the command line. Only rarely there is so much data that it exceeds the command line limits. Actually this was the first time i saw this happen, in years.

g
quoted from John Thurston

-----Original Message-----
From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of John Thurston
Sent: Friday, March 30, 2018 11:26
To: xymon at xymon.com
Subject: Re: [Xymon] xymon communications program (server/bin/xymon) reading from stdin - first line only?

I suspect you need to double-quote the final string. Without that, I suspect the xymon command is only reading everything up to the first line feed.

Can you provide an explicit example? ie "This worked...this didn't"

--
    Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Department of Administration
State of Alaska

On 3/29/2018 9:03 AM, Ribeiro, Glauber wrote:
Recently I tried to modify one of my xymon extension scripts, which passes the message data to the xymon command on the command line, to pass it via STDIN instead.

It worked (sort of), but I was not able to get xymon to process more than the first line of the message (the one with color, status, timestamp). The rest of the message seemed to be ignored.