Network Data Usage Monitor
The Network Usage Monitor Applet (NUMA)
The Network Usage Monitor Applet (NUMA) enables one to continuously display the speed and data usage on a selected interface. It is intended to make monitoring of mobile connections by USB Mobile Internet Dongles, through phones by bluetooth and by Mobile Wifi (MiFi) units easy to accomplish. To this end, a maximum data and easily changed Alert level can be set for the current connection. There are also a number of cumulative data monitors to track total usage with offsets and corrections as required. It builds on the Network Speed Monitor Applet project by adreadec.
For the basic facilities the
gir1.2-gtop-2.0library must be installed or the applet will not load and a notification will be displayed. It can be installed by the synaptic package manager or with the terminal command:
sudo apt-get install gir1.2-gtop-2.0
- For full facilities including use of notifications, audible alerts and statistics the
gir1.2-gtop-2.0 vnstat vnstati zenity sox libsox-fmt-mp3libraries must be installed. They can be installed by the synaptic package manager or with the terminal command:
`sudo apt-get install gir1.2-gtop-2.0 vnstat vnstati zenity sox libsox-fmt-mp3
- Cinnamon Version 2.2 or higher ie. It can be used with all supported versions of Mint.
- Version 3.2.4 requires the NMClient and NetworkManager libraries to be in use as was the case in Mint versions up to 18.3 and most other current distro versions at that time.
- The applet will switch to the more recent NM library from the NetworkManager Library under Cinnamon versions up to 3.8.
- Only the new NM libraries can be used when Cinnamon 4.0 or higher is in use to avoid potential segfaults in Cinnamon 4.0. This should support all current Linux Distributions which support Cinnamon 4.0.
- The Applet:
- Continuously displays Upload and Download rate in a fixed width 'steady' display
- The Applet Background color and rounding varies slightly with Cinnamon Version:
- Black or Light Gray with Dark Gray edge when Current Interface not active
- Green or Green edge when Current connection and interface has provided data
- Orange when the Alert level (as percentage of the Data Limit) has been exceeded
- Red when the Data Limit for the current connection has been exceeded
- Hover over Applet:
- Displays continuously updated Upload and Downloaded data usage for the current connection
- The Context Menu (Right Click):
- Displays all the interfaces managed by the Network Manager Applet
- Identifies any Active interfaces within Network Manager
- Allows the selection of the interface to be monitored from those manged by Network Manager.
- Allows the selection of an interfaces not managed by properly by Network Manager and/or interfaces for a connection initiated outside Network manager (ppp0 and bnep0). (bnep0 needs v20_2.6.0 or higher)
- Identifies the interface which has been selected for monitoring.
- Allows updating of the list of Network Manager Interfaces (e.g. after a dongle has been inserted or a bluetooth connection made)
- Enables the Cumulative Usage Monitors to be reset and the date and time of reset displayed.
- Provides links to:
- The NUMA Settings screen.
- The Gnome System Monitor
- Left Click Menu:
- Displays continuously updated Uploaded and Downloaded Data for the Monitored Interface.
- If Alerts are enabled:
- A slider to adjust the Alert level as a percentage of the Data Limit
- A display of the exact Alert level percentage and the Data Limit
- For each Interface where cumulative monitoring is enabled:
- The interface and Cumulative Usage
- A comment (entered in Settings) to remind one of when it was set/reset and the value when set/reset.
- The Settings Screen allows:
- Setting the Update Frequency (1 to 5 seconds)
- The Resolution of displayed upload and downloads (0 to 2 decimal places)
- Change the units for Data Limits and Cumulative Offsets between Mbytes or Gbytes
- Setting an interface to use as Default if no other interface is active at start-up - for Wifi hotspots and Mobile Broadband where the connection is manual.
- Enabling Alerts on the current monitored interface and setting the Data Limit for the current connection on that interface and
- setting the Alert Level as a percentage of the Data Limit by a slider (duplicated in the left click menu as it is frequently used.
- Enabling each of three Cumulative Usage Monitors Setting an offset for each Cumulative Usage Monitors (v20_2.6.0 or higher)
- Switching on a Long Term Statistics Display (Requires vnstat and vnstati to be installed)
- Enabling Actions when the Current Data Usage Limit is exceeded:
- Do nothing other than put up a standard Cinnamon Notification - this displays for 5 seconds or so and ends up in the notification tray - very easy to miss.
- Display a high priority Notification - this displays on to of other windows until you clear it but does not go into the notification tray - still easy to miss from a distance.
- Display a full screen Modal Dialog - this is techie term (look it up on Wikipedia) and the result is the whole screen is blacked out with an information box and button to clear it in the middle and uses the internal capabilities of Cinnamon. It is impossible to miss if you are at or close to the machine.
- Run a shell script which lives in the applet folder and is called alertScript - this can be customised by the user and the example plays a system sound file for 6 seconds (using Sox) , puts up a warning box using Zenity and sends a standard notification so you have a record in the notification tray.
- Suspend the Machine after a brief period during which you can abort. This is also implemented by a script (suspendScript) so the user can fine tune it but the version provided uses Zenity for the warning message which has a 30 second timeout to allow you to abort. Another message is put up before suspending which should be on display when you wake up the machine.
- Disable Networking for all connections managed by the Network Manager. This puts up a warning message and you can abort for a short period by clicking the Applet - not the OK button on the warning screen.
- Set a delay before disabling Network Connections
- Enable a warning sound
- Set the sound file to be played
- Add or hide the Advanced functions from Housekeeping drop down menu
The display width, justification and font details are set using an external Cascading Style Sheet (.css) file which is in the main folder (usually
The settings in this css file govern the width of the Applet and the font. Changes may be required with some themes to avoid the display width being exceeded which leads to jitter with high network speeds and resolutions or to allow a reduced size width to save panel space. The latest version also allow the backgrounds to be configured using this css file to optimize to a particular theme although the defaults work well on most popular themes.
Note: These settings will be overwritten if the applet is reloaded.
The vnstat daemon runs in the background and collects info about your Internet usage all the time the machine is running and maintains a data set from once it is initially activated. It is automatically set up on installation to monitor the network devices/interfaces installed in the machine at the time. It is possible to add additional USB network devices and possibly bluetooth devices to the list of monitored interface
man vnstat in a terminal will give details.
Once vnstat is set up, tThe applet detects which device you're currently using, and exports a graph using vnstati. The latest version allows you to select the type of graph although for most users the default summary will be the most useful.
The author is committed to maintaining and developing the applet. The applet is based on a well tried core from the netspeed applet and has been tested on various systems initially running under Mint 15 with a variety of themes. The current Version has been tested with Cinnamon 2.2 - 4.0 under Mint 17 - 19.1.
Translations and other Contributions
The internal changes required in the applet to allow translations are being implemented but no translations are available at this time. Translations are usually contributed by people fluent in the language and will be very much appreciated. Users please note I am unable to take responsibility for the accuracy of translations!
Although comments and suggestions are always welcome any contributions which are contemplated should follow discussion. Changes can have many unintended consequences and the integrity of the applet is paramount. Unsolicited Pull Requests will never be authorised other than for urgent and critical bug fixes or from the Cinnamon Team.
Thanks are given for the very useful contributions from @collinss and @Odyseus to help harmonise the menus with other applets and @jaszhix for the code selection for the Network manager changes.
- Download from Cinnamon Spices
- Unzip and extract folder netusagemonitor@pdcurtis to ~/.local/share/cinnamon/applets/
- Install the additional programs required.
- Enable the applet in Cinnamon Settings -> Applets
- You can also access the Settings Screen from Cinnamon Settings -> Applets
The author can be contacted via the comments on the Cinnamon Spices Web Site, however that does not automatically notify me so if you want a rapid response please also alert me via the Form at www.pcurtis.com. On github, mentioning @pdcurtis in any conversation will cause it to be emailed to me.
Changelog covering recent significant changes
- Correct code for style .numa-not-connected in applet.js
- Further enhancement in styles to match Cinnamon 4.0
- Change selection of audible warning to use soundfilechooser widget in settings-schema.json for 3.2 and 4.0
- Update stylesheet to better match Cinnamon 4.0 System Styles - less rounded and intrusive.
- Change Multiversion to start with 3.2 folder to allow use of pages and sections in the settings file
- Change Settings to use pages and sections to give a tabbed layout (3.2 and higher).
- Provide options to choose different vnstati formats including a user specified format (3.2 and higher).
- Revert to internal function instead of Use ModalDialog.NotifyDialog (3.0 and lower).
- Update CHANGELOG.md and README.md
- Add multiversion folder
- Use ModalDialog.NotifyDialog instead of internal function in newer version of cinnamon.
- Change location of vnstatImage to home folder rather than applet folder.
- Tidy us some of text in Notifications and trailing spaces
- Changes for Cinnamon 4.0 and higher to avoid segfaults when old Network Manager Library is no longer available by using multiversion with folder 4.0
- Remove Try-Catch as no longer required in 4.0 and associated changes.
- It is believed that all Distributions packaging Cinnamon 4.0 have changed to the new Network Manager Libraries
- Add cinnamon-version to metadata.json (Provides information on which Cinnamon versions can load it)
- Changes to check which network manager libraries are in use and choose which to use - addresses/solves issue #1647 with Fedora versions 27 and higher.
- Note that there may be problems with option of disconnecting the network manager when data usage limit is exceeded so checks are needed under NM before the issue can be marked as closed.
- Use xdg-open in place of gedit or xed to allow use on more distros
- Update README.md
- Change method of inhibiting display of vnstati image when vnstati not installed or enabled in settings by substituting a tiny image instead of use of an extra mainBox.
- Improved notification when vnstat and vnstati not installed
- Better formatting of CHANGELOG.md
- Add check that GTop library is installed using a try and catch(e) technique
- Remove duplicate let declarations occurances missed in 3.2.0 which could give difficulties in Cinnamon 3.4
- Some changes in intialisation to remove CJS warnings
Support new facility on Cinnamon Spices Web Site to display a CHANGELOG.md
- Add CHANGELOG.md to applet folder and use it instead of changelog.txt in right click menu
- CHANGELOG.md based on recent entries to changelog.txt with last changes at the top. changelog.txt currently remains in applet folder but is not used.
- Add symbolic links for README.md and CHANGELOG.md instead of copies from the applet folder to UUID folder for the Cinnamon Web Site to display.
- Improve l10n translation support.
- Harmonise with code writen by author for firstname.lastname@example.org
- Remove duplicate let declarations occurances in common coding for Cinnamon 3.4 thanks to @NikoKraus [#604]
- Additional PopupMenu.PopupMenuSection added as per an easy and elegant suggestion from @collinss and @Odyseus so 'standard' context menu items are retained when the menu is refreshed.
- Version numbering harmonised with other Cinnamon applets and added to metadata.json so it can show in 'About...'
- icon.png copied back into applet folder so it can show in 'About...'
- Add translation support to applet.js
- Identify strings for translation and remove leading and trailing spaces and replace with separate spaces where required.
Transition to new cinnamon-spices-applets repository (January 2107)
- Change from call to firefox to opening README.md on Context submenu to provide help.
Information is available on github.com/pdcurtis/cinnamon-applets but some highlights are:
- First Released on 11-07-2013 for Cinnamon 1.8
- All major development and facilites completed in 2.4.0 (March 2014)
- Support for Android Bluetooth connections added in 2.6.0
- Modifications for Mint 18+ and Cinnamon 3.0+ in 3.0.0
- Support for Gbyte and Tbyte data levels by 3.0.6