RPI-Monitor

Install and Customize RPI-Monitor

If you want to monitor your Raspberry Pi hardware and software, you can do it with RPI-Monitor. You can monitor ports, services, CPU, memory usage, disk usage and much more! Screenshot of my final version at the bottom of this page. Let's see how it works:

Install

  • First of all login to Raspberry Pi via SSH (the easiest way is to use Putty).

  • Install dirmngr (required to install RPI-Monitor)
    • sudo apt install dirmngr

  • Add an official repository
    • sudo wget http://goo.gl/vewCLL -O /etc/apt/sources.list.d/rpimonitor.list

  • Avoid unknown repo issue by add key from Ubuntu keyserver
    • sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com E4E362DE2C0D3C0F

  • Run apt update to receive a list of available packages:
    • sudo apt update

  • Install RPI-Monitor
    • sudo apt install rpimonitor

  • Update itself
    • sudo /etc/init.d/rpimonitor update

  • Print IP of your Raspberry Pi
    • hostname -I

  • Replace the IP and open the monitoring website
    • 192.168.0.22:8888

OK, you should see the monitoring page. That's fine, but we need to create a systemd service to start this service automatically at boot time. To do this,

  • Create a new systemd file
    • nano /etc/systemd/system/rpimonitor.service
  • Paste these lines in this file

[Unit]
Description=RPi-Monitor daemon
Before=multi-user.target
After=remote-fs.target
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
Restart=on-failure
KillMode=mixed
Nice=19
ExecStartPre=/bin/sleep 10

ExecStart=/usr/bin/rpimonitord
ExecStop=/bin/kill $MAINPID
StandardOutput=append:/var/log/rpimonitor.log
StandardError=append:/var/log/rpimonitor.log

[Install]
WantedBy=multi-user.target

  • Reload systemd and enable this service to start on system boot
    • sudo systemctl daemon-reload
    • sudo systemctl enable rpimonitor

 

Optional settings

  • Disable refresh "package status" info, comment every line by run this command
    • sed -i -e 's/^/#/' /etc/cron.d/rpimonitor

  • Rename this file
    • mv /etc/apt/apt.conf.d/99rpimonitor /etc/apt/apt.conf.d/99rpimonitor.disabled

  • To avoid overwriting your custom modifications, disable update RPI-Monitor from the official repository. It also speeds up your apt update command in the future
    • sed -i -e 's/^/#/' /etc/apt/sources.list.d/rpimonitor.list

 

Final words

That's it. If you want to customise your monitoring page, simply edit the .conf files in the /etc/rpimonitor/template folder, and do not forget to restart RPI-Monitor by running the systemctl restart rpimonitor command.

My current setup looks like this:

If you are looking for hardware and software recommendation for your Raspberry Pi, click here

 

If you found this article useful and would like to show your appreciation, please consider making a small donation via PayPal. Your support will allow me to continue creating valuable content and make my blog even better. Thank you for your contribution!

Comments