sni / Thruk

Thruk is a multibackend monitoring webinterface for Naemon, Nagios, Icinga and Shinken using the Livestatus API.
http://www.thruk.org
Other
408 stars 148 forks source link

Wrong multiline output in Service Status Details #1130

Open tomaszdubiel18 opened 3 years ago

tomaszdubiel18 commented 3 years ago

Describe the bug Wrong display of multiline output. Its Naemon installation.

Thruk Version Thruk 2.44.3

To Reproduce Open Service status details

Expected behavior In 2.42 the output was underlined and the full formatted output was available on click

Screenshots obraz The output in Mine Map is properly formatted. obraz

Desktop (please complete the following information): Firefox

Additional context Add any other context about the problem here.

tomaszdubiel18 commented 3 years ago

Trying with \\n didnt change service status details output and now output in Mine Map is as folllows: obraz

tomaszdubiel18 commented 3 years ago

I think it can be related bug. Look at last comment. https://github.com/naemon/naemon-core/issues/144

Ashark commented 3 years ago

I thought maybe using api (instead of direct invoking of submit_check_result) could workaround that, but no luck. I tried it like this:

curl -k -H "X-Thruk-Auth-Key: $THRUK_API_KEY_MYKEY" \
            -d "cmd=process_service_check_result" \
            -d "host=my_test_host" \
            -d "service=my_test_service" \
            -d "plugin_output=red\nthis" \
            -d "plugin_state=2" \
          'https://example.org/thruk/r/cmd'

In the status.cgi page (the observe page where hosts with their services are shown) in the plugin output I see the text "red\nthis". But I noticed that in the extinfo.cgi (the dedicated page for that service), the text in Status Information is shown correctly with several lines.

tomaszdubiel18 commented 3 years ago

I think I could close this issue. Switching from '\n' to html tag br solved the problem.

Ashark commented 3 years ago

For <br> to work, in cgi.cfg you need to set escape_html_tags = 0.

It can be used as solution. But still the \n variant is broken. I am not sure if that should be fixed from the thruk or in naemon bug from your link.

tomaszdubiel18 commented 3 years ago

@sni, how do you think? Close it or not?

tomaszdubiel18 commented 2 years ago

@sni, please come back to this issue. After seeing closed issue for Naemon: https://github.com/naemon/naemon-core/issues/387 I updated it, checked whether something had changed, but still - there is wrong multiline output in Service Status Details.

tomaszdubiel18 commented 2 years ago

I remind "Expected behavior In 2.42 the output was underlined and the full formatted output was available on click"