[packages/nagios-plugin-check_raid] - rel 3; use separate config, so nagios_nrpe rpm macros can deal with it
arekm
arekm at pld-linux.org
Tue Dec 11 13:52:46 CET 2018
commit 46ad8dd8b531d61f3b62001d1880b4d452c7ea82
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Dec 11 13:52:40 2018 +0100
- rel 3; use separate config, so nagios_nrpe rpm macros can deal with it
bbu.patch | 37 ++++++++++++++++++-------------------
nagios-plugin-check_raid.spec | 9 +++++++--
2 files changed, 25 insertions(+), 21 deletions(-)
---
diff --git a/nagios-plugin-check_raid.spec b/nagios-plugin-check_raid.spec
index d6b4050..e27d9d2 100644
--- a/nagios-plugin-check_raid.spec
+++ b/nagios-plugin-check_raid.spec
@@ -5,7 +5,7 @@
Summary: Nagios plugin to check current server's RAID status
Name: nagios-plugin-%{plugin}
Version: 4.0.8
-Release: 2
+Release: 3
License: GPL v2
Group: Applications
Source0: https://github.com/glensc/nagios-plugin-check_raid/archive/%{version}/%{name}-%{version}.tar.gz
@@ -98,7 +98,8 @@ install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{nrpeddir},%{plugindir},/etc/sudoers.
DESTDIR=$RPM_BUILD_ROOT
cp -p %{plugin}.cfg $RPM_BUILD_ROOT%{_sysconfdir}
-touch $RPM_BUILD_ROOT%{nrpeddir}/%{plugin}.cfg
+cp -p %{plugin}_bbu.cfg $RPM_BUILD_ROOT%{_sysconfdir}
+touch $RPM_BUILD_ROOT%{nrpeddir}/%{plugin}{,_bbu}.cfg
touch $RPM_BUILD_ROOT/etc/sudoers.d/check_raid
# remove .pl extension
@@ -138,15 +139,19 @@ fi
%triggerin -- nagios-nrpe
%nagios_nrpe -a %{plugin} -f %{_sysconfdir}/%{plugin}.cfg
+%nagios_nrpe -a %{plugin}_bbu -f %{_sysconfdir}/%{plugin}_bbu.cfg
%triggerun -- nagios-nrpe
%nagios_nrpe -d %{plugin} -f %{_sysconfdir}/%{plugin}.cfg
+%nagios_nrpe -a %{plugin}_bbu -f %{_sysconfdir}/%{plugin}_bbu.cfg
%files
%defattr(644,root,root,755)
%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg
+%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}_bbu.cfg
%attr(755,root,root) %{plugindir}/%{plugin}
%ghost %{nrpeddir}/%{plugin}.cfg
+%ghost %{nrpeddir}/%{plugin}_bbu.cfg
%ghost /etc/sudoers.d/check_raid
%dir %{perl_vendorlib}/App/Monitoring
%dir %{perl_vendorlib}/App/Monitoring/Plugin
diff --git a/bbu.patch b/bbu.patch
index efdc7c3..331ebb2 100644
--- a/bbu.patch
+++ b/bbu.patch
@@ -1,25 +1,15 @@
-diff -urN nagios-plugin-check_raid-4.0.8.org/check_raid.cfg nagios-plugin-check_raid-4.0.8/check_raid.cfg
---- nagios-plugin-check_raid-4.0.8.org/check_raid.cfg 2017-09-01 20:58:44.000000000 +0200
-+++ nagios-plugin-check_raid-4.0.8/check_raid.cfg 2018-12-11 13:11:45.426546079 +0100
-@@ -5,7 +5,13 @@
- command_line /usr/lib/nagios/plugins/check_raid $ARG1$
- }
-
--# service template
+diff -urN nagios-plugin-check_raid-4.0.8.org/check_raid_bbu.cfg nagios-plugin-check_raid-4.0.8/check_raid_bbu.cfg
+--- nagios-plugin-check_raid-4.0.8.org/check_raid_bbu.cfg 1970-01-01 01:00:00.000000000 +0100
++++ nagios-plugin-check_raid-4.0.8/check_raid_bbu.cfg 2018-12-11 13:49:55.609515941 +0100
+@@ -0,0 +1,34 @@
++# Usage:
+# check_raid_bbu
+define command {
+ command_name check_raid_bbu
+ command_line /usr/lib/nagios/plugins/check_raid --bbu-monitoring $ARG1$
+}
+
-+# service templates
- define service {
- use generic-service
- name raid
-@@ -19,6 +25,20 @@
- check_command check_raid
- }
-
++# service template
+define service {
+ use generic-service
+ name raid-bbu
@@ -33,7 +23,16 @@ diff -urN nagios-plugin-check_raid-4.0.8.org/check_raid.cfg nagios-plugin-check_
+ check_command check_raid_bbu
+}
+
++# sample check
++#define service {
++# use raid-bbu
++# host_name localhost
++#}
+
- # sample check
- #define service {
- # use raid
++# sample check via nrpe
++#define service {
++# use raid-bbu
++# hostgroups linux-servers
++# host_name localhost
++# check_command check_nrpe!-c check_raid_bbu -t 60
++#}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/nagios-plugin-check_raid.git/commitdiff/46ad8dd8b531d61f3b62001d1880b4d452c7ea82
More information about the pld-cvs-commit
mailing list