Move monitoring info from notes to docs

This commit is contained in:
KemoNine 2020-08-01 00:19:28 +00:00
parent 773c7a45fd
commit 1272d4e7e3
3 changed files with 39 additions and 36 deletions

View file

@ -2,6 +2,8 @@
This folder contains a bunch of general information on how to get the base of a PiFrame deployed.
Items marked ```REQUIRED``` are assumed to be setup and working. You've been warned.
* [Base Firmware (REQUIRED)](base.md)
* [Finalize Arch Setup](finalize_setup.md)
* [Setup swap (REQUIRED)](swap.md)
@ -16,3 +18,4 @@ This folder contains a bunch of general information on how to get the base of a
* [Backups via restic](restic.md)
* [Additional Networking Setup (REQUIRED)](cockpit.md)
* [Web Dashboard / Landing Page](landing_page.md)
* [System Monitoring (REQUIRED)](monit.md)

36
docs/monit.md Normal file
View file

@ -0,0 +1,36 @@
# System Monitoring
The below commands will setup ```monit``` to track key elements of the PiFrame hardware and software. ```monit``` is a very light weight monitoring solution and is used to ensure key parts of the system are in a reasonable state and working.
``` sh
pacman -S monit
mkdir /etc/monit.d
nano -w /etc/monitrc
include /etc/monit.d/*
set httpd port 2812 and
use address 0.0.0.0
allow admin:monit
set mailserver domain.tld port 587
username "piframe@domain.tld" password "apassword"
using tls
cat > /etc/monit.d/rootfs <<EOF
check filesystem rootfs with path /
if space usage > 80% then alert
EOF
cat > /etc/monit.d/tankfs <<EOF
check filesystem tankfs with path /tank
if space usage > 80% then alert
EOF
cat > /etc/monit.d/feh <<EOF
check process feh matching /usr/bin/feh
start program = "/usr/bin/systemctl start greetd"
stop program = "/usr/bin/systemctl stop greetd"
if does not exist then alert
if does not exist for 2 cycles then restart
EOF
systemctl enable --now monit
firewall-cmd --zone=public --permanent --add-port=2812/tcp
firewall-cmd --reload
```

View file

@ -1,39 +1,3 @@
########################################
# system monitoring
########################################
pacman -S monit
mkdir /etc/monit.d
nano -w /etc/monitrc
include /etc/monit.d/*
set httpd port 2812 and
use address 0.0.0.0 # only accept connection from localhost (drop if you use M/Monit)
allow admin:monit # require user 'admin' with password 'monit'
set mailserver robomail.nusku.biz port 587
username "piframe@robomail.nusku.biz" password "r8QA6AEFaqtCdDjfvzY3gvsX"
using tls
cat > /etc/monit.d/rootfs <<EOF
check filesystem rootfs with path /
if space usage > 80% then alert
EOF
cat > /etc/monit.d/tankfs <<EOF
check filesystem tankfs with path /tank
if space usage > 80% then alert
EOF
cat > /etc/monit.d/feh <<EOF
check process feh matching /usr/bin/feh
start program = "/usr/bin/systemctl start greetd"
stop program = "/usr/bin/systemctl stop greetd"
if does not exist then alert
if does not exist for 2 cycles then restart
EOF
systemctl enable --now monit
firewall-cmd --zone=public --permanent --add-port=2812/tcp
firewall-cmd --reload
########################################
# system _resource_ monitoring
########################################