CSS Style Choice Dark Text on Light Background
CSS Style Choice Light Text on Dark Background 
Avatar: Old Photo of Gary's Face
[M] Gary
Vollink.com
20 February 2019

Monitoring Pi

After some back and forth between the Nagios compatible Shinken package and the Big Brother based XyMon, I decided to go with XyMon.  This mostly has to do with the simplicity of the monitoring display.  I'm using a tiny 3.5 inch screen for this. 

I'm not going in-depth on how to set up XyMon (that is pretty easy), but this describes, in-depth, how I set up each of two Raspberry Pi 3 computers as permanent monitoring stations.

MonPi Parts List

XyMon Output on MonPi

The 3.5" screen comes with a a case, hardware, and a sylus.  I found the case holds the Pi just fine without using the included screws, so I didn't bother using them.  The install was very straight forward.  Not mentioned in the parts above, I added a stylus tether so I wouldn't lose it. 

MonPi Build Instructions

I used the Raspbian build for Pi 3 linked from the BangGood site, and burned the MicroSD using balenaEtcher.  Once the MicroSD had an image, I put it into the Pi through the Port hole in the case. 

Temporarily borrow a USB Keyboard and Mouse (from another computer) for the initial boot.  The Pi build for the 3.5" screen does not output to HDMI at all, and only outputs to the tiny screen, which makes initial setup a little tricky since the screen size is smaller than many config windows. 

Once booted to the default graphical display, used the mouse to navigate to Raspberry Pi Configuration (Raspberry Menu on the top left, under the Preferences sub-menu).  Change (and put in a password manager) the default password for the user, "pi".  Then, under the Localization Tab, set the Keyboard Layout and the WiFi Country Code (both default to UK).  After this, exit the graphical Raspberry Pi Configuration. 

On the very cluttered top bar, there is a Networking icon (shows as three verticle lines).  Click that with the mouse, and it should give a list of found WiFi signals.  Click on the correct one, and enter the appropriate password information.  Once it is connected, find its IP address and use a full computer to ssh into the Pi. 

pi@raspberrypi:~ $ sudo -s
root@raspberrypi:/home/pi# raspi-config

This should bring up a screen that looks approximately like this:

Raspberry Pi 3 Model B Rev 1.2

┏————————┫ Raspberry Pi Software Configuration Tool (raspi-config) ┣——————————┓
┃                                                                              ┃
┃    1 Change User Password           Change password for the current u        ┃
┃    2 Network Options                Configure network settings               ┃
┃    3 Boot Options                   Configure options for start-up           ┃
┃    4 Localisation Options           Set up language and regional sett        ┃
┃    5 Interfacing Options            Configure connections to peripher        ┃
┃    6 Overclock                      Configure overclocking for your P        ┃
┃    7 Advanced Options               Configure advanced settings              ┃
┃    8 Update                         Update this tool to the latest ve        ┃
┃    9 About raspi-config             Information about this configurat        ┃
┃                                                                              ┃
┃                                                                              ┃
┃                                                                              ┃
┃                     <Select>                     <Finish>                    ┃
┃                                                                              ┃
┗——————————————————————————————————————————————————————————————————————————————┛

Under 2 Network Options: Change the Hostname to name your Pi.
Under 4 Localization Options: Change the Locale and Timezone, if you didn't do it on the tiny graphical screen.
If your microSD card is larger than 8GB, under 7 Advanced Options: Select A1 Expand Filesystem.

Finish will prompt you to reboot if necessary. 

Log in again, and make sure the Pi is fully updated...

pi@monpi:~ $ sudo -s
root@monpi:/home/pi# apt update
Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.4 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]
Get:3 http://archive.raspberrypi.org/debian stretch/main armhf Packages [212 kB]
Get:4 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [42.0 kB]
Get:5 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB]
Fetched 12.0 MB in 13s (883 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
12 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@monpi:/home/pi# apt -y upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
   ...

By default, the Pi is already auto logging in at boot to a graphical screen as the pi user.  This setup takes advantage of this by tweaking the Pi user's graphical configuration parameters.  To get this just right, the following packages need to be installed...

root@monpi:/home/pi# apt install x11-server-utils ttf-mscorefonts-installer \
    unclutter
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be installed:
   ...

Note: x11-server-utils is already installed, but it will be marked as a requested package instead of an auto-installed one.  This way an "apt autoremove" command will never remove it. 

The next part requires a text editor.  The examples below show nano.

IMPORTANT: In the example below replace YOUR_XYMON_IP_ADDRESS with the IP address of the xymon server.

pi@monpi:~ $ mkdir bin
pi@monpi:~ $ cd bin
pi@monpi:~/bin $ cd bin
pi@monpi:~/bin $ nano kioskweb
  GNU nano 2.7.4                    File: kioskweb

# This starts the KIOSK Chromium Browser
/usr/bin/chromium-browser \
        --incognito \
        --start-maximized \
        --kiosk \
        --allow-running-insecure-content \
        --remember-cert-error-decisions \
        http://YOUR_XYMON_IP_ADDRESS/xymon/nongreen.html












^G Get Help  ^O Write Out ^W Where Is  ^K Cut Text  ^J Justify   ^C Cur Pos
^X Exit      ^R Read File ^\ Replace   ^U Uncut Text^T To Spell  ^_ Go To Line

Be careful to make sure that the lines that end with a \ do not have any spaces after them.
Ctrl-X to quit,
Y to save the file,
Enter to accept the exsting filename, kioskweb.

Then, set the permission to kioskweb as executable, change directory to where the autostart file exists, and change that file as shown...

pi@monpi:~/bin $ chmod a+x kioskweb
pi@monpi:~/bin $ cd ~/.config/lxsession/LXDE-pi
pi@monpi:~/.config/lxsession/LXDE-pi $ nano autostart
  GNU nano 2.7.4                   File: autostart

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
# @xscreensaver -no-splash ## Removed for Chrome Kiosk Mode
@point-rpi

@/home/pi/bin/kioskweb

@unclutter
@xset s off
@xset s noblank
@xset -dpms








^G Get Help  ^O Write Out ^W Where Is  ^K Cut Text  ^J Justify   ^C Cur Pos
^X Exit      ^R Read File ^\ Replace   ^U Uncut Text^T To Spell  ^_ Go To Line

Ctrl-X to quit,
Y to save the file,
Enter to accept the exsting filename, autostart.

Once this has been completed, the Pi can be rebooted, and it should automatically boot into Google's Kiosk mode!

pi@monpi:~/bin $ sudo shutdown -r now

Advanced Stuff

Because MY Pi is only being used for Kiosk mode, I removed several of the default software packages, that I won't use.  Several of these, also, do not make sense to run on such a tiny screen. 

pi@raspberrypi:~ $ sudo -s
root@raspberrypi:/home/pi# apt remove --purge wolfram-engine wolframscript
   ...
root@raspberrypi:/home/pi# apt autoremove
   ...
root@raspberrypi:/home/pi# apt remove --purge libreoffice libreoffice-gtk libreoffice-sdbc-hsqldb
   ...
root@raspberrypi:/home/pi# apt autoremove
   ...
root@raspberrypi:/home/pi# apt remove --purge minecraft-pi python-minecraftpi claws-mail bluej
   ...
root@raspberrypi:/home/pi# apt autoremove
   ...
root@raspberrypi:/home/pi# apt remove --purge greenfoot geany idle idle3 python3-thonny scratch scratch2
   ...
root@raspberrypi:/home/pi# apt autoremove
   ...

That is the end of the Monitoring Pi setup.  As always, if you have any questions, feel free to e-mail me at the link below.