From ec2973e74362ff605036cd89f54cd4d5d514bc02 Mon Sep 17 00:00:00 2001 From: Pall Sigurdsson Date: Tue, 4 Jun 2013 09:50:13 +0000 Subject: [PATCH] RPM Packaging for check_hpasm --- check_hpasm/nagios-okplugin-check_hpasm.spec | 49 ++++++++++++++++++++ check_hpasm/nrpe.d/check_hpasm.cfg | 3 ++ check_hpasm/sudoers.d/check_hpasm | 2 + 3 files changed, 54 insertions(+) create mode 100644 check_hpasm/nagios-okplugin-check_hpasm.spec create mode 100644 check_hpasm/nrpe.d/check_hpasm.cfg create mode 100644 check_hpasm/sudoers.d/check_hpasm diff --git a/check_hpasm/nagios-okplugin-check_hpasm.spec b/check_hpasm/nagios-okplugin-check_hpasm.spec new file mode 100644 index 0000000..0afde62 --- /dev/null +++ b/check_hpasm/nagios-okplugin-check_hpasm.spec @@ -0,0 +1,49 @@ +%define debug_package %{nil} + +Summary: A Nagios plugin to check HP Hardware Status +Name: nagios-okplugin-check_hpasm +Version: 4.1.2 +Release: 1%{?dist} +License: GPLv2+ +Group: Applications/System +URL: http://opensource.is/trac/wiki/check_hpasm +Source0: http://opensource.ok.is/trac/browser/nagios-plugins/check_hpasm/releases/nagios-okplugin-check_hpasm-%{version}.tar.gz +Requires: nagios-okconfig-nrpe +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Packager: Pall Sigurdsson +BuildArch: noarch + + + +%description +A Nagios plugin to check HP Hardware Status + + +%prep +%setup -q + +%build +perl -pi -e "s|/usr/lib|%{_libdir}|g" sudoers.d/check_hpasm +perl -pi -e "s|/usr/lib|%{_libdir}|g" nrpe.d/check_hpasm.cfg + +%install +rm -rf %{buildroot} +install -D -p -m 0755 check_hpasm %{buildroot}%{_libdir}/nagios/plugins/check_hpasm +install -D -p -m 0440 sudoers.d/check_hpasm %{buildroot}/etc/sudoers.d/check_hpasm +install -D -p -m 0644 nrpe.d/check_hpasm.cfg %{buildroot}/etc/nrpe.d/check_hpasm.cfg + + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +#%doc README LICENSE +#%{_libdir}/nagios/plugins/* +%{_libdir}/nagios/plugins/check_hpasm +/etc/sudoers.d/check_hpasm +/etc/nrpe.d/check_hpasm.cfg + +%changelog +* Tue Jun 4 2013 Pall Sigurdsson 4.1.2-1 +- Initial packaging diff --git a/check_hpasm/nrpe.d/check_hpasm.cfg b/check_hpasm/nrpe.d/check_hpasm.cfg new file mode 100644 index 0000000..ce32dc9 --- /dev/null +++ b/check_hpasm/nrpe.d/check_hpasm.cfg @@ -0,0 +1,3 @@ + + +command[check_updates]=sudo /usr/lib/nagios/plugins/check_hpasm diff --git a/check_hpasm/sudoers.d/check_hpasm b/check_hpasm/sudoers.d/check_hpasm new file mode 100644 index 0000000..061e393 --- /dev/null +++ b/check_hpasm/sudoers.d/check_hpasm @@ -0,0 +1,2 @@ +Defaults:nrpe !requiretty +nrpe ALL = (root) NOPASSWD: /usr/lib/nagios/plugins/check_hpasm