Any ideas how I could get cpu and disk information from 2 raspberry pis connected on a network and displays them on my mac?

2

I have 2 raspberry pis on my home network performing different tasks. sometimes, I'd like to see their cpu and disk usage on my mac, without needing to login via ssh.

is there a service (can this be done via syslog?) for debian that can broadcast this info, and any app for mac that can display it?

thanks!

otmezger

Posted 2013-02-24T13:31:33.730

Reputation: 211

1You can execute commands via SSH. Couple this with use of SSH keys and you have a one line command run from the client + some output provided by the server. – Daniel Beck – 2013-02-24T13:39:57.510

i was looking for a nice GUI :-). or at least a set of ready scripts :-). Thaqnks anyway @DanielBeck – otmezger – 2013-02-24T15:43:51.710

Maybe http://www.panic.com/stattoo/ has a "show file contents" mode. There may also be dashboard widgets that do this.

– Daniel Beck – 2013-02-24T16:06:03.807

Answers

3

I'd point you along the lines of Munin, but that's probably overkill for you. Instead, I'd suggest generating a ssh key-pair (if you do not have one already -- have a look in ~/.ssh/ for id_*.pub):

SSH way

You may monitor your Raspberry Pi's without typing a password every time by generating a ssh key pair and copying the public key to each of your Raspberries.

Generate SSH key

You may skip this step if you do have one already -- have a look in ~/.ssh/ for id_*.pub.

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/runejuhl/.ssh/id_rsa): <RETURN>
Enter passphrase (empty for no passphrase): <RETURN>
Enter same passphrase again: <RETURN>
Your identification has been saved in /home/runejuhl/.ssh/id_rsa.
Your public key has been saved in /home/runejuhl/.ssh/id_rsa.pub.
The key fingerprint is:
04:8c:46:96:5c:79:34:8c:88:cb:85:31:f6:98:9c:db runejuhl@libertad
The key's randomart image is:
+--[ RSA 2048]----+
|  +*o*o=o        |
| ooBB +.o.       |
| .=+.  ..        |
|  oo   .         |
|  . E   S        |
|                 |
|                 |
|                 |
|                 |
+-----------------+

Copy public key

Next step is to copy your public ssh key to your machines. For each of your Raspberries, execute the following:

ssh-copy-id hostname

E.g.:

ssh-copy-id reflexo.petardo.dk

Run commands

With your key copied, you have the ability to log in without typing a password. This enables you to quickly run commands on your machines:

ssh raspberry-1 htop

The above runs the command htop on raspberry-1. htop has a nice graphical interface, displaying CPU, RAM and swap usage by default, along with a top-like list of processes. Of course htop needs to be installed...

Munin

If you need something more long-lasting, I'd suggest you have a look at Munin. It's open source, works well and has plenty of monitoring scripts. The only thing needed besides Munin is a webserver -- I'd suggest nginx. Have a look at http://munin.readthedocs.org/en/latest/example/webserver/nginx.html for a guide on how to set up nginx with Munin.

runejuhl

Posted 2013-02-24T13:31:33.730

Reputation: 142

Thanks. I already have ssh keys shared and can login via ssh and run top... I was looking for a software on my mac that can combine them together and display it on one window on my mac. thanks anyway for your effort! – otmezger – 2013-02-25T08:54:57.490

Yeah, I reread the question after answering, and I figured I might've misunderstood you. If you have long-running jobs, I'd still recommend you to take a look at Munin or similar software. It displays nice graphs which it by default updates every 5 minutes. – runejuhl – 2013-02-25T08:57:07.253

1

On your RPI install Webmin, then access your boxes via web interface: https:yourPI:10000

More about webmin: http://www.webmin.com/

Paul

Posted 2013-02-24T13:31:33.730

Reputation: 47