Thruk icon indicating copy to clipboard operation
Thruk copied to clipboard

Wrong multiline output in Service Status Details

Open tomaszdubiel18 opened this issue 3 years ago • 8 comments

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 avatar Sep 07 '21 07:09 tomaszdubiel18

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

tomaszdubiel18 avatar Sep 07 '21 07:09 tomaszdubiel18

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

tomaszdubiel18 avatar Sep 07 '21 11:09 tomaszdubiel18

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.

Ashark avatar Sep 14 '21 16:09 Ashark

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

tomaszdubiel18 avatar Sep 15 '21 08:09 tomaszdubiel18

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.

Ashark avatar Sep 15 '21 11:09 Ashark

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

tomaszdubiel18 avatar Sep 15 '21 11:09 tomaszdubiel18

@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 avatar Nov 16 '22 08:11 tomaszdubiel18

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

tomaszdubiel18 avatar Nov 16 '22 08:11 tomaszdubiel18