Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Check output text doesn't wrap in 0.24.0 #679

Closed
tknodell opened this issue May 3, 2017 · 4 comments
Closed

Check output text doesn't wrap in 0.24.0 #679

tknodell opened this issue May 3, 2017 · 4 comments
Assignees
Labels
Milestone

Comments

@tknodell
Copy link

tknodell commented May 3, 2017

uchiwa-scrollbar

Expected Behavior

Expect the text in the check output to wrap to the next line when viewed in the browser. It wrapped in previous versions of uchiwa.

Current Behavior

Output text does not wrap. Notice the cut off text & the long scrollbar in the bottom of the screenshot

Possible Solution

Believe this was introduced by https://github.com/sensu/uchiwa-web/pull/157
Not sure of the correct fix

Steps to Reproduce (for bugs)

  1. View check result with long output in uchiwa

Your Environment

  • Uchiwa version used: 0.24.0
  • Sensu version used: 0.29.0
  • Operating System and version (e.g. Ubuntu 14.04): Centos
@palourde
Copy link
Contributor

palourde commented May 4, 2017

Hi @tknodell

I was unfortunately unable to reproduce this issue, as you can see on the screenshot below:
screen shot 2017-05-04 at 11 22 12

It looks like the output returned by your check check_vmware_tools starts with a bullet point, which leads me to believe there might be some hidden HTML in the output. You could try to extract the raw output from the Sensu API?

Thanks

@palourde palourde self-assigned this May 4, 2017
@palourde palourde added the Bug label May 4, 2017
@tknodell
Copy link
Author

tknodell commented May 4, 2017

Very interesting, I looked at another check on the same host and it did wrap correctly, but this check does not.

This output of this service check does have a url in it, wonder if the href or quotes is messing up the css?

Here's the HTML output of the check in uchiwa.

<span class="value ng-binding ellipsis" ng-class="isUrl(value) ? 'ellipsis' : ''" ng-bind-html="value | highlight">● vmtoolsd.service - Service for virtual machines hosted on VMware
   Loaded: loaded (/usr/lib/systemd/system/vmtoolsd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2017-04-22 15:33:43 UTC; 1 weeks 4 days ago
     Docs: <a target="_blank" href="http://github.com/vmware/open-vm-tools">http://github.com/vmware/open-vm-tools</a>
 Main PID: 667 (vmtoolsd)
   Memory: 8.4M
   CGroup: /system.slice/vmtoolsd.service
           └─667 /usr/bin/vmtoolsd
</span>

Here's the check result from the API

$ curl -su sensu http://REDACTED:4567/results/REDACTED/check_vmware_tools | python -m json.tool
Enter host password for user 'sensu':
{
    "check": {
        "command": "/etc/nagios/plugins/check_service -s vmtoolsd -t systemctl",
        "duration": 0.133,
        "executed": 1493905881,
        "handlers": [
            "default"
        ],
        "interval": 120,
        "issued": 1493905881,
        "name": "check_vmware_tools",
        "occurrences": 5,
        "output": "\u25cf vmtoolsd.service - Service for virtual machines hosted on VMware\n   Loaded: loaded (/usr/lib/systemd/system/vmtoolsd.service; enabled; vendor preset: enabled)\n   Active: active (running) since Sat 2017-04-22 15:33:43 UTC; 1 weeks 4 days ago\n     Docs: http://github.com/vmware/open-vm-tools\n Main PID: 667 (vmtoolsd)\n   Memory: 8.4M\n   CGroup: /system.slice/vmtoolsd.service\n           \u2514\u2500667 /usr/bin/vmtoolsd\n",
        "publish": true,
        "refresh": 1800,
        "standalone": true,
        "status": 0,
        "timeout": 30,
        "ttl": 1200,
        "type": "standard"
    },
    "client": "REDACTED"
}

@Gillingham
Copy link
Contributor

Gillingham commented May 5, 2017

I can confirm I'm seeing this same thing, and also that it seems to be flipping between wrapping properly and not, but 80+% of the time it is not wrapping. In my case the output does include URLs.

Specifically the check results has a URL that I believe causes the span to get the the ellipsis class applied to them, which ends in it having white-space: nowrap !important; style applied, thus breaking the wrapping set it .element-view .value for proper white-space: pre line;

@palourde
Copy link
Contributor

palourde commented May 5, 2017

Thank you @tknodell & @Gillingham for your help.

As pointed out, the output have the ellipsis class applied, which produced an unexpected result. I've made some changes to this CSS class through https://github.com/sensu/uchiwa-web/pull/163, we should be good now.

This patch will be included in the next release.

Thanks!

@palourde palourde added this to the 0.25.0 milestone May 5, 2017
@palourde palourde closed this as completed May 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants