modified on 20 November 2010 at 13:40 ••• 23,137 views

UBooT

From Ubiquiti Wiki

Jump to: navigation, search

Author: Sigmund Shapiro, created October 16, 2009

Contents

What is UBooT?

UBoot is a Java based application that provides the ability to reboot your UBNT devices on a periodic basis. Before downloading, please review the application details below. If you feel utilization of this program will help your system run smoother, simply click on the link at the bottom of the page to download the Windows based installer.

Notes...

  • This is a totally free application.
  • I will gladly entertain suggestions for modifying it and will gladly fix any "bugs" found.
  • You will need Java JRE 1.4 or greater installed on the system you run the application on.
  • You need to enable SSH on each UBNT device you wish to periodically reboot.
  • The installer lays down a jar file (UBooT.jar). I have taken this jar and run it on both UNIX and LINUX without issues but for these platforms, your on your own.
  • Submit suggestions and report issues to uboot@rdasol.com

Why use UBooT?

First, a periodic reboot seems to keep my system running smoother. Not only do I use it to reboot my CPEs but APs as well. Software inherently chews up memory. This can be especially true with devices that do memory intensive operations. These units perform nothing but "in memory" operations. Also, these devices are somewhat memory constraint so any memory that is not properly "freed" will equate to system slowdown.

I know many either...

  • Use the ping watchdog to perform a reboot if the CPE cannot reach the AP or whatever corresponds to the IP you have designated.
    • What I have found is this rarely happens unless you have a catastrophic failure. Also, I have found that if an AP (at least using B2HP as an AP) is not rebooted occasionally, you suddenly loose the ability to bring up any CPE's GUI on that AP. Cannot even SSH into it. Lots of folks don't realize this is happening but I have another application that monitors each CPE by doing a simple ping on a periodic basis. If a certain number of pings are missed in a configurable period of time, the application sends me an email indicating a possible problem. If I don't reboot the AP's at least once a week, I get bombarded with these false failure emails. I originally thought it was the CPE units but is actually something about the AP's firmware (I think). This other application also logs when my backbone is unavailable. I can then call Deltacom and grip about it (got to get your laughs some way right).
  • Log into the unit and reboot via the UI or even SSH'ing and typing "reboot" to get similar results.
    • However, if you have hundreds of units deployed, this would be time consuming to say the least.

Also, I wanted to perform this periodic reboot when my system has the least number of active users online. This application lets me select an extremely late night or early morning reboot. It also lets me "stagger" the units reboot so that no two units are in the reboot state at one time. Each individual unit is "time configurable".

Lastly, ANYTHING I can do to automate maintenance is time I don't have to spend "dinkin" around with the stuff. Myself and others have put in feature requests for this type of functionality in the past but to be honest, I like this option better since I can change EVERYTHING from one location without logging into each unit. However, I do realize this is subjective and only offer this application based solely on my past experience and correlating opinions.

Application Details

Installation

After downloading and double clicking on the install_UBooT_v11.exe, you will be presented with the screen as depicted to the right. As you proceed through the installation, you will be presented with various options such as:

Installation Directory
Create Desktop Shortcut
Create Quick Launch Shortcut

Upon successful installation, click Finish to complete

Image:setup.jpg

Startup

Once UBooT has been successfully installed, the first time this application is started you will be presented with the following prompts:

You must click OK to continue. It can be noted that hand modification of this configuration file can be performed in defining a different “default” database. This explained in detail below.

Image:defaults.jpg

By selecting Yes, a default database will be created in the following directory structure along with the default configuration file:

Image:directorystructure.jpg

Notice the database naming convention, “default.db”. This is important since once created, two tasks are performed that cannot be changed by the user without navigating to the proper directory and physically deleting this “default.db”. If deleted, you will be presented with the original option to create this default database, identical to first running the application.

  • First, upon startup of UBooT, this database will be read and used by default. This feature allows users to create a database of UBNT units and optionally, drop a shortcut in the startup menu in the event of a system crash or reboot (of the PC, not the UBNT unit).
  • Next, upon creation, UBooT will periodically save this “default.db” to disc as it is currently populated. This “save” occurs every 5 seconds (by default and can be changed via the configuration file, “default.cfg”). Please note, the configuration file values are in milliseconds. Also, if you change the value to "0" nothing is periodically saved.

Also of interest is the creation of a log directory. If for any unforeseen reason, errors occur in this application, they will be saved in an appropriate log file in this directory. They can then be submitted to the email address indicated above. The contents of this log file will be elaborated below.

Menu Options

When the File menu option is selected, the user can select one of the following

New Database

This option is only available if no default database has been created or the user has initially started UBooT and selected not to create a default database.

Save Current Database

This option allows the user to save the current database to disc. The user can give the file any name desired via the provided dialog prompts. There are no restrictions.

Open Saved Database

This option allows the user to load another database which has previously been saved.

Exit

Exits the UBooT application after a confirmation prompt

Image:filemenu.jpg

When the View menu option is selected, the available options are as follows

Show All

Selection of this option will expand the entire tree structure. This allows the user to view all fields and their correlating values.

Expand One Level

Selecting this option will display the tree data from an informational perspective. The Reboot Time and SSH information will remain collapsed.

Hide All

This option will hide all fields with the exception of the initial “Unit Information” entries

Image:viewmenu.jpg

When the “Action” menu option is selected, the available options are as follows

Modify Entry

This option allows the user to edit any editable field. Fields that may not be edited are elaborated in the next section.

New Entry

This option allows the user to create a new “Unit Information” entry only. Before this option is available, the user must select the specific unit information that they desire to create a new entry afterwards.

Delete Entry

This option allows the user to delete a “Unit Information” entry only. Before this option is available, the user must select the specific unit information that they desire to be deleted.

Force Reboot

This option allows an immediate forced reboot of any specified IP address under a unit information entry. Before this option is available, the user must select the specific IP address which is to be rebooted.

Image:actionmenu.jpg

Available Fields

Once the initial default database, an initial or additional entry is created, the user will be presented with something similar to the depiction to the right. Note... to edit any “editable” field either

  • Left click the mouse button to select the field then right click to bring up the edit prompt.
  • Left click the mouse button to select the field then select “Action”, “Modify Entry” to bring up the edit prompt.


Unit Information

This is the parent associated with the specific UBNT unit and all other information is a child of this entry. This entry is not editable. If selected, the available menu options under the “Action” menu are “New Entry” and “Delete Entry” which have been explained in the previous section.

IP Address

When a new entry is created, this field will represent the default loopback (127.0.0.1). When modifying this field, a valid IP address must be provided or an error will occur (Error dialog will appear and a log file entry generated). During execution, UBooT will ignore any default entries as possible candidates for rebooting.

SSH Information

This is simply a placeholder for the subsequent SSH information needed to access the UBNT unit. Nothing can be changed with regard to this field.

SSH User Name

This field should contain the actual user name used to access the UBNT unit.

SSH Password

This field should contain the actual password, associated with the previously declared user for accessing the UBNT unit. Once entered, the field value will appear to contain only asterisks.

SSH Port Number

This field represents the SSH port that has been configured on the UBNT device to accept a SSH client connection. This can be manipulated to "drill through" repeaters.

Reboot Time

This is simply a placeholder for subsequent reboot timing information of the specific UBNT unit. Nothing can be changed with regard to this field.

Hour

This field represents the hour of desired reboot. Options that are presented are 1 .. 12.

Minute

This field represents the minute within the previously declared hour of reboot. Options are 0 .. 59.

Time Of Day

This field represents the 12 hour day interval to perform reboot. Options are “AM, PM”.

How Often

This field represents how often to perform the desired reboot on the UBNT unit. Options are “24 Hour, 48 Hours, 72 Hours, Weekly, Monthly”

Last Attempted Reboot

This field represents the last attempted reboot time and date. This field is not editable. It is presented to give the user information regarding the last reboot attempt.

Last Reboot Successful

This field indicates the return status of the last attempted reboot. It is a simple true or false and is not editable.

Next Scheduled Reboot

This field represents the next scheduled reboot time and date as reflected in the “Reboot Time” group. If the user updates information in those fields, the new scheduled time will be reflected in this field. This field is not editable and is also, for informational purposes only.

Image:availablefields.jpg

One last item of interest. Once the IP address of the UBNT unit has been entered, is valid and "pingable", the user will be presented with the option of immediately performing the initial reboot. It is defaulted to "No" after a 30 second delay. Choosing "Yes" will immediately attempt the reboot.

Image:initialreboot.jpg

Configuration File

The configuration file associated with UBooT is a simple Java properties file. The available parameters are as follows

interval

This indicates the periodicity that the application will save the current database to disc. It is represented in milliseconds so 5000 = 5 seconds. As stated previously, setting this value to "0" will tell UBooT to never automatically save the database.

defaultDatabase

This simply represents the path and file name associated with the database that the application should read at startup.

readDefaultDbAtStartup

This tells UBoot whether to load the database previously declared to load at startup.

If for some reason you corrupt this file, simply delete it and restart the application. It will create a new, valid one for you.

Image:configfile.jpg

Logging Errors

The two most common errors that will be encountered will be

timed out

This is an indication that the IP address you have indicated does not exist or is not reachable at the scheduled time of reboot.

connection refused

This indicates that the input SSH information is incorrect for that particular unit

Unit Database

For those familiar with such, the actual database as stored to disc is a simple serialized JTree (Java Tree structure). It will appear unreadable if tried to view using anything but the application that created it or the classes which define it's structure. Also note that any attempt to hand modify the database or even in some obscure cases, viewing it in something like Notepad, can corrupt the database to an unrecoverable state. You have been warned

Versions

v1.0

  • Initial release

v1.1

  • Requested features
    • Additional view option (expand one level)
    • Prompt user before initial entry reboot (can choose not to perform the initial reboot and will timeout to "No" in 30 seconds and the prompt will be removed)
  • Removal of the compiled help file and replaced with a link to this WIKI page (easier for me to maintain)

To install this release if you already have installed the initial release of UBooT, simply run the uninstaller provided with the original installation. This uninstaller does not delete your database, configuration files or log files. Once uninstalled, simply download the new version and install UBooT 1.1. Once started, it will recognize your previously populated database and load it accordingly. No database changes were made with this release so they are interchangeable.

v1.2

  • Bug fixes
    • Termination of main "reboot" thread whenever an IP is not reachable
    • Proper updating of "Next Scheduled Reboot"

v1.3

  • Requested features
    • Database status indicator added
    • Reboot status indicator added

Download

I hope you have found this information useful and the application provides you some utility should you decide to use it. I would also entertain providing the Java source of this application so one can be assured it contains no malicious intent.

Enjoy...

(v1.3) Download UBooT

Retrieved from "http://wiki.ubnt.com/UBooT"