Author: glen                         Date: Sat Dec  4 20:46:23 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- up to 1.4.1, not tested even now

---- Files affected:
packages/nagios-n2rrd:
   nagios-n2rrd.spec (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: packages/nagios-n2rrd/nagios-n2rrd.spec
diff -u packages/nagios-n2rrd/nagios-n2rrd.spec:1.1 
packages/nagios-n2rrd/nagios-n2rrd.spec:1.2
--- packages/nagios-n2rrd/nagios-n2rrd.spec:1.1 Tue Oct 14 10:38:19 2008
+++ packages/nagios-n2rrd/nagios-n2rrd.spec     Sat Dec  4 21:46:18 2010
@@ -1,79 +1,105 @@
 # $Revision$, $Date$
 %include       /usr/lib/rpm/macros.perl
-Summary:       Nagios to RRD
+Summary:       N2RRD/RRD2GRAPH Performance data collector and Graph generator
 Name:          nagios-n2rrd
-Version:       1.3.2
-Release:       0.1
+Version:       1.4.1
+Release:       0.4
 License:       GPL v2
 Group:         Applications
 Source0:       http://n2rrd.diglinks.com/download/n2rrd-%{version}.tar.gz
-# Source0-md5: 503dabbc89e1e4f73e5892faf0b41c9d
+# Source0-md5: 2ef1185a840043d9ffd820fc9decf781
 URL:           http://n2rrd.diglinks.com/
 BuildRequires: rpm-perlprov >= 4.1-13
 BuildRequires: sed >= 4.0
 Requires:      nagios-common
+Requires:      perl-rrdtool
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _sysconfdir             /etc/n2rrd
+%define                _sysconfdir             /etc/nagios/n2rrd
 %define                nagiosconfdir   /etc/nagios
 %define                nagiosdatadir   /usr/share/nagios
 # argh XXX lib64?
 %define                nagioslibdir    /usr/lib/nagios
 %define                nagioscgidir    %{nagioslibdir}/cgi
+%define                nagios_status_file      /var/lib/nagios/status.dat
 
 %description
-N2RRD is an Nagios add-on tool, which stores performance data
-generated by Nagios plugins into RRD database. The package also
-includes display tool rrd2graph to view data stored in RRD database.
+Nagios to RRD = n2rrd, is a small perl script, which analyzes
+perf-data string for one or more name=value pairs and creates/updates
+RRA (Round Robin Archives).
+
+The archive can later be viewed by any RRD database graph frontend
+e.g. rrd2graph, Cacti, Drraw, etc.
 
 %prep
 %setup -q -n n2rrd-%{version}
 
-for fdist in $(find templates -name dist-*); do
-       fnew=`echo $fdist | sed 's/dist-//'`
+cp dist-n2rrd.conf n2rrd.conf
+for fdist in $(find templates -name 'dist-*'); do
+       fnew=$(echo $fdist | sed 's/dist-//')
        mv $fdist $fnew
 done
 
-%{__sed} -i -e '1s,#...@bin_perl@,#!%{__perl} -w,' *.pl *.cgi
+%{__sed} -i -e '
+       s|@BIN_PERL@|%{__perl} -w|
+       s|@VERSION@|%{version}|
+       s|@CONF_DIR@|%{_sysconfdir}|
+       s|@RRA_DIR@|/var/lib/nagios/rra|
+       s|@TEMPLATES_DIR@|%{_sysconfdir}/templates|
+       s|@SERVICE_NAME_MAPS@|templates/maps/service_name_maps|
+       s|@LOGFILE@|/var/log/nagios/n2rrd.log|
+       s|@DOCUMENT_ROOT@|/var/cache/n2rrd|
+       s|@CACHE_DIR@|tmp|
+       s|@TMPDIR@|/tmp|
+       s|@RRDTOOL@|%{_bindir}/rrdtool|
+       s|@CGIBIN@|/nagios/cgi-bin|
+       s|@NAGIOS_STATUS_FILE@|%{nagios_status_file}|
+' n2rrd.pl rrd2graph.cgi n2rrd.conf
+
 %{__sed} -i -e 's,@CGIBIN@,%{nagioscgidir},' js/zoom.js
 
 cat > README.PLD <<'EOF'
 Edit %{nagiosconfdir}/nagios.cfg to reflect the following variables
 
 process_performance_data=1
-host_perfdata_command=%{nagioslibdir}/process-host-perfdata-n2rrd
-service_perfdata_command=%{nagioslibdir}/process-service-perfdata-n2rrd
+host_perfdata_command=n2rrd-process-host-perfdata
+service_perfdata_command=n2rrd-process-service-perfdata
 
 Read more about how to integrate from:
-<http://n2rrd.diglinks.com/cgi-bin/trac.cgi/wiki/InstallationGuide>.
+<http://n2rrd.diglinks.com/cgi-bin/trac.fcgi/wiki/InstallationGuide140>
 EOF
 
-cat > nagios.conf <<'EOF'
+cat > n2rrd.cfg <<'EOF'
 define command {
-       command_name    process-host-perfdata-n2rrd
-       command_line    %{nagioslibdir}/n2rrd -c %{_sysconfdir}/n2rrd.conf -T 
$LASTHOSTCHECK$ -H $HOSTNAME$ -s "check_ping" -o "$HOSTOUTPUT$"
+       command_name    n2rrd-process-host-perfdata
+       command_line    %{nagioslibdir}/n2rrd.pl -c %{_sysconfdir}/n2rrd.conf 
-D "HOST" -N "%{nagios_status_file}" -C '$HOSTCHECKCOMMAND$' -T $LASTHOSTCHECK$ 
-H $HOSTNAME$ -s "check_fping" -o "$HOSTPERFDATA$"
 }
+
 define command {
-       command_name    process-service-perfdata-n2rrd
-       command_line    %{nagioslibdir}/n2rrd -c %{_sysconfdir}/n2rrd.conf -T 
$LASTSERVICECHECK$ -H $HOSTNAME$ -s "$SERVICEDESC$" -o "$SERVICEPERFDATA$"
+       command_name    n2rrd-process-service-perfdata
+       command_line    %{nagioslibdir}/n2rrd.pl -c %{_sysconfdir}/n2rrd.conf 
-N "%{nagios_status_file}" -C '$SERVICECHECKCOMMAND$' -e $SERVICEEXECUTIONTIME$ 
-l $SERVICELATENCY$ -T $LASTSERVICECHECK$ -H $HOSTNAME$ -s "$SERVICEDESC$" -o 
"$SERVICEPERFDATA$"
 }
 EOF
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_examplesdir}/%{name}-%{version}}
-cp -a n2rrd.conf $RPM_BUILD_ROOT%{_sysconfdir}
-# we provide templates as examples
-cp -a templates $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-# provide only directory structure
-install -d 
$RPM_BUILD_ROOT%{_sysconfdir}/templates/{maps,graph,rewrite,rra,code}
-
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},/var/lib/nagios/rra}
 install -d 
$RPM_BUILD_ROOT{%{nagioslibdir},%{nagiosconfdir}/plugins,%{nagioscgidir},%{nagiosdatadir}/js}
 install n2rrd.pl $RPM_BUILD_ROOT%{nagioslibdir}/n2rrd
-cp -a nagios.conf $RPM_BUILD_ROOT%{nagiosconfdir}/plugins/n2rrd.conf
+cp -a n2rrd.conf $RPM_BUILD_ROOT%{_sysconfdir}
+cp -a n2rrd.cfg $RPM_BUILD_ROOT%{nagiosconfdir}/plugins/n2rrd.conf
+
+# rrd2graph
+install -d $RPM_BUILD_ROOT{/var/cache/n2rrd,%{_examplesdir}/%{name}-%{version}}
 install rrd2graph.cgi $RPM_BUILD_ROOT%{nagioscgidir}
 cp -a js/zoom.js $RPM_BUILD_ROOT%{nagiosdatadir}/js
+# as default templates are too intrusive, we provide them as examples and
+# package only essential.
+install -d 
$RPM_BUILD_ROOT%{_sysconfdir}/templates/{maps,graph,rewrite,rra,code}
+cp -a templates/environment.t $RPM_BUILD_ROOT%{_sysconfdir}/templates
+cp -a templates/maps $RPM_BUILD_ROOT%{_sysconfdir}/templates
+cp -a templates $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -82,11 +108,24 @@
 %defattr(644,root,root,755)
 %doc CHANGELOG UPGRADE README.PLD
 %dir %{_sysconfdir}
-%{_sysconfdir}/templates
+%dir %{_sysconfdir}/templates
+%dir %{_sysconfdir}/templates/code
+%dir %{_sysconfdir}/templates/graph
+%dir %{_sysconfdir}/templates/maps
+%dir %{_sysconfdir}/templates/rewrite
+%dir %{_sysconfdir}/templates/rra
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/n2rrd.conf
 %config(noreplace) %verify(not md5 mtime size) 
%{nagiosconfdir}/plugins/n2rrd.conf
-%attr(755,root,root) %{nagioscgidir}/rrd2graph.cgi
 %attr(755,root,root) %{nagioslibdir}/n2rrd
+
+%config(noreplace) %verify(not md5 mtime size) 
%{_sysconfdir}/templates/environment.t
+%config(noreplace) %verify(not md5 mtime size) 
%{_sysconfdir}/templates/maps/rgb.txt
+%config(noreplace) %verify(not md5 mtime size) 
%{_sysconfdir}/templates/maps/rra_plugin_maps
+%config(noreplace) %verify(not md5 mtime size) 
%{_sysconfdir}/templates/maps/service_name_maps
+
+# rrd2graph
+%attr(769,root,http) /var/cache/n2rrd
+%attr(755,root,root) %{nagioscgidir}/rrd2graph.cgi
 %dir %{nagiosdatadir}/js
 %{nagiosdatadir}/js/zoom.js
 %{_examplesdir}/%{name}-%{version}
@@ -97,5 +136,8 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.2  2010/12/04 20:46:18  glen
+- up to 1.4.1, not tested even now
+
 Revision 1.1  2008/10/14 08:38:19  glen
 - new, only packaging
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/nagios-n2rrd/nagios-n2rrd.spec?r1=1.1&r2=1.2&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to