Notice: Undefined offset: 1 in /usr/local/src/wordpress/wp-content/themes/montezuma/includes/parse_php.php on line 79

HowTo: Monitor the Network – Plasmoid

I always like to know what’s going on with my individual systems (especially air-gapped LANs), so if it hangs I have a good idea why.   And I especially like to know when lots of data is going out of my systems.   So we are going to make a handy little plasmoid which does this very effectively, and will run on KDE, XFCE, LXDE, etc, and given its cmake origin will probably build and run on OS-X and Windows as well.

knet1Here’s what it looks like. (click to enlarge)   It sits in your System Tray, and monitors the outward network interface.   Green traffic (bottom) is incoming, and red traffic (top) is outgoing.   You can set the scale to just about anything, but I’ll give a reasonable default below.

I call it knet, and here’s the source.   Just dearchive this into /usr/local/src (where user-compiled source code for the local machine belongs, under Posix), and:
# apt-get install kdebase-workspace-dev kdelibs
# cd /usr/local/src

When cmaking you should always build in a directory other than the source:
# mkdir knetbuild
# cd knetbuild
# cmake ../knet

If you get:
— Found Qt4: /usr/bin/qmake (found version “4.8.6”)
CMake Error at /usr/share/cmake-3.0/Modules/FindKDE4.cmake:111 (message):
ERROR: cmake/modules/FindKDE4Internal.cmake not found in
/root/.kde/share/apps;/usr/share/kde4/apps

… then just delete /usr/local/src/knet/CMakeCache.txt and do cmake again.

# make
# make install

Now it will show up in Menu|Internet next time you log out/in.

Edit /home/{USER}/.kde/share/config/knetrc and put in it:

# knet needs libkfile.so.4 (kdelibs), 

[Colors]
CurrentPalette=

#[Common]
#configFile=/home/{USER}/.kde/share/config/knetrc

[Diagram]
device=eth0
graphPosition=0
graphStyle=0
scaling=1000000
scalingMode=0
showGrid=true

[DockFrame]
TextSize=5
bgColor=0,0,0
isVisible=true
showText=false

[General]
colorIn=0,255,0
colorOut=255,0,0
refreshTime=1000
smoothFactor=8
unit=0

[MainFrame]
bgColor=0,0,0
geometry=3,83,300,100
gridColor=160,160,164
#gridColor=128,128,128
isVisible=false
showDecorations=true
showStatsBar=true
showTooltips=true
transparent=false

[StatsFrame]
bgColor=0,0,0
position=0,0

… of course adjusting to your requirements.

Now run knet and enjoy.   Leave it running when you shut down, and assuming you have Save Sessions set, it will start on boot every time.   Unobtrusive, informative.

KNet always displays in kilobits/second, which is the proper measurement with networking, given variations in padding, protocols, etc.

knet2

,'after' => '

') )