Configuring ad hoc system monitoring (revision 1)

Introduction

This page describes how to set up various small system checks. It is not expected to be of much use to anyone except Alexis.

Psrf

  1. Create a non-root user to run some checks:
    useradd --system --user-group --create-home --shell /bin/bash monitor
    
  2. Ensure that mail sent to this user on the monitoring system gets to a human. For myself, this means, on mandala, add an entry to /etc/aliases:
    monitor: alexis
  3. Psrf is a framework for performing small checks. Install it as root as follows:
    svn co https://svn.pasta.freemyip.com/main/psrf/trunk /usr/local/opt/psrf
    ln -sr /usr/local/opt/psrf/bin/psrf /usr/local/bin
    echo '* * * * * /usr/local/bin/psrf' | su - monitor -c 'crontab -'
    

    (Hopefully, in the future, that last command won’t be needed.)

  4. As the ‘monitor’ user, edit the psrf configuration by running:
    psrf -e

    and add the following entry:

    reg "Self-Test/Random" null '* * * * *' 'echo $RANDOM'
  5. Wait to see that working correctly (i.e. mails arrive) and then add other checks.
  6. The checks that the monitor user runs may rely on other software being installed. For myself, this means:
    1. For cert-monitor, run:
      cd /tmp
      wget https://svn.pasta.freemyip.com/main/smalltools/trunk/bin/svn-cache-passwd
      chmod 755 svn-cache-passwd
      /tmp/svn-cache-passwd https://svn.pasta.freemyip.com/private/
    2. For the broken links scanner, run:
      apt -y install linkchecker

See also