Installing YAMon on OpenWrt
Note: The procedure below has been tested with OpenWrt 19.07.
Prepare a USB drive for the router
You need external storage (for example, a USB memory stick) to hold the data collected by YAMon.
- Format a USB drive as FAT32 on your laptop/desktop computer. It should be at least 1 GBytes. IT WILL BE ERASED. (Note: the procedure below will format the drive again, but this step provides a quick check of the drive, and puts it into a known state.)
- Update your router to work with USB drives. See the OpenWrt USB Drive pages - Quick Start for Adding a USB Drive and Using Storage Devices for more information.
- Insert the USB drive into one of the router's USB ports.
Install the proper packages on the router and set up the USB drive
If you haven't already done so, follow the Quick Start for Adding a USB Drive on the OpenWrt site. That page provides correct and continually-updated instructions. Follow those steps, then come back here.
The instructions on the OpenWrt page leave the USB device mounted at
/mnt/sda1. YAMon requires that it be mounted at
/opt. To mount the USB device at
/opt, use either a) or b) below:
a. Go to the System → Mount Points menu in the web GUI. Click Edit in the Mount Point and change
b. Enter this command into the SSH session:
mount -t ext4 /dev/sda1 /opt
Finally, reboot the router. Ensure that the USB device (at
/dev/sda1) is mounted at
/optTo do this, enter
df -h. The output should look something like this:
# df -h Filesystem Size Used Available Use% Mounted on ... /dev/sda1 14.0G 40.0M 13.3G 0% /opt
The USB drive is now prepared to install YAMon.
Retrieve and run the YAMon installation script
Download the YAMon installation script from the usage-monitoring.com site, then run it. To do this:
SSH into the OpenWrt router and download the YAMon script. To do this, enter one the following commands (depending on whether you want YAMon4 or YAMon3):
# Use ONE of the two following lines to retrieve the installer file wget 'http://usage-monitoring.com/current/YAMon4/Setup/install.sh' -qO /opt/install.sh -or- wget 'http://usage-monitoring.com/current/YAMon3/Setup/install.sh' -qO /opt/install.sh
Make the script executable, and run it:
# cd to the /opt directory and make the script executable cd /opt chmod +x install.sh # Run the installer script sh install.sh
Follow the prompts and the YAMon guide. For a new installation, simply accept all the default suggestions. When it completes, you'll see something like this (Version 4.0.6 is current as of late January 2020):
********************************************************** [Re]starting YAMon4.0.6 ___ ___ __ ___ ___ \\\\ //// //\\ ||||\ /|||| _____ __ ____ \\\\ //// ///\\\ ||||\\//|||| ///|\\\ ||//|\\\ \\\'/// ////\\\\ ||||\\//|||| ////^\\\\ |||/^\||| \\|// //// \\\\ |||| \/ |||| ||| ||| ||| ||| //// //////\\\\\\ |||| |||| \\\\.//// ||| ||| //// //// \\\\|||| |||| \\\|/// ||| ||| Yet Another Monitor (v: 4.0.6) Copyright (c) 2013-present Al Caughey All rights reserved. https://usage-monitoring.com root@Main-Router:~#
Reboot the router for good measure, to see if YAMon starts up as expected.
The YAMon GUI should be available at this URL: http://192.168.1.1/yamon (replace 192.168.1.1 in the URL with your router's address.)
If everything works as expected, you should see the YAMon GUI. Follow the YAMon guide for further tips.
If you see a message "The requested URL /yamon was not found on this server", then see the potential fix at https://forum.openwrt.org/t/yamon-v4-update-almost-ready-for-beta-testing/45233/5