Search
Close this search box.

Linux Server real-time monitoring using a Raspberry PI

I wanted to be able to quickly see at any time the CPU load, Memory used, HD load, network etc … on my main home server. I wanted to have that constantly displayed on a screen on top of my server.

Of course, one option would be to plug the monitor to the server and crack up a session to display top or htop infos. The problem with this is that it’s not secure. Anyone could use that session if hitting CTRL-C or q.

I found a solution I describe bellow.

What you will need:

  • a cheap monitor (you can find decent 22″ for $70-$90)
  • a Raspberry Pi ($35)

First, install a Raspbian with Pixel on the Raspberry Pi. Connect it to the monitor and boot. You should boot to the Pixel Desktop.

Install Chrome (well, the open source version):

sudo apt-get install chromium-browser

then edit the file /home/pi/.config/lxsession/LXDE-pi/autostart and make it look like this:

#@lxpanel --profile LXDE-pi
#@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
#@point-rpi
@xset s off
@xset -dpms
@xset s noblank
@sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences
@chromium-browser --noerrdialogs --kiosk http://www.google.com --incognito

This will disable the desktop and launch the browser instead in full screen without the bookmark bar, search bar or any controls (this is the kiosk mode). Other options here set the screen saver off or prevent error screens to appear.

Then you will need to hide the mouse cursor. For this edit the file /etc/lightdm/lightdm.conf and add in the SeatDefaults section:

[SeatDefaults]
xserver-command=X -nocursor

Now before rebooting the Raspberry Pi, we need to setup Glances on the server we want to monitor:

curl -L http://bit.ly/glances | /bin/bash

Add a line in the rc.local file to make Glances launch at boot time:

/usr/local/bin/glances -w &

Now start Glances server side (reboot or type the above command on your current BASH session) and reboot the Raspberry Pi.

Voila !

PS: don’t forget to change your Raspberry Pi pi user password.

Share the Post:

Related Posts