Hi Nagios Devas,
I upgraded a 3.51 to 4.08 and my passive checks which use LONGOUTPUT to transmit many lines are now being interpreted as peformance data ie. the multiline is concatenated on to the performance data.
Has the format changed in 4.x? I reverted to 3.51 and all is fine again.
Here's my debug:
echo "[1408524453] PROCESS_HOST_CHECK_RESULT;TESTHOST;OK;HELLO WORLD|pfdata=47s;10;20;;\naline1\naline2\nline3\nline4" > /usr/local/nagios/var/rw/nagios.cmd
On 3.5 this displays as:
Status Information: HELLO WORLD
aline1
aline2
line3
line4
Performance Data: pfdata=47s;10;20;;
But, nagios 4.08
Status Information: HELLO WORLD
Performance Data: pfdata=47s;10;20;;\naline1\naline2\nline3\nline4
Any ideas appreciated.
Thanks
Has multiline (LONGOUTPUT) changed in 4.x ?
Re: Has multiline (LONGOUTPUT) changed in 4.x ?
There may have been an undocumented change to the way perfdata is handled. My tests show that everything (including text on newlines) after the pipe is now considered perfdata. You can still output multiple lines, but the perfdata has to be at the end. Does this agree with what you have experienced?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Has multiline (LONGOUTPUT) changed in 4.x ?
Thanks for replying. Yes that's how it looks to me also.
I did check the manual expecting to see a change, but didn't.
I was hoping that since manual hadn't changed it was a bug, I've a whole stack of remote hosts that send data passive in this way...Upgrade nightmare
I did check the manual expecting to see a change, but didn't.
I was hoping that since manual hadn't changed it was a bug, I've a whole stack of remote hosts that send data passive in this way...Upgrade nightmare
Re: Has multiline (LONGOUTPUT) changed in 4.x ?
Actually, looking at it more closely I can't get it to work with the multiline output even in this format:
echo "[1408610612] PROCESS_HOST_CHECK_RESULT;TESTHOST;OK;HELLO WORLD\nline1\nline2\nline3\nline4|pfdata=47s;10;20;;" > /usr/local/nagios/var/rw/nagios.cmd
Superficially it looks ok, the perf data is in the right place. However, the multilines are just extensions of the first status line and the GUI expands to show them
May be I'm missing something simple?
Thanks for your time.
echo "[1408610612] PROCESS_HOST_CHECK_RESULT;TESTHOST;OK;HELLO WORLD\nline1\nline2\nline3\nline4|pfdata=47s;10;20;;" > /usr/local/nagios/var/rw/nagios.cmd
Superficially it looks ok, the perf data is in the right place. However, the multilines are just extensions of the first status line and the GUI expands to show them
May be I'm missing something simple?
Thanks for your time.
Re: Has multiline (LONGOUTPUT) changed in 4.x ?
You're doing everything right, this is a bug.simon1485 wrote:Actually, looking at it more closely I can't get it to work with the multiline output even in this format:
echo "[1408610612] PROCESS_HOST_CHECK_RESULT;TESTHOST;OK;HELLO WORLD\nline1\nline2\nline3\nline4|pfdata=47s;10;20;;" > /usr/local/nagios/var/rw/nagios.cmd
Superficially it looks ok, the perf data is in the right place. However, the multilines are just extensions of the first status line and the GUI expands to show them
May be I'm missing something simple?
Thanks for your time.
Core should be unescaping backslash (\\) and newline (\n) sequences in plugin output it reads from nagios.cmd. I'll have a fix committed soon.
Thanks for reporting this.
Re: Has multiline (LONGOUTPUT) changed in 4.x ?
This should be fixed with commit a34073f.
If you want to give it a try you can use the current master from GitHub: https://github.com/NagiosEnterprises/na ... master.zip
Thanks again.
If you want to give it a try you can use the current master from GitHub: https://github.com/NagiosEnterprises/na ... master.zip
Thanks again.