New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI Display Issue Unifi Wifi #5766

Closed
TyShawn76 opened this Issue Feb 4, 2017 · 7 comments

Comments

Projects
None yet
2 participants
@TyShawn76

TyShawn76 commented Feb 4, 2017

DO NOT DELETE THIS INFORMATION.

Please read this information carefully.

GitHub issues is for feature requests or bugs, please do not post issues asking for help or how to do X, Y or Z.
You can use our irc channel ##librenms on freenode to ask questions or our community site.

Please confirm each of the sections below by putting an x in the box like [x].

  • Is your install up to date? Updating your install
    Please do not submit an issue if your install is not up to date within the last 24 hours or on a stable monthly release.
  • Please include all of the information between the ==================================== section of ./validate.php which you can run from the cli.
    ==========================================================
    Component | Version
    --------- | -------
    LibreNMS | 424ac80
    DB Schema | 159
    PHP | 5.6.29-0+deb8u1
    MySQL | 5.5.54-0+deb8u1
    RRDTool | 1.4.8
    SNMP | NET-SNMP 5.7.2.1
    ==========================================================
  • Unless your issue is for a WebUI fix or feature then please provide ALL info asked for here.
  • Please provide as much detail as possible.
  • Please do NOT post more than 10 lines of debug information here, use a pastebin service or GitHub Gists.
    Multiple sections are off in the GUI most are over Chrome and Safari and one is only over Safari.

The following section is in the Unifi wireless area, and the text is cut off over both browsers.
screen shot 2017-02-04 at 6 50 58 am
screen shot 2017-02-04 at 6 51 14 am

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Feb 7, 2017

Member

Can you try this patch please:

diff --git a/html/includes/graphs/device/ubnt_unifi_RadioCu_0.inc.php b/html/includes/graphs/device/ubnt_unifi_RadioCu_0.inc.php
index 3d0e246..3968db0 100644
--- a/html/includes/graphs/device/ubnt_unifi_RadioCu_0.inc.php
+++ b/html/includes/graphs/device/ubnt_unifi_RadioCu_0.inc.php
@@ -32,4 +32,4 @@ if (rrdtool_check_rrd_exists($rrd_filename)) {
     echo "file missing: $rrd_filename";
 }

-require 'includes/graphs/generic_multi.inc.php';
+require 'includes/graphs/generic_multi_line.inc.php';
diff --git a/html/includes/graphs/device/ubnt_unifi_RadioCu_1.inc.php b/html/includes/graphs/device/ubnt_unifi_RadioCu_1.inc.php
index 58532bc..5200a89 100644
--- a/html/includes/graphs/device/ubnt_unifi_RadioCu_1.inc.php
+++ b/html/includes/graphs/device/ubnt_unifi_RadioCu_1.inc.php
@@ -32,4 +32,4 @@ if (rrdtool_check_rrd_exists($rrd_filename)) {
     echo "file missing: $rrd_filename";
 }

-require 'includes/graphs/generic_multi.inc.php';
+require 'includes/graphs/generic_multi_line.inc.php';

Member

laf commented Feb 7, 2017

Can you try this patch please:

diff --git a/html/includes/graphs/device/ubnt_unifi_RadioCu_0.inc.php b/html/includes/graphs/device/ubnt_unifi_RadioCu_0.inc.php
index 3d0e246..3968db0 100644
--- a/html/includes/graphs/device/ubnt_unifi_RadioCu_0.inc.php
+++ b/html/includes/graphs/device/ubnt_unifi_RadioCu_0.inc.php
@@ -32,4 +32,4 @@ if (rrdtool_check_rrd_exists($rrd_filename)) {
     echo "file missing: $rrd_filename";
 }

-require 'includes/graphs/generic_multi.inc.php';
+require 'includes/graphs/generic_multi_line.inc.php';
diff --git a/html/includes/graphs/device/ubnt_unifi_RadioCu_1.inc.php b/html/includes/graphs/device/ubnt_unifi_RadioCu_1.inc.php
index 58532bc..5200a89 100644
--- a/html/includes/graphs/device/ubnt_unifi_RadioCu_1.inc.php
+++ b/html/includes/graphs/device/ubnt_unifi_RadioCu_1.inc.php
@@ -32,4 +32,4 @@ if (rrdtool_check_rrd_exists($rrd_filename)) {
     echo "file missing: $rrd_filename";
 }

-require 'includes/graphs/generic_multi.inc.php';
+require 'includes/graphs/generic_multi_line.inc.php';

@laf laf added Needs-Info and removed Needs-Verification labels Feb 7, 2017

@TyShawn76

This comment has been minimized.

Show comment
Hide comment
@TyShawn76

TyShawn76 Feb 7, 2017

Sure how to I apply this patch?

TyShawn76 commented Feb 7, 2017

