MassimilianoPasquini97 / zbx_unifi_network

Zabbix Template for Unifi Network
MIT License
29 stars 7 forks source link

U-LTE-PRO Identified as a WiFi Access Point #9

Open Isilorn opened 8 months ago

Isilorn commented 8 months ago

I recently added a U-LTE-PRO to my network setup, but it is being recognized as a WiFi access point. This is causing errors such as "wifi0 state is not RUN". I'm concerned that this misidentification might lead to missing some critical alerts (like switching to backup connection, loss of signal, etc.).

Here are the types of information being reported in Zabbix for the U-LTE-PRO:

UAP Adopted: true
UAP CPU Usage %: 9.2%
UAP Inform IP: [IP address]
UAP Inform URL: [URL]
UAP IP: U-LTE-Pro
UAP Kernel Version: 4.4.153
UAP Last Seen: 10/11/2023 09:41
UAP MAC Address: [MAC address]
UAP Management Network: Default
UAP Memory Usage %: 57.4%
UAP Model: ULTEPEU
UAP Serial: [Serial Number]
UAP SOC Architecture: MIPS
UAP State: 1
UAP Total RX Byte: 7.49 MB
UAP Total TX Byte: 7.48 MB
UAP Upgradable: false
UAP Uplink Device: UDM SE
UAP Uplink Port: 1
UAP Uplink Speed: 1 Gbps
UAP Uplink Type: Wire
UAP Uptime: 10h 43m 3s
UAP Version: 6.6.38.15101
wifi0 Channel: [Data Missing]
wifi0 Gain: 0 dB
wifi0 HT: 20
wifi0 Radio: ng
wifi0 State: INIT
wifi0 TX Packets: [Data Missing]
wifi0 TX Power: [Data Missing]
wifi0 TX Power Mode: [Data Missing]
wifi0 TX Retries: [Data Missing]

And this is what's displayed on the UDM-SE interface for the device:

MAC Address: [MAC address]
Uptime: 10h 50m 7s
Memory Usage: 57.4%
Load Average: 0.21 / 0.15 / 0.16
External Antenna: Disabled
PoE Passthrough: Disabled
UniFi LTE IP: [IP Address]
APN: Free
PDP Type: IPV4
Connected: Yes
Band: WCDMA-900
Cell: [Cell ID]
Data Transmitted: 7.48 MB
Data Received: 7.49 MB
Network Operator: Free
RAT: WCDMA
Status: Ready
Signal Strength: Very strong (5)
IMEI: [IMEI Number]
ICCID: [ICCID Number]
MassimilianoPasquini97 commented 7 months ago

Hi @Isilorn, probably on Unifi API U-LTE-PRO is categorised as UAP so is treated as that by the template. Unfortunately I don't have a U-LTE-PRO for tasting and Unifi API it lacks of documentations. The only way I can add this device is if you can give me the JSON response of the Unifi API for U-LTE-PRO.

Isilorn commented 7 months ago

Hello @MassimilianoPasquini97 with pleasure, I'll need some guidance to interrogate the Unifi API 😄

I'm using MacOS and Linux so shell script or command line will be fine

MassimilianoPasquini97 commented 7 months ago

@Isilorn Follow this steps:

  1. Create a file named auth.json containing Unifi credential. Replace {$UNIFI.USERNAME} and {$UNIFI.PASSWORD} with your credential. User must be a local user and is preferred to not use the same used by Zabbix.
{
    "username": "{$UNIFI.USERNAME}",
    "password": "{$UNIFI.PASSWORD}"
}
  1. Get authentication cookie with the following command. Replace {$UNIFI.IP} and '/api/auth/login' with 'api/login' if you are using Unifi vm instead of Dream Machine.
curl -k -X POST -d @auth.json -c cookie --header 'Content-Type: application/json' https://{$UNIFI.IP}/api/auth/login
  1. Get U-LTE-PRO data with the following command. Replace {$UNIFI.IP}, {$UNIFI.UAP.MAC} with U-LTE-PRO macaddress with following format "AA:AA:AA:AA:AA:AA" and remove '/proxy/network' if you are using Unifi vm instead of Dream Machine.
curl -k -X GET -b cookie --header 'Content-Type: application/json' https://{$UNIFI.IP}/proxy/network/api/s/default/stat/device/{$UNIFI.UAP.MAC}
  1. Send me in DM the output of the last command. ATTENTION, DO NOT POST THE CONTENT IN PUBLIC, IT CAN CONTAIN SENSITIVE INFORMATION.
Isilorn commented 7 months ago

The data is ready (and I've taken a look at the formatted version with jq), but I apologize for this potentially silly question... Where would you like me to send you a DM? I can't do it here on GitHub, and it seems disabled on Twitter 😊

MassimilianoPasquini97 commented 7 months ago

I have enabled DM on X now, you can reach me there.