Posted on Wednesday, May 28th, 2014 at 10:19 pm
How to monitor a remote Linux system from Windows with GKrellM.
GKrellM is a single process stack of system monitors which supports applying themes to match its appearance to your window manager, Gtk, or any other theme. This guide will explain how to install the gkrellmd (GKrellM Daemon) on a Linux system and how to install the gkrellm client on a Windows system using Bill Nalens' Win32 port of GKrellM.
First things first, you will need to install the GkrellM Daemon on your remote linux box. This can be done in debian very painlessly by simply using the commands:
$ apt-get update $ apt-get install gkrellmd
If you are not on Debian then just go to GKrellM's website and download the latest source .tar.gz file and compile gkrellmd from source. Since this is a remote system we only need to install gkrellmd not gkrellm, so:
$ tar zxvf gkrellm-2.1.28.tar.gz $ cd gkrellm-2.1.28/server/ $ make $ make SMANDIR=/usr/share/man/man1 SINSTALLDIR=/usr/bin install
You can then either start gkrellmd by simply typing "gkrellmd --detach" or you can daemonize it using a tool like [http://cr.yp.to/daemontools.html Daemon Tools] to make sure it's up and running all the time. If you decide to use Daemon Tools, you just need to make a directory somewhere to put a "run" script for gkrellmd, for example /files/runscripts/gkrellmd. Then make a symbolic link to it in /service/ and call it gkrellmd. For example:
ln -s /files/runscripts/gkrellmd/ gkrellmd
You will need to place a file called "run" in this directory you've made, and need to make sure the file is executable using the command:
chmod +x run
Here is an example run script:
#!/bin/sh # daemontools runscript for supervise DAEMON="/usr/bin/gkrellmd" ARGS="--max-clients 2 \ --port 19150 \ --allow-host <IP ADDRESS> \ --user nobody \ --detach" # Run script as $DAEMON with options $ARGS: exec $DAEMON $ARGS
Edit the above script by putting the IP address you will be connecting to gkrellmd from in place of <IP ADDRESS> and if you want change the other options to suit your needs. Now to start gkrellmd: cd /service/ svc -u gkrellmd To stop gkrellmd: cd /service/ svc -d gkrellm (P.S. If you want to monitor a remote Windows system, installing the below GKrellM-Win32 port below also installs a GKrellM server (gkrellmd). However on my system if i click or right-click on the icon for it in the System Tray, it crashes. Other then that it works beautifully. Feel free to email me if you have any advice so I can include it here.)
Now we're going to install the GKrellM-Win32 port of GKrellM. First thing you need to do, before installing the GkrellM-Win32 port, is download and install the Windows installer for the GTK+ Runtime Environment. It is available at http://gimp-win.sourceforge.net/. Next you'll need Gtk-wimp, available at http://gtk-wimp.sourceforge.net/. Go to that URL and download the .zip file of the latest version of gtk-wimp and then go to your computer and open the .zip file. In the .zip file you will see two files, "gtkrc" and "libwimp.dll". To see where you need to place these files in please see the below chart: The layout listed below shows how to install GTK-Wimp in the GTK runtime:
* C:/Program Files/Common Files/GTK/2.0/ o lib/ + gtk-2.0/ # 2.2.0/ * engines/ o libwimp.dll * immodules/ * loaders/ o share/ + themes/ # gtk-wimp/ * gtk-2.0/ gtkrc
Installation may vary for other GTK-Win32 applications. (Above layout was taken verbatim from the Gtk-wimp FAQ. Version numbers shown above may vary as the current stable version number changes over time.) Now place the above two files (shown in bold) in their respective places per the chart above. I had to create the "engines" folder in the "2.2.0" folder, and create the "gtk-wimp/gtk-2.0/" directory structure in "themes", on my own first, and then put the files in them. Now let's go to http://www.srcbox.net/projects/gkrellm/ and download GKrellM.
That's it, now click the GKrellM and it will, by default, open a GKrellM for the local Windows computer, to monitor the local machine's CPU usage, etc. To get it to open a GKrellM for your remote linux box now you'll want to go to START > RUN and type cmd and then once at the command prompt type the command:
"C:\Program Files\GKrellM\gkrellm.exe" -P 19150 -s website.com
or instead of a hostname you can use an IP address too:
"C:\Program Files\GKrellM\gkrellm.exe" -P 19150 -s 192.168.1.1
Switch out "website.com" or "192.168.1.1" with your real hostname or IP address, of course. The port, unless you specified something different when compiling/installing gkrellmd, should be 19150 by default. You can edit the command the icon on your Windows desktop or quick launch bar executes by right clicking the icon and choosing "Properties". Be sure and load the Lunar Clock plugin or the Weather plugin for some fun with your new GNU Krell Monitoring System!