[packages/monitoring-plugin-check_ipmi_sensor_v3] nrpe setup hook

glen glen at pld-linux.org
Fri Jul 21 10:41:08 CEST 2017


commit 54f3834124115eef009d83ca7283a172a04acb01
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Fri Jul 21 11:39:48 2017 +0300

    nrpe setup hook

 check_ipmi_sensor_v3.cfg                    |  2 +-
 monitoring-plugin-check_ipmi_sensor_v3.spec | 13 +++++++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/monitoring-plugin-check_ipmi_sensor_v3.spec b/monitoring-plugin-check_ipmi_sensor_v3.spec
index c3f0158..ce91b17 100644
--- a/monitoring-plugin-check_ipmi_sensor_v3.spec
+++ b/monitoring-plugin-check_ipmi_sensor_v3.spec
@@ -3,7 +3,7 @@
 Summary:	Monitoring plugin to check IPMI sensors
 Name:		monitoring-plugin-%{plugin}
 Version:	3.12
-Release:	0.3
+Release:	0.5
 License:	GPL v3+
 Group:		Networking
 Source0:	https://github.com/thomas-krenn/check_ipmi_sensor_v3/archive/v%{version}/%{plugin}-%{version}.tar.gz
@@ -18,6 +18,7 @@ BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		_sysconfdir	/etc/nagios/plugins
+%define		nrpeddir	/etc/nagios/nrpe.d
 %define		plugindir	%{_prefix}/lib/nagios/plugins
 
 %description
@@ -28,16 +29,24 @@ Nagios/Icinga plugin to check IPMI sensors.
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{nrpeddir},%{plugindir},%{cachedir}}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{nrpeddir},%{plugindir}}
 install -p check_ipmi_sensor $RPM_BUILD_ROOT%{plugindir}/%{plugin}
 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg
+touch $RPM_BUILD_ROOT%{nrpeddir}/%{plugin}.cfg
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%triggerin -- nagios-nrpe
+%nagios_nrpe -a %{plugin} -f %{_sysconfdir}/%{plugin}.cfg
+
+%triggerun -- nagios-nrpe
+%nagios_nrpe -d %{plugin} -f %{_sysconfdir}/%{plugin}.cfg
+
 %files
 %defattr(644,root,root,755)
 %doc README changelog.txt
 %doc contrib/default-combinedgraph.template
 %attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg
+%ghost %{nrpeddir}/%{plugin}.cfg
 %attr(755,root,root) %{plugindir}/%{plugin}
diff --git a/check_ipmi_sensor_v3.cfg b/check_ipmi_sensor_v3.cfg
index 298fab6..9184216 100644
--- a/check_ipmi_sensor_v3.cfg
+++ b/check_ipmi_sensor_v3.cfg
@@ -2,7 +2,7 @@
 # check_ipmi_sensor_v3
 define command {
 	command_name    check_ipmi_sensor_v3
-	command_line    /usr/lib/nagios/plugins/check_ipmi_sensor_v3  --nosel -L user $ARG1$
+	command_line    /usr/lib/nagios/plugins/check_ipmi_sensor_v3 --nosel -L user
 }
 
 define service {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/monitoring-plugin-check_ipmi_sensor_v3.git/commitdiff/210d24d7188463d209788de9e2ef2d9210f0cea7



More information about the pld-cvs-commit mailing list