I thought I would post how I got gkrellm server set up to monitor the health of my son’s computer upstairs. I first set up certificate-based SSH logins (restricted on each computer to disallow root logins, of course):
- Make sure sshd is running on the server you wish to login to, and using version 2 (by now, there should be no need to use version1).
- ssh-keygen – t rsa : This makes the public/private key pair. Press <ENTER> twice to them with no passphrase (simplifies logins, but there is a security trade-off, so do this in an environment you trust – like a protected home network). Look for the files id_rsa and id_rsa.pub in your /home/username/.ssh directory.
- scp /home/username/.ssh/id_rsa.pub <server IP>:/home/username/.ssh : Copies the public key from the ssh directory on the client to the same directory on the server.
- cat id_rsa.pub >> authorized_keys2 : Appends the key to the server’s authorized keys file.
- chmod 0600 authorized_keys2 : Log into the server and set the permissions on the file. Be sure to remove the id_rsa.pub file.
- Test by logging into the server from the client with ssh <server name or IP>. If it works, you should not be prompted for a password.
Next, I made sure gkrellm was installed: urpmi -a gkrellm- works nicely (Mandriva). It gets the client, server, and lots of handy plugins and themes. For other distros, use your specific update method.
Then I edited the /etc/gkrellmd.conf file on the server:
- update-hz 5
- max-clients 2
- port 52873 – set this to any unsused port if you do not want to use the default port
- allow-host <client IP>
and restarted the service – service gkrellmd restart – to ensure the new settings were in effect.
Next, I tested it using the following command on the client: ssh -f -L <any unused port, can be the same as the gkrellmd port>:<server IP>:<gkrellmd port> <server IP> “gkrellm -f -s 127.0.0.1 -P <gkrellmd port>”.
Example: ssh -f -L 54352:192.168.0.4:52873 192.168.0.4 “gkrellm -f -s 127.0.0.1 -P 52873″
If successful, a gkrellm screen should appear on your desktop, displaying the stats (name, kernel version, load, etc.) of the remote server.
To ensure it started each time I logged into my desktop, I placed the command inside an executable script, which I copied into my .kde/Autostart/ directory. Now I can see how many users are logged in upstairs, the CPU and network load, uptime, drive activity, and partition space, all at a glance.