Sure how to I apply this patch?

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Feb 7, 2017

Member

Copy the contents into a file called patch in /opt/librenms/ then run: git apply patch

Member

laf commented Feb 7, 2017

Copy the contents into a file called patch in /opt/librenms/ then run: git apply patch

@TyShawn76

This comment has been minimized.

Show comment
Hide comment
@TyShawn76

TyShawn76 Feb 8, 2017

Patch seems to have resolved the issue.

TyShawn76 commented Feb 8, 2017

Patch seems to have resolved the issue.

laf added a commit to laf/librenms that referenced this issue Feb 8, 2017

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Feb 8, 2017

Member

Tagging @jquagga

Member

laf commented Feb 8, 2017

Tagging @jquagga

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 8, 2017

Hi @laf / @TyShawn76,

So I looked at this and I think it's an issue with html/includes/graphs/generic_multi_line.inc.php as it's not only the Unifi graphs which show this behavior (at least on my installed). Here's a screenshot of the netstat's snmp poller graph and it has the same "falling off the edge" problem.

netstats-fs8

I can offer a fix but it may be sub-optimal. I looked at generic_multi_line (a different "generic" but one we know works) and it always sets $descr_len = 12. generic_multi_line (which both Unifi and netstats-snmp and a few other graphs use) has some fancier math going on and does different things for wide and thin graphs. The line which causes the issue I believe is line 24 of generic_multi.inc.php:

$descr_len += round(($width - 250) / 8);

Prior to this, the length is set to 12. This adds to it to optimize the width, but it makes the graph fall off the edge. I'm afraid I don't understand this math well enough to determine what the optimal value is. However, if you just comment the line out, the $descr_len becomes 12 and that works.

After that line is commented out:
wifi-fs8

So on the one hand, this is sub-optimal as it doesn't push the right side of the graph all the way to the margin. On the other hand, it matches the existing behavior of generic_multi_line.inc.php. So it does look nice with the Wifi Clients graph (which uses the multi line generic).

wifi2-fs8

Simplest "fix" patch:

diff --git a/html/includes/graphs/generic_multi.inc.php b/html/includes/graphs/generic_multi.inc.php
index e7b10b8d0..bbaef2ed5 100644
--- a/html/includes/graphs/generic_multi.inc.php
+++ b/html/includes/graphs/generic_multi.inc.php
@@ -21,7 +21,8 @@ if ($width > '500') {
     $descr_len = 24;
 } else {
     $descr_len  = 12;
-    $descr_len += round(($width - 250) / 8);
+    # FIXME - Presently overflows graph
+    #$descr_len += round(($width - 250) / 8);
 }
 
 if ($nototal) {

ghost commented Feb 8, 2017

Hi @laf / @TyShawn76,

So I looked at this and I think it's an issue with html/includes/graphs/generic_multi_line.inc.php as it's not only the Unifi graphs which show this behavior (at least on my installed). Here's a screenshot of the netstat's snmp poller graph and it has the same "falling off the edge" problem.

netstats-fs8

I can offer a fix but it may be sub-optimal. I looked at generic_multi_line (a different "generic" but one we know works) and it always sets $descr_len = 12. generic_multi_line (which both Unifi and netstats-snmp and a few other graphs use) has some fancier math going on and does different things for wide and thin graphs. The line which causes the issue I believe is line 24 of generic_multi.inc.php:

$descr_len += round(($width - 250) / 8);

Prior to this, the length is set to 12. This adds to it to optimize the width, but it makes the graph fall off the edge. I'm afraid I don't understand this math well enough to determine what the optimal value is. However, if you just comment the line out, the $descr_len becomes 12 and that works.

After that line is commented out:
wifi-fs8

So on the one hand, this is sub-optimal as it doesn't push the right side of the graph all the way to the margin. On the other hand, it matches the existing behavior of generic_multi_line.inc.php. So it does look nice with the Wifi Clients graph (which uses the multi line generic).

wifi2-fs8

Simplest "fix" patch:

diff --git a/html/includes/graphs/generic_multi.inc.php b/html/includes/graphs/generic_multi.inc.php
index e7b10b8d0..bbaef2ed5 100644
--- a/html/includes/graphs/generic_multi.inc.php
+++ b/html/includes/graphs/generic_multi.inc.php
@@ -21,7 +21,8 @@ if ($width > '500') {
     $descr_len = 24;
 } else {
     $descr_len  = 12;
-    $descr_len += round(($width - 250) / 8);
+    # FIXME - Presently overflows graph
+    #$descr_len += round(($width - 250) / 8);
 }
 
 if ($nototal) {
@lock

This comment has been minimized.

Show comment
Hide comment
@lock

lock bot May 17, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

lock bot commented May 17, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

@lock lock bot locked as resolved and limited conversation to collaborators May 17, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.