Thanks for the recent update of the Grafana dashboard!
Unfortunately, it didn't work out-of-box and I had to make a modification regarding the ports query:
The query below doesn't return all ports of the switch
This works for the TL-SG3428 v2.0 switch as you can see in the screenshot below (renamed Disabled to Not Connected):
However the ports of my two other switches TL-SG2008 and TL-SG2218 don't show as expected. After some digging it turns out that the above query returns for each port that has no connection (marked in red) a value of 10 MB/s instead of the expected 0.
After some more digging, I did the rest call for the TL-SG2008 to get the port status. and as you can see the json shows for port 5 a linkStatus of 0, while the query shows a speed of 10 MB/s.
The difference is that the TL-SG2008 reports linkSpeed = 1, while TL-SG3428 v2.0 reports linkSpeed = 0 for ports that are not connected. I am not sure why the TL-SG2008 reports linkSpeed = 1, while there is no connection.
Hi @charlie-haley,
Thanks for the recent update of the Grafana dashboard! Unfortunately, it didn't work out-of-box and I had to make a modification regarding the ports query:
The query below doesn't return all ports of the switch
After removing
vlan_id=""
:omada_port_link_speed_mbps{switch_mac="$Device", site="$Site"}
the port section starts displaying all ports.
This works for the
TL-SG3428 v2.0
switch as you can see in the screenshot below (renamed Disabled to Not Connected):However the ports of my two other switches
TL-SG2008
andTL-SG2218
don't show as expected. After some digging it turns out that the above query returns for each port that has no connection (marked in red) a value of 10 MB/s instead of the expected 0.After some more digging, I did the rest call for the
TL-SG2008
to get the port status. and as you can see the json shows for port 5 alinkStatus
of0
, while the query shows a speed of 10 MB/s.switch
TL-SG2008
:Compared to a disconnected port on the
TL-SG3428 v2.0
The difference is that the
TL-SG2008
reports linkSpeed = 1, whileTL-SG3428 v2.0
reports linkSpeed = 0 for ports that are not connected. I am not sure why theTL-SG2008
reports linkSpeed = 1, while there is no connection.In the omada exporter source code, I found these line https://github.com/charlie-haley/omada_exporter/blob/89772bc1aef9f5e3e1720f7242fbd7958a661fe7/pkg/omada/handler.go#L74-L85
And they might be changed to the snippet below, so that in all cases where the LinkStatus is 0 or the LinkSpeed is 0, the returned linkSpeed is 0:
Hope this helps.
Regards, Raymond