Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@richb-hanover
Last active October 22, 2023 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richb-hanover/7e8b12d78c3de800afb1475789ac5595 to your computer and use it in GitHub Desktop.
Save richb-hanover/7e8b12d78c3de800afb1475789ac5595 to your computer and use it in GitHub Desktop.

Installing YAMon on OpenWrt

The following steps will install the YAMon (Yet Another MONitor) software on your OpenWrt router. This procedure requires use of an SSH connection to your router.

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

  1. 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.

  2. 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 /mnt/sda1 to /opt

    -or-

    b. Enter this command into the SSH session: mount -t ext4 /dev/sda1 /opt

  3. Finally, reboot the router. Ensure that the USB device (at /dev/sda1) is mounted at /opt To 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:

  1. 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
    
  2. 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
    
  3. 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:~#
    
  4. Reboot the router for good measure, to see if YAMon starts up as expected.

Using YAMon

  1. 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.)

  2. If everything works as expected, you should see the YAMon GUI. Follow the YAMon guide for further tips.

  3. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment