问题
I have written a script and it is printing multiline output. But in nagios it is showing only one line. Does anyone know how to print multilines in Nagios
回答1:
Multiline ouput is possible only with Nagios 3 and newer.
First of all, you can use html tag <br/>
for each new line of desired output.
Next important thing is disable HTML tag escaping in your cgi.cfg
on Nagios server.
Find escape_html_tags=1
and change to escape_html_tags=0
.
Then you restart Nagios server.
Some advice about Nagios plugins output can be found here: https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/pluginapi.html
PS: By default Nagios will only read the first 4 KB of data that a plugin returns.
来源:https://stackoverflow.com/questions/45640167/print-more-than-one-line-output-in-nagios