]> git.pld-linux.org Git - packages/flashpolicyd.git/commitdiff
- subpackage for nagios compatible plugin
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 9 Feb 2010 15:33:22 +0000 (15:33 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    flashpolicyd.spec -> 1.2

flashpolicyd.spec

index c0fd0fe87fc75b0a05e5ba200c1c9484f6628600..2b0818c424d0ab7b8365d5f4c8f27fdc4aac7719 100644 (file)
@@ -1,34 +1,57 @@
+%define                plugin  check_flashpolicyd
 Summary:       Daemon to serve Adobe Flash socket policy XML
 Name:          flashpolicyd
 Version:       2.1
 Release:       0.1
 License:       GPL v2
-Group:         Applications/System
+Group:         Networking/Daemons
 URL:           http://code.google.com/p/flashpolicyd/
 Source0:       http://flashpolicyd.googlecode.com/files/%{name}-%{version}.tgz
 # Source0-md5: 0ad1ed0b130cf5850d77600fab90a7c2
 BuildRequires: rpmbuild(macros) >= 1.268
 Requires(post,preun):  /sbin/chkconfig
 Requires:      rc-scripts
-Requires:      ruby
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                pluginconf      /etc/nagios/plugins
+%define                plugindir       %{_prefix}/lib/nagios/plugins
+
 %description
 Daemon to serve Adobe Flash socket policy XML.
 
+%package -n nagios-plugin-%{plugin}
+Summary:       Nagios plugin to check flashpolicyd
+Group:         Networking
+Requires:      nagios-common
+
+%description -n nagios-plugin-%{plugin}
+Nagios plugin to check flashpolicyd.
+
 %prep
 %setup -q
 mv doc rdoc
 
+cat > nagios.cfg <<'EOF'
+# Usage:
+# %{plugin}
+define command {
+       command_name    %{plugin}
+       command_line    %{plugindir}/%{plugin} --host $HOSTADDRESS$ $ARG1$
+}
+EOF
+
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sbindir}}
-install -d $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_sbindir}}
 install -p flashpolicyd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/flashpolicyd
 install -p flashpolicyd.rb $RPM_BUILD_ROOT%{_sbindir}/flashpolicyd
 cp -a flashpolicy.xml $RPM_BUILD_ROOT%{_sysconfdir}/flashpolicy.xml
 
+install -d $RPM_BUILD_ROOT{%{pluginconf},%{plugindir}}
+cp -a nagios.cfg $RPM_BUILD_ROOT%{pluginconf}/%{plugin}.cfg
+install -p %{plugin}.rb $RPM_BUILD_ROOT%{plugindir}/%{plugin}
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -44,8 +67,12 @@ fi
 
 %files
 %defattr(644,root,root,755)
-%doc README check_flashpolicyd.rb
-%doc rdoc
+%doc README rdoc
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/flashpolicy.xml
 %attr(754,root,root) /etc/rc.d/init.d/flashpolicyd
 %attr(755,root,root) %{_sbindir}/flashpolicyd
+
+%files -n nagios-plugin-%{plugin}
+%defattr(644,root,root,755)
+%attr(640,root,nagios) %config(noreplace) %verify(not md5 mtime size) %{pluginconf}/%{plugin}.cfg
+%attr(755,root,root) %{plugindir}/%{plugin}
This page took 0.062647 seconds and 4 git commands to generate.