Open gmoscalu opened 1 month ago
hi @unfixa1
here's what the gw shows:
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.
Adding JSON response sample for the gateway: ER7412_api_samples_public.json
My setups is the following:
Comparing the JSON with GUI, i notice (for port 3, my main ISP):
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.
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):
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:
Still want to do:
{{SITEID}}/gateways/{{GWMAC}}
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
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:
Versions:
Device firmware versions:
Is there anything i can help with to fix the following issues:
omada_port_link_rx
/omada_port_link_tx
/omada_port_link_status
/omada_port_link_speed_mbps
for ER7412-M2omada_client_tx_rate
/omada_client_rx_rate
for clients that are connected directly to switches or the gateway (only for those coneted to APs)omada_client_traffic_down_bytes
/omada_client_traffic_up_bytes
except for those connected to APs (issue #104 )Thanks, Gabriel