Monitor the space available on the =/DVR/= volume.
authorMatt Birkholz <matt@birchwood-abbey.net>
Thu, 18 Sep 2025 23:36:12 +0000 (17:36 -0600)
committerMatt Birkholz <matt@birchwood-abbey.net>
Fri, 19 Sep 2025 02:55:41 +0000 (20:55 -0600)
Add custom NAGIOS command ~abbey_dvr~ on the ~dvrs~ and monitor it.

README.org
roles_t/abbey-cloister/tasks/main.yml
roles_t/abbey-core/templates/nagios-kamino.cfg [deleted file]
roles_t/abbey-dvr/handlers/main.yml [new file with mode: 0644]
roles_t/abbey-dvr/tasks/main.yml

index 51017929ef228234c54fd8963de291451bb18c65..ff2355cf08fd863d4968a40d26a71e9c901784b7 100644 (file)
@@ -1017,7 +1017,7 @@ additional configuration files in =/etc/nagios4/conf.d/=, and another
 customized ~check_sensors~ plugin (~abbey_pisensors~) in
 =/usr/local/sbin/= on the Raspberry Pis.
 
-** Monitoring The Home Disk
+*** Monitoring The Home Disk
 
 The abbey adds monitoring of the space remaining on the volume at
 =/home/= on Core.  (The small institute only monitors the space
@@ -1051,7 +1051,7 @@ remaining on roots.)
   tags: actualizer
 #+END_SRC
 
-** Custom NAGIOS Monitor ~abbey_pisensors~
+*** Custom NAGIOS Monitor ~abbey_pisensors~
 
 The ~check_sensors~ plugin is included in the package
 ~monitoring-plugins-basic~, but it does not report any readings.  The
@@ -1143,18 +1143,17 @@ case "$1" in
 esac
 #+END_SRC
 
-** Monitoring The Cloister
+*** Configure NAGIOS Monitoring of The Cloister
 
 The abbey adds monitoring for more servers: Dantooine and Kessel.
 They are ~abbey-cloister~ servers, so they are configured as small
 institute ~campus~ servers, like Gate, with an NRPE (a NAGIOS Remote
 Plugin Executor) server and an ~inst_sensors~ command.
 
-The configurations for the servers are very similar to Gate's, but are
-idiosyncratically in flux.  For example Ord Mantell, the Raspberry Pi
-OS (ARM64) machine, uses the ~abbey_pisensors~ monitor.
+The configurations for these servers are very similar to Gate's, but
+are idiosyncratically in flux.
 
-*** Cloister Network Addresses
+**** Cloister Network Addresses
 
 The IP addresses of all three hosts are nice to use in the NAGIOS
 configuration (to avoid depending on name service) and so are
@@ -1167,7 +1166,7 @@ dantooine_addr:             10.84.138.8
 kessel_addr:                10.84.138.10
 #+END_SRC
 
-*** Installing NAGIOS Configurations
+**** Install NAGIOS Configurations
 
 The following task installs each host's NAGIOS configuration.
 
@@ -1186,7 +1185,7 @@ The following task installs each host's NAGIOS configuration.
 **** NAGIOS Monitoring of Dantooine
 
 #+CAPTION: [[file:roles_t/abbey-core/templates/nagios-dantooine.cfg][=roles_t/abbey-core/templates/nagios-dantooine.cfg=]]
-#+BEGIN_SRC conf :tangle roles_t/abbey-core/templates/nagios-dantooine.cfg
+#+BEGIN_SRC conf :tangle roles_t/abbey-core/templates/nagios-dantooine.cfg :mkdirp yes
 define host {
     use                     linux-server
     host_name               dantooine
@@ -1200,6 +1199,13 @@ define service {
     check_command           check_nrpe!inst_root
 }
 
+define service {
+    use                     generic-service
+    host_name               dantooine
+    service_description     DVR Recordings
+    check_command           check_nrpe!abbey_dvr
+}
+
 # define service {
 #     use                     generic-service
 #     host_name               dantooine
@@ -1236,7 +1242,7 @@ define service {
 }
 #+END_SRC
 
-*** NAGIOS Monitoring of Kessel
+**** NAGIOS Monitoring of Kessel
 
 #+CAPTION: [[file:roles_t/abbey-core/templates/nagios-kessel.cfg][=roles_t/abbey-core/templates/nagios-kessel.cfg=]]
 #+BEGIN_SRC conf :tangle roles_t/abbey-core/templates/nagios-kessel.cfg
@@ -1678,7 +1684,7 @@ Raspberry Pis (architecture ~aarch64~) only.
     mode: u=rwx,g=rx,o=rx
   when: ansible_architecture == 'aarch64'
 
-- name: Configure NAGIOS command.
+- name: Configure NAGIOS monitor abbey_pisensors.
   become: yes
   copy:
     content: |
@@ -1988,6 +1994,36 @@ location do not fail.
     mode: u=rwx,g=rxs,o=
 #+END_SRC
 
+** Install Custom NAGIOS Monitor ~abbey_dvr~
+
+DVR hosts install a custom NRPE plugin named ~abbey_dvr~ to monitor
+the storage available on =/DVR/=.
+
+#+CAPTION: [[file:roles_t/abbey-dvr/tasks/main.yml][=roles_t/abbey-dvr/tasks/main.yml=]]
+#+BEGIN_SRC conf :tangle roles_t/abbey-dvr/tasks/main.yml
+
+- name: Configure NAGIOS command abbey_dvr.
+  become: yes
+  vars:
+    lib: /usr/lib/nagios/plugins
+  copy:
+    content: |
+      command[abbey_dvr]={{ lib }}/check_disk -w 20% -c 10% -p /DVR
+    dest: /etc/nagios/nrpe.d/abbey.cfg
+  notify: Reload NRPE server.
+#+END_SRC
+
+#+CAPTION: [[file:roles_t/abbey-dvr/handlers/main.yml][=roles_t/abbey-dvr/handlers/main.yml=]]
+#+BEGIN_SRC conf :tangle roles_t/abbey-dvr/handlers/main.yml :mkdirp yes
+---
+- name: Reload NRPE server.
+  become: yes
+  systemd:
+    service: nagios-nrpe-server
+    state: reloaded
+  tags: actualizer
+#+END_SRC
+
 ** Configure IP Cameras
 
 A new security camera is setup as described in [[*Cloistering][Cloistering]], after
index d4b064b4d24724c50646aa04d532fbe5c3d3002c..4c6e343a13f6fbd9112d77b2062e0aa75c965afd 100644 (file)
@@ -18,7 +18,7 @@
     mode: u=rwx,g=rx,o=rx
   when: ansible_architecture == 'aarch64'
 
-- name: Configure NAGIOS command.
+- name: Configure NAGIOS monitor abbey_pisensors.
   become: yes
   copy:
     content: |
diff --git a/roles_t/abbey-core/templates/nagios-kamino.cfg b/roles_t/abbey-core/templates/nagios-kamino.cfg
deleted file mode 100644 (file)
index 410b980..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-define host {
-    use                     linux-server
-    host_name               kamino
-    address                 {{ kamino_addr }}
-}
-
-define service {
-    use                     generic-service
-    host_name               kamino
-    service_description     Root Partition
-    check_command           check_nrpe!inst_root
-}
-
-define service {
-    use                     generic-service
-    host_name               kamino
-    service_description     Current Load
-    check_command           check_nrpe!check_load
-}
-
-define service {
-    use                     generic-service
-    host_name               kamino
-    service_description     Zombie Processes
-    check_command           check_nrpe!check_zombie_procs
-}
-
-# define service {
-#     use                     generic-service
-#     host_name               kamino
-#     service_description     Total Processes
-#     check_command           check_nrpe!check_total_procs
-# }
-
-define service {
-    use                     generic-service
-    host_name               kamino
-    service_description     Swap Usage
-    check_command           check_nrpe!inst_swap
-}
-
-define service {
-    use                     generic-service
-    host_name               kamino
-    service_description     Temperature Sensors
-    check_command           check_nrpe!inst_sensors
-}
diff --git a/roles_t/abbey-dvr/handlers/main.yml b/roles_t/abbey-dvr/handlers/main.yml
new file mode 100644 (file)
index 0000000..e6d761d
--- /dev/null
@@ -0,0 +1,7 @@
+---
+- name: Reload NRPE server.
+  become: yes
+  systemd:
+    service: nagios-nrpe-server
+    state: reloaded
+  tags: actualizer
index 7bb74e36eaccb02819090112f6030f98939d07a4..a8a1d9a062654b91317af0c46da203d0f9339b6e 100644 (file)
     owner: agentdvr
     group: agentdvr
     mode: u=rwx,g=rxs,o=
+
+- name: Configure NAGIOS command abbey_dvr.
+  become: yes
+  vars:
+    lib: /usr/lib/nagios/plugins
+  copy:
+    content: |
+      command[abbey_dvr]={{ lib }}/check_disk -w 20% -c 10% -p /DVR
+    dest: /etc/nagios/nrpe.d/abbey.cfg
+  notify: Reload NRPE server.