Dzahn has uploaded a new change for review.
https://gerrit.wikimedia.org/r/304580
Change subject: base/monitoring: add optional SMART disk check
......................................................................
base/monitoring: add optional SMART disk check
Bug:T86552
Change-Id: I70dd716b46e6078df9ed531eb985e3047676884a
---
A hieradata/hosts/mw1099.yaml
M modules/base/manifests/monitoring/host.pp
2 files changed, 13 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/80/304580/1
diff --git a/hieradata/hosts/mw1099.yaml b/hieradata/hosts/mw1099.yaml
new file mode 100644
index 0000000..19d09bb
--- /dev/null
+++ b/hieradata/hosts/mw1099.yaml
@@ -0,0 +1,2 @@
+monitoring::smart::enabled: 'true'
+monitoring::smart::device: '/dev/sda2'
diff --git a/modules/base/manifests/monitoring/host.pp
b/modules/base/manifests/monitoring/host.pp
index 80b4697..e019582 100644
--- a/modules/base/manifests/monitoring/host.pp
+++ b/modules/base/manifests/monitoring/host.pp
@@ -5,7 +5,7 @@
# - dpkg
# - disk space
# - raid
-#
+# - SMART attributes
# Note that this class is probably already included for your node
# by the class base. If you want to change the contact_group, set
# the variable contactgroups in hiera.
@@ -27,6 +27,8 @@
# that are purposefully at 99%. Better ideas are welcome.
$nrpe_check_disk_options = '-w 6% -c 3% -l -e -A -i "/srv/sd[a-b][1-3]"
--exclude-type=tracefs',
$nrpe_check_disk_critical = false,
+ $nrpe_check_smart_device = hiera('monitoring::smart::device', '/dev/sda1'),
+ $nrpe_check_smart_critical = false,
) {
include base::puppet::params # In order to be able to use some variables
@@ -92,6 +94,14 @@
nrpe_command => "/usr/lib/nagios/plugins/check_disk
${nrpe_check_disk_options}",
}
+ if $::monitoring::smart::enabled {
+ nrpe::monitor_service { 'disk_smart':
+ description => 'Disk SMART',
+ critical => $nrpe_check_smart_critical,
+ nrpe_command => "/usr/lib/nagios/plugins/check_ide_smart -n -d
${nrpe_check_smart_device}",
+ }
+ }
+
nrpe::monitor_service { 'dpkg':
description => 'DPKG',
nrpe_command => '/usr/local/lib/nagios/plugins/check_dpkg',
--
To view, visit https://gerrit.wikimedia.org/r/304580
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I70dd716b46e6078df9ed531eb985e3047676884a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits