aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-10-04 15:25:01 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-10-04 16:06:35 +0200
commit533e452226f25d190a31b83c35fc3d6a7c557b13 (patch)
treebf8c3849f130805032ea055caad3d1b3a03dba27
parent577c7fc1e105b74178c8ec2b3762edb6b705d948 (diff)
downloadaports-533e452226f25d190a31b83c35fc3d6a7c557b13.tar.bz2
aports-533e452226f25d190a31b83c35fc3d6a7c557b13.tar.xz
main/nagios-plugins: add sudoers rule for check_openrc
-rw-r--r--main/nagios-plugins/APKBUILD30
-rw-r--r--main/nagios-plugins/nagios-openrc.sudoers3
2 files changed, 25 insertions, 8 deletions
diff --git a/main/nagios-plugins/APKBUILD b/main/nagios-plugins/APKBUILD
index a80f177f18..ee80b2c075 100644
--- a/main/nagios-plugins/APKBUILD
+++ b/main/nagios-plugins/APKBUILD
@@ -3,7 +3,7 @@
# Maintainer: Jeff Bilyk <jbilyk@gmail.com>
pkgname=nagios-plugins
pkgver=2.2.1
-pkgrel=1
+pkgrel=2
pkgdesc="Plugins for Nagios to check services on hosts"
url="https://nagios-plugins.org"
arch="all"
@@ -27,7 +27,8 @@ pkgusers="nagios"
pkggroups="nagios"
options="suid"
source="https://www.nagios-plugins.org/download/$pkgname-$pkgver.tar.gz
- check_openrc"
+ check_openrc
+ nagios-openrc.sudoers"
builddir="$srcdir/$pkgname-$pkgver"
_plugins_dir="/usr/lib/nagios/plugins"
@@ -35,13 +36,17 @@ _plugins_dir="/usr/lib/nagios/plugins"
# Note: Split function takes $name*, so ntp must be before nt etc.
_plugins="breeze by_ssh cluster dbi dhcp dig disk_smb disk dns dummy file_age
fping hpjd http icmp ide_smart ifoperstatus ifstatus ircd ldap load log
- mailq mrtgtraf mrtg mysql nagios ntp nt nwstat openrc overcr pgsql ping
+ mailq mrtgtraf mrtg mysql nagios ntp nt nwstat overcr pgsql ping
procs radius real rpc sensors smtp snmp ssh swap time ups uptime users
wave"
for _sub in $_plugins; do
subpackages="$subpackages $pkgname-$_sub:_plugin"
done
-subpackages="$subpackages $pkgname-tcp $pkgname-all:_all" # all must be the last
+subpackages="$subpackages
+ $pkgname-openrc:_openrc:noarch
+ $pkgname-tcp
+ $pkgname-all:_all" # all must be the last
+_plugins="$_plugins openrc tcp"
prepare() {
@@ -76,8 +81,6 @@ package() {
make DESTDIR="$pkgdir" install
- install -m 755 "$srcdir"/check_openrc "$pkgdir/$_plugins_dir"/
-
# Remove plugins that are useless or doesn't work on Alpine.
local name; for name in apt flexlm oracle; do
rm "$pkgdir/$_plugins_dir"/check_$name
@@ -99,6 +102,16 @@ tcp() {
done
}
+_openrc() {
+ pkgdesc="Nagios plugin check_openrc"
+ depends="$pkgname openrc sudo"
+
+ install -m 755 -D "$srcdir"/check_openrc \
+ "$subpkgdir"/$_plugins_dir/check_openrc
+ install -m 600 -D "$srcdir"/nagios-openrc.sudoers \
+ "$subpkgdir"/etc/sudoers.d/nagios-openrc
+}
+
_plugin() {
local name="${subpkgname#$pkgname-}"
local destdir="$subpkgdir/$_plugins_dir"
@@ -119,7 +132,7 @@ _plugin() {
_all() {
pkgdesc="Metapackage that installs *all* Nagios plugins from the nagios-plugins package"
- depends="$pkgname-tcp"
+ depends=''
local plugin; for plugin in $_plugins; do
depends="$depends $pkgname-$plugin"
done
@@ -138,4 +151,5 @@ _all() {
}
sha512sums="6ffe313a56a305b382f62abc0f0958d7078f9050e1340f30721d6e6f71944b57b1650e90e6835c35dd7c9f3f4b4cee9f235b8382b0811db30b3729daaafc9bc3 nagios-plugins-2.2.1.tar.gz
-12d87542631494df1c961e547c19107a025829509e174e8208111736141c12e20dbf490c55d487af39d47cefca5507cd98c973b7b20ae3f961dcbfd167195d8e check_openrc"
+12d87542631494df1c961e547c19107a025829509e174e8208111736141c12e20dbf490c55d487af39d47cefca5507cd98c973b7b20ae3f961dcbfd167195d8e check_openrc
+171c9ad14d1027541b78df76063e6d34483dd536219fb83e0346e191739529d59c8d6be468af7f1c4c93b20baf9a32879510f15ec3d06aa1eefaf5d785ea8546 nagios-openrc.sudoers"
diff --git a/main/nagios-plugins/nagios-openrc.sudoers b/main/nagios-plugins/nagios-openrc.sudoers
new file mode 100644
index 0000000000..e739580cb2
--- /dev/null
+++ b/main/nagios-plugins/nagios-openrc.sudoers
@@ -0,0 +1,3 @@
+# Rule for /usr/lib/nagios/plugins/check_openrc.
+# Installed by package nagios-plugins-openrc.
+nagios ALL=(root) NOPASSWD: /bin/rc-status