在 nagios 中打印多行输出 [英] Print more than one line output in nagios
问题描述
我编写了一个脚本,它正在打印多行输出.但是在 nagios 中它只显示一行.有谁知道如何在 Nagios 中打印多行
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
推荐答案
多行输出仅适用于 Nagios 3 及更新版本.
首先,您可以为所需输出的每一行使用 html 标记 <br/>
.
下一个重要的事情是在 Nagios 服务器上的 cgi.cfg
中禁用 HTML 标记转义.
找到 escape_html_tags=1
并更改为 escape_html_tags=0
.
然后重启 Nagios 服务器.
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.
关于 Nagios 插件输出的一些建议可以在这里找到:https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/pluginapi.html
Some advice about Nagios plugins output can be found here: https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/pluginapi.html
PS:默认情况下,Nagios 只会读取插件返回的前 4 KB 数据.
PS: By default Nagios will only read the first 4 KB of data that a plugin returns.
这篇关于在 nagios 中打印多行输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!