Faidon Liambotis has submitted this change and it was merged.
Change subject: check-raid: readd support for arcconf (Adaptec)
......................................................................
check-raid: readd support for arcconf (Adaptec)
It turns out that arcconf from wikimedia-raid-utils was used in a few
boxes (professor, db boxes in pmtpa etc.). Fetch it from the hwraid repo
as well and modify check-raid.py to reference /usr/sbin instead of
/usr/bin.
While at it, remove the whole sudo logic from check-raid.py and the
arcconf sudoers entry; check-raid.py runs under sudo already and has
root, there's no reason to sudo as root twice. And while removing that,
remove the icinga sudo as well, nrpe runs just as the nagios user.
Change-Id: I08b8a61c3eb8b38c8442156e89a580036dcb0a62
---
M files/misc/reprepro/updates
M modules/base/files/monitoring/check-raid.py
M modules/base/manifests/monitoring/host.pp
3 files changed, 4 insertions(+), 16 deletions(-)
Approvals:
Faidon Liambotis: Looks good to me, approved
jenkins-bot: Verified
diff --git a/files/misc/reprepro/updates b/files/misc/reprepro/updates
index 246eb3a..fc63b2f 100644
--- a/files/misc/reprepro/updates
+++ b/files/misc/reprepro/updates
@@ -36,4 +36,4 @@
Suite: precise
Architectures: amd64 source
VerifyRelease: 6005210E23B3D3B4
-ListShellHook: grep-dctrl -X -S megacli || [ $? -eq 1 ]
+ListShellHook: grep-dctrl -X -S megacli -o -X -P arcconf || [ $? -eq 1 ]
diff --git a/modules/base/files/monitoring/check-raid.py
b/modules/base/files/monitoring/check-raid.py
index 7a5e1ea..09a38c2 100644
--- a/modules/base/files/monitoring/check-raid.py
+++ b/modules/base/files/monitoring/check-raid.py
@@ -110,16 +110,9 @@
os.chdir('/var/log')
devNull = open('/dev/null', 'w')
- # Check if we need to run arcconf using sudo
- try:
- os.stat('/etc/sudoers.d/nrpe')
- cmd = ['sudo']
- except:
- cmd = []
-
# Run the command
try:
- proc = subprocess.Popen(cmd + ['/usr/bin/arcconf', 'getconfig', '1'],
+ proc = subprocess.Popen(['/usr/sbin/arcconf', 'getconfig', '1'],
stdout=subprocess.PIPE, stderr=devNull)
except:
print 'WARNING: Unable to execute arcconf'
diff --git a/modules/base/manifests/monitoring/host.pp
b/modules/base/manifests/monitoring/host.pp
index dd4ef17..fa4ec7d 100644
--- a/modules/base/manifests/monitoring/host.pp
+++ b/modules/base/manifests/monitoring/host.pp
@@ -21,7 +21,7 @@
monitor_service { 'ssh': description => 'SSH', check_command =>
'check_ssh', contact_group => $contact_group }
if $::network_zone == 'internal' {
- package { 'megacli':
+ package { [ 'megacli', 'arcconf' ]:
ensure => 'latest',
}
@@ -45,12 +45,7 @@
owner => root,
group => root,
mode => '0440',
- content => "
-nagios ALL = (root) NOPASSWD: /usr/local/bin/check-raid.py
-icinga ALL = (root) NOPASSWD: /usr/local/bin/check-raid.py
-nagios ALL = (root) NOPASSWD: /usr/bin/arcconf getconfig 1
-icinga ALL = (root) NOPASSWD: /usr/bin/arcconf getconfig 1
-";
+ content => "nagios ALL = (root) NOPASSWD:
/usr/local/bin/check-raid.py\n",
}
}
}
--
To view, visit https://gerrit.wikimedia.org/r/87570
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I08b8a61c3eb8b38c8442156e89a580036dcb0a62
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits