Re: Upgraded to Nagios XI 2014R2.0: newline problem
Posted: Tue Jan 06, 2015 2:18 pm
Ah, now that makes sense. In perl, the comand:
print "sum|x=1\nThis is line1\nThis is line2\nThis is line3\n"
will produce multiline output.
Perl will change the occurrences of "\n" to newline characters,
but bash won't by default. Some of the plugin output parsing was
re-written in 4.0x so most likely that's why it broke your scripts
after the XI update.
I had to look at the man page for echo to see what the -e parameter that
sreinhardt suggested would do. That will probably work for you.
"-e enable interpretation of backslash escapes"
print "sum|x=1\nThis is line1\nThis is line2\nThis is line3\n"
will produce multiline output.
Perl will change the occurrences of "\n" to newline characters,
but bash won't by default. Some of the plugin output parsing was
re-written in 4.0x so most likely that's why it broke your scripts
after the XI update.
I had to look at the man page for echo to see what the -e parameter that
sreinhardt suggested would do. That will probably work for you.
"-e enable interpretation of backslash escapes"