These packages require Python 2.7.9 or greater. Make sure you have the latest version of the EdgeRouter software. Installation instructions are on help.ui.com.
You will also need unzip to extract setuptools. Install this by following Add Debian Packages to EdgeOS v2.0.0 and Newer Versions, then run sudo apt-get install zip.
Some of these scripts require pika to be installed on your EdgeRouter, which in turn requires Setuptools to install:
- Install Setuptools v44.0.0 from PyPi.
sudo mkdir -p /usr/local/lib/python2.7/dist-packages ; python bootstrap.py ; sudo python setup.py install
- Install Pika 1.1.0 from PyPi.
sudo python setup.py install
Other scripts are designed to run on a Raspberry PI to monitor network health as a whole. This RPI should be equipped with:
- Python v3 with
pikasudo apt install python3-pika
- A Unicorn Hat HD
- The unicornhathd libraries
sudo apt install python3-unicornhathd).
- Enable SPI
sudo raspi-config- Add the user who will run the queue reader script to the
spigroup viasudo vigr
- Access to a RabbitMQ server:
sudo apt install rabbitmq-serversudo rabbitmq-plugins enable rabbitmq_managementsudo rabbitmqctl add_user <service user from test_interfaces.config.json> <service user password>sudo rabbitmqctl set_permissions -p / <service user> ".*" ".*" ".*"sudo rabbitmqctl add_user <your login user> <new password>sudo rabbitmqctl set_user_tags <your login user> administratorsudo rabbitmqctl set_permissions -p / <your login user> ".*" ".*" ".*"- Rabbit Management console can be accessed via http://:15672/
Image from Ubuntu Linux using rpi-imager. Install using sudo apt install rpi-imager. Further details here.
Find the IP address associated with the given interface. Usage:
get_ip.sh eth?
Script to test WAN uplinks by pinging the configured IP addresses through each configured interface.
Configuration for this script should be stored in test_interfaces.config.json in the same directory.
- For each connection, ping each of the configured IP addresses.
- If two of the three IPs are inaccessible for the given connection, add it to the list of connections which need to be retried.
- Wait 5 seconds, and then retry the failed connections.
- If two of the three IPs are still inaccessible for the given connection, add it to the list of connections which need a notification.
- Send an email notifying the user of which connections are down.
H/T to this Q/A in the UI community forums for the solution.
- Create an application password in your gmail (myaccount.google.com->Security->App passwords)
- Modify
/etc/ssmtp/ssmtp.conf:
root=<gmail address>@gmail.com
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES
AuthUser=<gmail address>
AuthPass=<application password>
FromLineOverride=YES
- Modify
/etc/ssmtp/revaliases:
root:<gmail address>@gmail.com:smtp.gmail.com:587
<login user>:<gmail address>@gmail.com:smtp.gmail.com:587
You should then be able to send an email using the command /usr/sbin/ssmtp <recipients>. Use Ctrl+d to exit and complete the message.