This is a project that started mainly to find WAN failover configurations on Omada gateway devices.
- Elixir 79.2%
- HTML 14.3%
- CSS 3.6%
- JavaScript 2.9%
| assets | ||
| config | ||
| lib | ||
| priv | ||
| test | ||
| .formatter.exs | ||
| .gitignore | ||
| docker-compose.yml | ||
| mix.exs | ||
| mix.lock | ||
| README.md | ||
OmadaInspector
How to Run
-
Ensure that Erlang and Elixir are installed.
asdfis a perfect tool for accomplishing this. -
Ensure that Postgres is installed and running. This is necessary for Oban to work. Use the provided docker compose to run it.
-
Ensure you have an
.envfile configured for your Omada controller, please use the following.envtemplate
export OMADA_CLOUD_ID="omada-cloud-id"
export OMADA_CLIENT_ID="client-id"
export OMADA_CLIENT_SECRET="client-secret"
export OMADA_CONTROLLER_URL="mycontroller.mywebsite.com:8043"
-
Run
mix setupto install and setup dependencies -
Start application with
iex -S mix phx.server -
Issue the following commands to run a report,
# Run this command to populate the SitesServer with Omada sites
OmadaInspector.hydrate_sites_server()
# Run this command to enqueue background workers to get devices from Omada sites
# This takes a while, so please wait for it to finish to get a full report of WAN devices
# This can be monitored by watching `available` status oban jobs in `adminer`
# When the available jobs are 0, proceed to the next command
OmadaInspector.queue_get_devices()
# Run this command to enqueue background workers to get WAN details from Omada devices
# Just like the above command, please watch the available jobs to tick down to 0
# When no more available jobs are running, feel free to proceed to the next command
OmadaInspector.queue_get_wans()
# Produces report on Omada devices with 2 WAN ports configured
OmadaInspector.get_double_wans()
# Produces report on Omada devices with 0 wan ports configured
# These are most likely disconnected devices or devices in an ISP outage
OmadaInspector.get_zero_wans()