Andrew Bogott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/124560
Change subject: Add eth1 checks to nova compute hosts.
......................................................................
Add eth1 checks to nova compute hosts.
RT ticket: 7220
Change-Id: If92cee98f0f69786c0176aeb87250bd62444da8b
---
M manifests/role/nova.pp
M modules/base/manifests/monitoring/host.pp
A modules/nrpe/files/plugins/check_eth
3 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/60/124560/1
diff --git a/manifests/role/nova.pp b/manifests/role/nova.pp
index 97ee37e..9acff4b 100644
--- a/manifests/role/nova.pp
+++ b/manifests/role/nova.pp
@@ -436,6 +436,11 @@
}
}
+ nrpe::monitor_service {'check_eth':
+ description => 'eth1, eth2, eth3',
+ nrpe_command => '/usr/local/lib/nagios/plugins/check_eth "eth1"'
+ }
+
class { "openstack::compute-service": openstack_version =>
$openstack_version, novaconfig => $novaconfig }
if $realm == "labs" {
diff --git a/modules/base/manifests/monitoring/host.pp
b/modules/base/manifests/monitoring/host.pp
index cb1625f..ab7a747 100644
--- a/modules/base/manifests/monitoring/host.pp
+++ b/modules/base/manifests/monitoring/host.pp
@@ -54,6 +54,13 @@
mode => '0555',
source =>
'puppet:///modules/base/monitoring/check_puppet_disabled';
}
+ file { '/usr/local/lib/nagios/plugins/check_eth':
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => '0555',
+ source => 'puppet:///modules/base/monitoring/check_eth';
+ }
sudo_user { 'nagios':
privileges => ['ALL = NOPASSWD: /usr/local/bin/check-raid.py'],
diff --git a/modules/nrpe/files/plugins/check_eth
b/modules/nrpe/files/plugins/check_eth
new file mode 100755
index 0000000..a2a458d
--- /dev/null
+++ b/modules/nrpe/files/plugins/check_eth
@@ -0,0 +1,16 @@
+#!/bin/sh
+for INTERFACE in $1; do
+ STATUS=`ip link show ${INTERFACE}`
+ if [ "$?" != "0" ]
+ then
+ echo "${INTERFACE} not found"
+ exit 2
+ fi
+ if echo ${STATUS} | grep "NO-CARRIER"
+ then
+ echo "${INTERFACE} reporting no carrier."
+ exit 2
+ fi
+done
+
+exit 0
--
To view, visit https://gerrit.wikimedia.org/r/124560
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If92cee98f0f69786c0176aeb87250bd62444da8b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits