Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F27208827
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/roles/core/init.sls b/roles/core/init.sls
index ef7a49c..19d1dfa 100644
--- a/roles/core/init.sls
+++ b/roles/core/init.sls
@@ -1,24 +1,25 @@
# -------------------------------------------------------------
# Salt — Core units
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
include:
- .rc
- .hostname
- .login
- .network
- .memory
+ - .monitoring
- .motd
- .src
- .ports
- .rsyslog
- .salt
- .sshd
- .sudo
- .sysctl
- .timezone
- .userland-software
- .users
diff --git a/roles/core/monitoring/checks.sls b/roles/core/monitoring/checks.sls
new file mode 100644
index 0000000..5df2439
--- /dev/null
+++ b/roles/core/monitoring/checks.sls
@@ -0,0 +1,29 @@
+# -------------------------------------------------------------
+# Salt — Monitoring
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import dirs with context %}
+{% set nrpe_dir = dirs.share + "/monitoring/checks/nrpe" %}
+
+{{ nrpe_dir }}:
+ file.directory:
+ - makedirs: True
+
+# -------------------------------------------------------------
+# OS or distro specific
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% set os_family_support = [
+ "FreeBSD",
+] %}
+
+{% if grains["os_family"] in os_family_support %}
+monitoring_checks_freebsd:
+ file.recurse:
+ - source: salt://roles/core/monitoring/files/checks/nrpe/os_family/{{ grains["os_family"] }}
+ - name: {{ nrpe_dir }}
+ - file_mode: keep
+{% endif %}
diff --git a/roles/core/monitoring/files/checks/nrpe/os_family/FreeBSD/check-kernel.sh b/roles/core/monitoring/files/checks/nrpe/os_family/FreeBSD/check-kernel.sh
new file mode 100755
index 0000000..ee0a25d
--- /dev/null
+++ b/roles/core/monitoring/files/checks/nrpe/os_family/FreeBSD/check-kernel.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+set -u
+
+PATH=/bin:/usr/bin:/sbin
+
+which freebsd-version > /dev/null || exit 3
+
+VERSION_INSTALLED=$(freebsd-version -k)
+VERSION_RUNNING=$(freebsd-version -r)
+
+if [ "$VERSION_INSTALLED" != "$VERSION_RUNNING" ]; then
+ echo "Reboot is needed for kernel upgrade $VERSION_RUNNING to $VERSION_INSTALLED"
+ exit 1
+fi
+
+exit 0
diff --git a/roles/core/init.sls b/roles/core/monitoring/init.sls
similarity index 58%
copy from roles/core/init.sls
copy to roles/core/monitoring/init.sls
index ef7a49c..cc871c8 100644
--- a/roles/core/init.sls
+++ b/roles/core/monitoring/init.sls
@@ -1,24 +1,9 @@
# -------------------------------------------------------------
-# Salt — Core units
+# Salt — Monitoring
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
include:
- - .rc
- - .hostname
- - .login
- - .network
- - .memory
- - .motd
- - .src
- - .ports
- - .rsyslog
- - .salt
- - .sshd
- - .sudo
- - .sysctl
- - .timezone
- - .userland-software
- - .users
+ - .checks
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, May 3, 07:52 (40 m, 23 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3673040
Default Alt Text
(3 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment