+# $Revision: 1.123 $, $Date: 2012-06-05 12:38:02 $
# TODO:
# - package contrib scripts as %doc
# - perl modules with Collectd classes package to separate package
# libjvm . . . . . . . no (javac not found)
# libkstat . . . . . . no (Solaris only)
# libkvm . . . . . . . no (BSD only)
-# libmodbus . . . . . . no (pkg-config doesn't know modbus) (http://www.libmodbus.org/)
# libnetapp . . . . . . no (netapp_api.h not found) (properitary)
# libperfstat . . . . . no (AIX only)
# librabbitmq . . . . . no (amqp.h not found) (http://hg.rabbitmq.com/rabbitmq-c/)
# ipvs . . . . . . . . no (ip_vs.h not found - llh to be fixed)
# java . . . . . . . . no
# lpar... . . . . . . . no
-# modbus . . . . . . . no
# multimeter . . . . . no ?
# netapp . . . . . . . no
# onewire . . . . . . . no (needs libowfs)
%bcond_without iptables # iptables plugin
%bcond_without libesmtp # notify_email plugin
%bcond_without libvirt # libvirt plugin
+%bcond_without modbus # modbus plugin
%bcond_with multimeter # multimeter plugin
%bcond_without mysql # MySQL plugin
%bcond_without netlink # netlink plugin
Summary: Collects system information in RRD files
Summary(pl.UTF-8): Zbieranie informacji o systemie w plikach RRD
Name: collectd
-Version: 5.0.0
+Version: 5.1.0
Release: 4
License: GPL v2
Group: Daemons
Source0: http://collectd.org/files/%{name}-%{version}.tar.bz2
-# Source0-md5: 7bfea6e82d35b36f16d1da2c71397213
+# Source0-md5: 141570150b4608c0c567330f6f146e0f
Source1: %{name}.conf
Source2: %{name}.init
Source3: %{name}-http.conf
Source4: %{name}-lighttpd.conf
+Source5: %{name}-apache.conf
Source10: %{name}-df.conf
Source11: %{name}-rrdtool.conf
Patch0: %{name}-collection.patch
Patch1: compile.patch
-Patch2: netfilter.patch
-Patch3: libnotify.patch
-Patch4: noquote.patch
-Patch5: libiptc.patch
+Patch2: noquote.patch
+Patch3: libiptc.patch
+Patch4: pld.patch
+Patch5: %{name}-netlink.patch
+Patch6: %{name}-modbus.patch
URL: http://collectd.org/
%{?with_ipmi:BuildRequires: OpenIPMI-devel >= 2.0.14-3}
BuildRequires: autoconf
BuildRequires: automake
%{?with_curl:BuildRequires: curl-devel}
-BuildRequires: hal-devel
%{?with_iptables:BuildRequires: iptables-devel >= 1.4.1.1-4}
BuildRequires: libdbi-devel
%{?with_libesmtp:BuildRequires: libesmtp-devel}
BuildRequires: libltdl-devel
BuildRequires: libmemcached-devel
-BuildRequires: libnetlink-devel
-%{?with_netlink:BuildRequires: libnetlink-devel}
+%{?with_netlink:BuildRequires: libnetlink-devel >= 3.0.0}
%{?with_libvirt:BuildRequires: libnl1-devel}
-%{?with_notify:BuildRequires: libnotify-devel >= 0.7.0}
+%{?with_notify:BuildRequires: libnotify-devel}
%{?with_ping:BuildRequires: liboping-devel}
%{?with_dns:BuildRequires: libpcap-devel}
BuildRequires: libstatgrab-devel >= 0.12
BuildRequires: libtool
%{?with_xml:BuildRequires: libxml2-devel}
%{?with_sensors:BuildRequires: lm_sensors-devel}
+%{?with_modbus:BuildRequires: libmodbus-devel}
%{?with_mysql:BuildRequires: mysql-devel}
%{?with_libvirt:BuildRequires: libvirt-devel}
BuildRequires: ncurses-devel
%{?with_xmms:BuildRequires: xmms-devel}
BuildRequires: yajl-devel
Requires(post,preun): /sbin/chkconfig
+Requires: %{name}-libs = %{version}-%{release}
Requires: rc-scripts
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Requires: perl(URI::Escape)
Requires: webserver(cgi)
Suggests: fonts-TTF-DejaVu
+Conflicts: apache-base < 2.4.0-1
%description collection
Web script for collectd.
Summary(pl.UTF-8): Web script for collectd
Group: Applications/WWW
Requires: %{name} = %{version}-%{release}
+Requires: perl-Collectd = %{version}-%{release}
Requires: perl(Config::General)
Requires: perl(HTML::Entities)
+Requires: perl(Regexp::Common)
Requires: perl(RRDs)
Requires: webserver(cgi)
Suggests: fonts-TTF-DejaVu
+Conflicts: apache-base < 2.4.0-1
%description collection3
Web script for collectd.
is important to generate random numbers, which are used for
encryption, authorization and similar tasks.
+%package ethstat
+Summary: ethstat-plugin for collectd
+Summary(pl.UTF-8): Wyczka ethstat dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description ethstat
+The ethstat plugin reads performance statistics directly from ethernet
+cards
+
%package exec
Summary: exec-plugin for collectd
Summary(pl.UTF-8): Wtyczka exec dla collectd
%description mbmon
The mbmon plugin uses mbmon to retrieve temperature, voltage, etc.
+%package md
+Summary: md plugin for collectd
+Summary(pl.UTF-8): Wtyczka md dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description md
+The md plugin reports the number of disks in various states in Linux
+software RAID devices.
+
%package memcachec
Summary: memcachec-plugin for collectd
Summary(pl.UTF-8): Wtyczka memcachec dla collectd
%description memory
Collects physical memory utilization for collectd.
+%package modbus
+Summary: modbus-plugin for collectd
+Summary(pl.UTF-8): Wtyczka modbus dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description modbus
+The Modbus plugin connects to a Modbus "slave" via Modbus/TCP and
+reads register values. It supports reading single registers (unsigned 16
+bit values), large integer values (unsigned 32 bit values) and
+floating point values (two registers interpreted as IEEE floats in big
+endian notation).
+
%package multimeter
Summary: multimeter-plugin for collectd
Summary(pl.UTF-8): Wtyczka multimeter dla collectd
- parameters for each NTP server used to sync time: offset,
dispersion, delay.
+%package numa
+Summary: numa-plugin for collectd
+Summary(pl.UTF-8): Wtyczka numa dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description numa
+The numa plugin reports statistics of the Non-Uniform Memory
+Access (NUMA) subsystem of Linux.
+
%package nut
Summary: nut-plugin for collectd
Summary(pl.UTF-8): Wtyczka nut dla collectd
Collects information about the virtual servers running on a system,
using Linux-Vserver.
+%package write_graphite
+Summary: write_graphite-plugin for collectd
+Summary(pl.UTF-8): wtyczka write_graphite dla collectd
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description write_graphite
+The Write Graphite plugin stores values in Carbon, the storage layer
+of Graphite.
+The plugin aims to be very efficient. It keeps the TCP connection to
+Carbon open in order to minimize the connection handshake overhead. It
+buffers the data in a buffer to send many lines at once, rather than
+generating lots of small network packets. The size of this buffer
+(1428 bytes) is dimensioned so that the buffer as well as the TCP and
+IP header fit into one Ethernet frame and can (hopefully) be delivered
+without fragmentation.
+
%package write_http
Summary: write_http-plugin for collectd
Summary(pl.UTF-8): Wtyczka write_http dla collectd
%patch0 -p1
%patch1 -p1
%patch2 -p1
-%patch3 -p1
-%patch4 -p1
+%patch3 -p0
+%patch4 -p0
%patch5 -p1
+#%patch6 -p1
%build
%{__libtoolize}
%configure \
CPPFLAGS="-Wno-unused-but-set-variable" \
c_cv_have_libperl=yes \
+ --with-libiptc=/usr \
--with-libstatgrab=/usr \
--with-lm-sensors=/usr \
--with-libmysql=/usr \
%{__enable_disable netlink} \
%{__enable_disable notify notify_desktop} \
%{__enable_disable libesmtp notify_email} \
+ %{__enable_disable modbus } \
%{__enable_disable libvirt} \
%{__enable_disable ups nut} \
%{__enable_disable ping} \
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_var}/{log/,lib/%{name}},/etc/{rc.d/init.d/,collectd.d}} \
- $RPM_BUILD_ROOT{%{_appdir}/cgi-bin,%{_webappdir},%{_pkglibdir},%{perl_vendorlib}/}
+ $RPM_BUILD_ROOT{%{_appdir}/cgi-bin,%{_webappdir},%{_pkglibdir},%{perl_vendorlib}/,%{_mandir}/man3}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
# Web frontend:
install contrib/collection.conf $RPM_BUILD_ROOT%{_webappdir}
install contrib/collection.cgi $RPM_BUILD_ROOT%{_appdir}/cgi-bin
-install %{SOURCE3} $RPM_BUILD_ROOT%{_webappdir}/apache.conf
+install %{SOURCE5} $RPM_BUILD_ROOT%{_webappdir}/apache.conf
install %{SOURCE3} $RPM_BUILD_ROOT%{_webappdir}/httpd.conf
install %{SOURCE4} $RPM_BUILD_ROOT%{_webappdir}/lighttpd.conf
cp -R contrib/collection3 $RPM_BUILD_ROOT%{_appdir}
+mv $RPM_BUILD_ROOT%{_appdir}/collection3/etc/collection.conf $RPM_BUILD_ROOT%{_webappdir}/collection3.conf
+ln -sf %{_webappdir}/collection3.conf $RPM_BUILD_ROOT%{_appdir}/collection3/etc/collection.conf
+sed -i -e 's@#DataDir "/var/lib/collectd/rrd"@DataDir "%{_var}/lib/%{name}"@' $RPM_BUILD_ROOT%{_webappdir}/collection3.conf
### Configs instalation ###
for i in `egrep "^(#|)LoadPlugin" src/collectd.conf |awk '{print $NF}' ` ; do
install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/collectd.d/rrdtool.conf
mv $RPM_BUILD_ROOT%{_datadir}/perl5/Collectd* $RPM_BUILD_ROOT%{perl_vendorlib}/
+mv $RPM_BUILD_ROOT/usr/man/man3/Collectd::Unixsock.3pm $RPM_BUILD_ROOT%{_mandir}/man3/
# Cleanups:
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la
%module_scripts dns
%module_scripts email
%module_scripts entropy
+%module_scripts ethstat
%module_scripts exec
%module_scripts filecount
%module_scripts fscache
%module_scripts match_timediff
%module_scripts match_value
%module_scripts mbmon
+%module_scripts md
%module_scripts memcachec
%module_scripts memcached
%module_scripts memory
%module_scripts notify_desktop
%module_scripts notify_email
%module_scripts ntpd
+%module_scripts numa
%module_scripts nut
%module_scripts olsrd
%module_scripts openvpn
%module_scripts varnish
%module_scripts vmem
%module_scripts vserver
+%module_scripts write_graphite
%module_scripts write_http
%module_scripts wireless
%module_scripts xmms
%triggerun collection -- apache1 < 1.3.37-3, apache1-base
%webapp_unregister apache %{_webapp}
-%triggerin collection -- apache < 2.2.0, apache-base
+%triggerin collection -- apache-base
%webapp_register httpd %{_webapp}
-%triggerun collection -- apache < 2.2.0, apache-base
+%triggerun collection -- apache-base
%webapp_unregister httpd %{_webapp}
%triggerin collection -- lighttpd
%doc AUTHORS ChangeLog README TODO contrib
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
%dir %{_sysconfdir}/%{name}.d
+%dir %{_webappdir}
%attr(755,root,root) %{_sbindir}/collectd
%attr(755,root,root) %{_sbindir}/collectdmon
%attr(755,root,root) %{_bindir}/collectdctl
%files collection
%defattr(644,root,root,755)
-%dir %{_webappdir}
%config(noreplace) %verify(not md5 mtime size) %{_webappdir}/collection.conf
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/apache.conf
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webappdir}/httpd.conf
%files collection3
%defattr(644,root,root,755)
-%{_appdir}/collection3
+%doc contrib/collection3/README
+%config(noreplace) %verify(not md5 mtime size) %{_webappdir}/collection3.conf
+%dir %{_appdir}/collection3
+%dir %{_appdir}/collection3/bin
+%attr(755,root,root) %{_appdir}/collection3/bin/*.cgi
+%{_appdir}/collection3/etc
+%{_appdir}/collection3/lib
+%{_appdir}/collection3/share
########## PLUGINS:
%if %{with xml}
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/entropy.conf
%attr(755,root,root) %{_libdir}/%{name}/entropy.so
+%files ethstat
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/ethstat.conf
+%attr(755,root,root) %{_libdir}/%{name}/ethstat.so
+
%files exec
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/exec.conf
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/mbmon.conf
%attr(755,root,root) %{_libdir}/%{name}/mbmon.so
+%files md
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/md.conf
+%attr(755,root,root) %{_libdir}/%{name}/md.so
+
%files memcachec
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/memcachec.conf
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/memory.conf
%attr(755,root,root) %{_libdir}/%{name}/memory.so
+%if %{with modbus}
+%files modbus
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/modbus.conf
+%attr(755,root,root) %{_libdir}/%{name}/modbus.so
+%endif
+
%if %{with multimeter}
%files multimeter
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/ntpd.conf
%attr(755,root,root) %{_libdir}/%{name}/ntpd.so
+%files numa
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/numa.conf
+%attr(755,root,root) %{_libdir}/%{name}/numa.so
+
%if %{with ups}
%files nut
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/uuid.conf
%attr(755,root,root) %{_libdir}/%{name}/uuid.so
+%if %{with varnish}
%files varnish
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/varnish.conf
%attr(755,root,root) %{_libdir}/%{name}/varnish.so
+%endif
%files vmem
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/wireless.conf
%attr(755,root,root) %{_libdir}/%{name}/wireless.so
+%files write_graphite
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/write_graphite.conf
+%attr(755,root,root) %{_libdir}/%{name}/write_graphite.so
+
%files write_http
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.d/write_http.conf
%defattr(644,root,root,755)
%{perl_vendorlib}/Collectd.pm
%{perl_vendorlib}/Collectd
+%{_mandir}/man3/*.3*