SPECS: nagios-plugin-check_memcached.spec - v0.02: switch to CPAN source

glen glen at pld-linux.org
Mon Feb 9 17:16:37 CET 2009


Author: glen                         Date: Mon Feb  9 16:16:37 2009 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- v0.02: switch to CPAN source

---- Files affected:
SPECS:
   nagios-plugin-check_memcached.spec (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SPECS/nagios-plugin-check_memcached.spec
diff -u SPECS/nagios-plugin-check_memcached.spec:1.2 SPECS/nagios-plugin-check_memcached.spec:1.3
--- SPECS/nagios-plugin-check_memcached.spec:1.2	Thu Nov 27 10:18:24 2008
+++ SPECS/nagios-plugin-check_memcached.spec	Mon Feb  9 17:16:31 2009
@@ -1,16 +1,29 @@
 # $Revision$, $Date$
+# TODO
+# - package into Nagios/Plugin dir
 %define		plugin	check_memcached
 %include	/usr/lib/rpm/macros.perl
-Summary:	MemCached health check for Nagios
+Summary:	Nagios plugin to observe memcached
 Name:		nagios-plugin-%{plugin}
-Version:	1.1
+Version:	0.02
 Release:	0.1
-License:	BSD
+Epoch:		1
+# same as perl
+License:	GPL v1+ or Artistic
 Group:		Networking
-Source0:	check_memcached
-URL:		http://zilbo.com/
+Source0:	http://www.cpan.org/modules/by-module/Nagios/Nagios-Plugins-Memcached-%{version}.tar.gz
+# Source0-md5:	99154aa60b099a2563f8773f95fd0646
+URL:		http://search.cpan.org/dist/Nagios-Plugins-Memcached/
+BuildRequires:	perl-Nagios-Plugin
+Patch0:		%{name}.patch
+BuildRequires:	perl-devel >= 1:5.8.0
 BuildRequires:	rpm-perlprov >= 4.1-13
 Requires:	nagios-core
+%if %{with tests}
+BuildRequires:	perl-Cache-Memcached
+BuildRequires:	perl-Carp-Clan
+%endif
+Requires:	perl-Cache-Memcached
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -21,31 +34,60 @@
 Nagios plugin to check if memcached is up and running.
 
 %prep
-%setup -qcT
-%{__sed} %{SOURCE0} -e 's, at plugindir@,%{plugindir},' > %{plugin}
+%setup -q -n Nagios-Plugins-Memcached-%{version}
+%patch0 -p1
 
 cat > nagios.cfg <<'EOF'
-# Usage:
-# %{plugin}
+# NOTE: This plugin can execute with all threshold options together.
+
+### check response time(msec) for memcached
+define command {
+	command_name    %{plugin}_response
+	command_line    %{plugindir}/%{plugin} -H $HOSTADDRESS$ -w 3 -c 5
+}
+
+### check cache size ratio(bytes/limit_maxbytes[%]) for memcached
+define command {
+	command_name    %{plugin}_size
+	command_line    %{plugindir}/%{plugin} -H $HOSTADDRESS$ --size-warning 60 --size-critical 80
+}
+
+### check cache hit ratio(get_hits/cmd_get[%]) for memcached
 define command {
-	command_name    %{plugin}
-	command_line    %{plugindir}/%{plugin} -H $HOSTADDRESS$ -p $ARG1$ -k $ARG2$ -t $ARG3$
+	command_name    %{plugin}_hit
+	command_line    %{plugindir}/%{plugin} -H $HOSTADDRESS$ --hit-warning 40 --size-critical 20
 }
 EOF
 
+%build
+%{__perl} Makefile.PL \
+	INSTALLDIRS=vendor
+%{__make}
+
+%{?with_tests:%{__make} test}
+
 %install
 rm -rf $RPM_BUILD_ROOT
+
+%{__make} pure_install \
+	DESTDIR=$RPM_BUILD_ROOT
+
 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{plugindir}}
-install %{plugin} $RPM_BUILD_ROOT%{plugindir}/%{plugin}
 cp -a nagios.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{plugin}.cfg
 
+rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Nagios/Plugins/Memcached/.packlist
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{plugin}.cfg
-%attr(755,root,root) %{plugindir}/%{plugin}
+%attr(755,root,root) %{_bindir}/check_memcached
+%{_mandir}/man3/Nagios::Plugins::Memcached.3pm*
+# XXX -- use singular base dir
+%dir %{perl_vendorlib}/Nagios/Plugins
+%{perl_vendorlib}/Nagios/Plugins/Memcached.pm
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -53,6 +95,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.3  2009/02/09 16:16:31  glen
+- v0.02: switch to CPAN source
+
 Revision 1.2  2008/11/27 09:18:24  glen
 - perlprov, origin site down, edit proper file
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/nagios-plugin-check_memcached.spec?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list