omada_exporter icon indicating copy to clipboard operation
omada_exporter copied to clipboard

Only a few metrics exported for Omada ER7412-M2 gateway

Open gmoscalu opened this issue 1 year ago • 4 comments
trafficstars

Hello,

First of all a big thank you for this exporter!

I noticed that while it seems to pull out interesting data for my EAP225 Access points (EAP225, EAP225-WALL and EAP225-OUTDOOR), for my TL-SG2428P and TL-SG2210P switches, when it comes to my brand new router, ER7412-M2, i only get a few infos:

$ grep ER7412 metrics.txt
omada_device_cpu_percentage{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 1
omada_device_download{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 2.9249723703e+10
omada_device_mem_percentage{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 22
omada_device_need_upgrade{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 0
omada_device_upload{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 4.194277945e+09
omada_device_uptime_seconds{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 28386

Versions:

  • Omada SDN V Version = 5.14.26.1 (SW controller, running as a service in a Debian 12 VM in Synology NAS)
  • omada_exporter = 0.13.1 (running as docker)

Device firmware versions:

  • ER7412-M2 = 1.0.1 <= NOK - no port info, no WAN info
  • TL-SG2210P v3 = 3.20.10 <= OK
  • SG2428P v5 = 5.20.2 <= OK
  • EAP225(EU) v3.0 = 5.1.6 <= OK
  • EAP235-Wall(EU) v1.0 = 3.2.2 <= almost OK, missing device ETH ports infos
  • EAP225-Outdoor(EU) v1.0 = 5.1.6 <= OK

Is there anything i can help with to fix the following issues:

  • there is no omada_port_link_rx / omada_port_link_tx / omada_port_link_status / omada_port_link_speed_mbps for ER7412-M2
  • no info for WAN connections/statuses/etc for ER7412-M2
  • no info for VPN connections/statuses/etc for ER7412-M2
  • there are no omada_client_tx_rate / omada_client_rx_rate for clients that are connected directly to switches or the gateway (only for those coneted to APs)
  • likewise, there is no omada_client_traffic_down_bytes / omada_client_traffic_up_bytes except for those connected to APs (issue #104 )

Thanks, Gabriel

gmoscalu avatar Oct 14 '24 15:10 gmoscalu

hi @unfixa1

here's what the gw shows:

image image image image image image

i just downloaded the latest docker yesterday and i posted what it returned for M7412-M2. if needed, i can provide the full output from browser.

gmoscalu avatar Oct 15 '24 06:10 gmoscalu

Adding JSON response sample for the gateway: ER7412_api_samples_public.json

My setups is the following:

  • ISP1 (called "RDS") connected on port 3, using PPPoE though their FTTH gateway
  • ISP2 (Vodafone/VDF) connected on port 4, using DHCP behind their FTTH gateway
  • LAN switch TP-SG2428P connected on port 10
  • LAN IP address of the gateway is 10.10.200.1

Comparing the JSON with GUI, i notice (for port 3, my main ISP):

  • result.portstats[3].internetState = 1 when connected and 0 when disconnected
  • result.portstats[3].rx = downloaded bytes from Internet through this ink
  • result.portstats[3].rxRate = downloaded bytes speed at the time of sampling, from Internet through this ink
  • result.portstats[3].tx = uploaded bytes to Internet through this ink
  • result.portstats[3].txRate = uploaded bytes speed at the time of sampling, to Internet through this ink
  • similar for rxPkt / rxPktRate / txPkt / txPktRate (but packets, not bytes)
  • result.portstats[3].status = 1 when cable is connected and 0 when disconnected
  • result.portstats[3].latency = detected ISP latency value
  • result.portstats[3].loss = detected ISP packet loss rate value (%)

In my setup, i can get the WAN ports by querying:

${OMADA_HOST}/${CONTROLLER_ID}/api/v2/sites/${SITE_ID}/setting/wanlanstatus

and the response includes the list of WAN ports in the result.wanlist structure:

{
	"errorCode": 0,
	"msg": "Success.",
	"result": {
		"portName": {
			"11_af4cf28326b1434b8931a5c9f5bf5a0c": "SFP WAN/LAN11",
			"2_24263b08f55a406a99cb3b6b62160fbb": "2.5G WAN/LAN2",
			"5_baf15e001ee44b92aa589f4a917e067b": "WAN/LAN5",
			"6_f345afdc25e64c568a5bca002f81bf1f": "WAN/LAN6",
			"1_9838d139e7da4600a1bb089058a3c87e": "2.5G WAN/LAN1",
			"10_9357f54a036c4af8a7cfa3c27f44ae71": "WAN/LAN10",
			"9_e4709ef3266a40d98cc3669aed5540b3": "WAN/LAN9",
			"7_84d675cd3c284eb2a4f225ed13e71896": "WAN/LAN7",
			"8_c49524e5c4b14915994db576500da93c": "WAN/LAN8",
			"12_bb45d53320bd4813a478c32553c7f579": "SFP WAN/LAN12"
		},
		"networkComptent": 1,
		"adoptedGateway": true,
		"supportIpv6": 1,
		"wanList": [
			{
				"portUuid": "3_3908645569e64bdbae10b08da65b4840",
				"portName": "WAN/LAN3",
				"enable": 1,
				"proto": "pppoe",
				"pdEnable": 1,
				"prefix": "2a02:2f04:125:d300::/64",
				"pdSize": 64,
				"type": 1
			},
			{
				"portUuid": "4_489318901fda4fd496cba28ab6715f6c",
				"portName": "WAN/LAN4",
				"enable": 1,
				"proto": "bridge",
				"prefix": "",
				"type": 1
			}
		],
		"iptvPorts": [],
		"osgAddInAdvance": false,
		"wirelessRouter": false
	}
}

I hope this helps.

I would try to add the corresponding code in a PR, but i am not capable to code in GOLANG.

gmoscalu avatar Oct 23 '24 10:10 gmoscalu

So, to help, even if I am not a GO developper, but i am able to understand code, adjust & adapt to my needs, i propose the following files attached here (i do not know how i can contribute to this project in a different manner):

  • Fix missing ETH ports for the EAP Model == "EAP235-Wall(EU) v1.0": pkg\api\device.go
    device.zip

gmoscalu avatar Oct 30 '24 15:10 gmoscalu

Finalizing the work on the site gateway part (2 more metrics to implement), will upload the gateway and its collectors too.

So far, i added:

  • omada_gateway_download = Device download traffic. [Similar to device counter]
  • omada_gateway_isp_global_bandwidth = Site's GLOBAL ISP bandwidth. [sum of ISP bandwidths]
  • omada_gateway_isp_global_usage = Site's GLOBAL ISP bandwidth usage (perc 0-100).
  • omada_gateway_isp_port_internet_state = Site's ISP link Internet state (1= Connected, 0=Disconnected). One metric line per ISP link
  • omada_gateway_isp_port_rx_rate = Site's ISP link RX rate (byte/s). One metric line per ISP link
  • omada_gateway_isp_port_tx_rate = Site's ISP link TX rate (byte/s). One metric line per ISP link
  • omada_gateway_isp_port_rx_usage = Site's ISP link RX bandwidth usage (perc 0-100). One metric line per ISP link
  • omada_gateway_isp_port_tx_usage = Site's ISP link TX bandwidth usage (perc 0-100). One metric line per ISP link
  • omada_gateway_vpns = Defined VPNs. Counter of IPSec VPN tunnels defined
  • omada_gateway_vpns_online = Active IPSec tunnels.

Still want to do:

  • Most active applications by name (top5)
  • Most active applications by type (top5)
  • LAN downlink and non-ISP ports stats - similar to ports info: omada_port_link_status, omada_port_link_speed_mbps, omada_port_link_rx, omada_port_link_tx but the data is pulled from {{SITEID}}/gateways/{{GWMAC}}
  • Info on the fact that controller is : hardware/software/cloud
  • Maybe split the VPN infos by IN/OUT for the omada_gateway_vpns & omada_gateway_vpns_online

Example:

# HELP omada_gateway_cpu_percentage Percentage of device CPU used.
# TYPE omada_gateway_cpu_percentage gauge
omada_gateway_cpu_percentage{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 1
# HELP omada_gateway_download Device download traffic.
# TYPE omada_gateway_download counter
omada_gateway_download{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 3.63308195257e+11
# HELP omada_gateway_isp_global_bandwidth Site's GLOBAL ISP bandwidth.
# TYPE omada_gateway_isp_global_bandwidth gauge
omada_gateway_isp_global_bandwidth{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 1500
# HELP omada_gateway_isp_global_usage Site's GLOBAL ISP bandwidth usage (perc 0-100).
# TYPE omada_gateway_isp_global_usage gauge
omada_gateway_isp_global_usage{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 0
# HELP omada_gateway_isp_port_internet_state Site's ISP link Internet state (1= Connected, 0=Disconnected).
# TYPE omada_gateway_isp_port_internet_state gauge
omada_gateway_isp_port_internet_state{GW_Port_Desc="RDS Uplink",GW_Port_Name="WAN/LAN3",GW_Port_Number="3",ISP_ID="1",device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 1
omada_gateway_isp_port_internet_state{GW_Port_Desc="VDF Uplink",GW_Port_Name="WAN/LAN4",GW_Port_Number="4",ISP_ID="2",device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 1
# HELP omada_gateway_isp_port_rx_rate Site's ISP link RX rate (byte/s).
# TYPE omada_gateway_isp_port_rx_rate gauge
omada_gateway_isp_port_rx_rate{GW_Port_Desc="RDS Uplink",GW_Port_Name="WAN/LAN3",GW_Port_Number="3",ISP_ID="1",device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 0
omada_gateway_isp_port_rx_rate{GW_Port_Desc="VDF Uplink",GW_Port_Name="WAN/LAN4",GW_Port_Number="4",ISP_ID="2",device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 0
# HELP omada_gateway_isp_port_rx_usage Site's ISP link RX bandwidth usage (perc 0-100).
# TYPE omada_gateway_isp_port_rx_usage gauge
omada_gateway_isp_port_rx_usage{GW_Port_Desc="RDS Uplink",GW_Port_Name="WAN/LAN3",GW_Port_Number="3",ISP_ID="1",device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 0
omada_gateway_isp_port_rx_usage{GW_Port_Desc="VDF Uplink",GW_Port_Name="WAN/LAN4",GW_Port_Number="4",ISP_ID="2",device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 0
# HELP omada_gateway_isp_port_tx_rate Site's ISP link TX rate (byte/s).
# TYPE omada_gateway_isp_port_tx_rate gauge
omada_gateway_isp_port_tx_rate{GW_Port_Desc="RDS Uplink",GW_Port_Name="WAN/LAN3",GW_Port_Number="3",ISP_ID="1",device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 0
omada_gateway_isp_port_tx_rate{GW_Port_Desc="VDF Uplink",GW_Port_Name="WAN/LAN4",GW_Port_Number="4",ISP_ID="2",device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 0
# HELP omada_gateway_isp_port_tx_usage Site's ISP link TX bandwidth usage (perc 0-100).
# TYPE omada_gateway_isp_port_tx_usage gauge
omada_gateway_isp_port_tx_usage{GW_Port_Desc="RDS Uplink",GW_Port_Name="WAN/LAN3",GW_Port_Number="3",ISP_ID="1",device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 0
omada_gateway_isp_port_tx_usage{GW_Port_Desc="VDF Uplink",GW_Port_Name="WAN/LAN4",GW_Port_Number="4",ISP_ID="2",device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 0
# HELP omada_gateway_mem_percentage Percentage of device Memory used.
# TYPE omada_gateway_mem_percentage gauge
omada_gateway_mem_percentage{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 23
# HELP omada_gateway_need_upgrade A boolean on whether the device needs an upgrade.
# TYPE omada_gateway_need_upgrade gauge
omada_gateway_need_upgrade{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 0
# HELP omada_gateway_upload Device upload traffic.
# TYPE omada_gateway_upload counter
omada_gateway_upload{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 8.7849442718e+10
# HELP omada_gateway_uptime_seconds Uptime of the device.
# TYPE omada_gateway_uptime_seconds gauge
omada_gateway_uptime_seconds{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 717028
# HELP omada_gateway_vpns Defined VPNs.
# TYPE omada_gateway_vpns counter
omada_gateway_vpns{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 2
# HELP omada_gateway_vpns_online Active IPSec tunnels.
# TYPE omada_gateway_vpns_online counter
omada_gateway_vpns_online{device="ER7412-M2",device_type="gateway",ip="10.10.200.1",mac="40-AE-30-B3-5B-42",model="ER7412-M2",site="Vila",site_id="670783f2a7b8ad5249e1e202",version="1.0.1"} 2

gmoscalu avatar Oct 30 '24 15:10 gmoscalu

Any update on this @gmoscalu? I also own a omada gateway, would you like to hop on discord so we can explore this?

rodrigogonegit avatar Sep 19 '25 22:09 rodrigogonegit