Merge branch 'collectd-4.3'
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 24 Mar 2008 12:36:17 +0000 (13:36 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 24 Mar 2008 12:36:17 +0000 (13:36 +0100)
18 files changed:
build.sh
configure.in
contrib/README
contrib/redhat/apache.conf [new file with mode: 0644]
contrib/redhat/collectd.conf [new file with mode: 0644]
contrib/redhat/collectd.spec [new file with mode: 0644]
contrib/redhat/email.conf [new file with mode: 0644]
contrib/redhat/init.d-collectd [new file with mode: 0644]
contrib/redhat/mysql.conf [new file with mode: 0644]
contrib/redhat/nginx.conf [new file with mode: 0644]
contrib/redhat/sensors.conf [new file with mode: 0644]
contrib/redhat/snmp.conf [new file with mode: 0644]
src/collectd-unixsock.pod
src/liboconfig/oconfig.c
src/liboconfig/parser.y
src/perl.c
src/sensors.c
src/wireless.c

index 89d3a68..3efb44f 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -1,9 +1,15 @@
 #! /bin/sh
 
+libtoolize=libtoolize
+
+if which glibtoolize > /dev/null 2>&1; then
+       libtoolize=glibtoolize
+fi
+
 set -x
 
 autoheader \
 && aclocal \
-&& libtoolize --ltdl --copy --force \
+&& $libtoolize --ltdl --copy --force \
 && automake --add-missing --copy \
 && autoconf
index e3662b7..d53706d 100644 (file)
@@ -1042,8 +1042,6 @@ AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
 AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
 
-with_libstatgrab="yes"
-with_libdevstat="no"
 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
 [
        if test "x$withval" != "xno" -a "x$withval" != "xyes"
index 0f532f6..1c34812 100644 (file)
@@ -68,6 +68,10 @@ prints a bash-script to STDOUT which should do most of the work for you. You
 may still need to do some things by hand, read `README.migration' for more
 details.
 
+redhat/
+-------
+  Spec-file and affiliated files to build an RedHat RPM package of collectd.
+
 snmp-data.conf
 --------------
   Sample configuration for the SNMP plugin. This config includes a few standard
diff --git a/contrib/redhat/apache.conf b/contrib/redhat/apache.conf
new file mode 100644 (file)
index 0000000..e9c767a
--- /dev/null
@@ -0,0 +1,8 @@
+LoadPlugin apache
+#<Plugin apache>
+#      URL "http://localhost/status?auto"
+#      User "www-user"
+#      Password "secret"
+#      CACert "/etc/ssl/ca.crt"
+#</Plugin>
+
diff --git a/contrib/redhat/collectd.conf b/contrib/redhat/collectd.conf
new file mode 100644 (file)
index 0000000..7a026fa
--- /dev/null
@@ -0,0 +1,209 @@
+#
+# Config file for collectd(1).
+# Please read collectd.conf(5) for a list of options.
+# http://collectd.org/
+#
+
+#Hostname    "localhost"
+FQDNLookup   true
+BaseDir     "/var/lib/collectd"
+PIDFile     "/var/run/collectd.pid"
+PluginDir   "/usr/lib/collectd"
+TypesDB     "/usr/lib/collectd/types.db"
+Interval     10
+ReadThreads  5
+
+LoadPlugin apcups
+#LoadPlugin apple_sensors
+LoadPlugin battery
+LoadPlugin cpu
+LoadPlugin cpufreq
+LoadPlugin csv
+LoadPlugin df
+LoadPlugin disk
+LoadPlugin dns
+LoadPlugin entropy
+LoadPlugin exec
+LoadPlugin hddtemp
+LoadPlugin interface
+#LoadPlugin iptables
+#LoadPlugin ipvs
+LoadPlugin irq
+#LoadPlugin libvirt
+LoadPlugin load
+LoadPlugin logfile
+LoadPlugin mbmon
+LoadPlugin memcached
+LoadPlugin memory
+LoadPlugin multimeter
+#LoadPlugin netlink
+LoadPlugin network
+LoadPlugin nfs
+LoadPlugin ntpd
+#LoadPlugin nut
+LoadPlugin perl
+LoadPlugin ping
+LoadPlugin processes
+LoadPlugin rrdtool
+LoadPlugin serial
+LoadPlugin swap
+LoadPlugin syslog
+#LoadPlugin tape
+LoadPlugin tcpconns
+LoadPlugin unixsock
+LoadPlugin users
+LoadPlugin uuid
+LoadPlugin vserver
+LoadPlugin wireless
+#LoadPlugin xmms
+
+
+#<Plugin apcups>
+#      Host "localhost"
+#      Port "3551"
+#</Plugin>
+
+#<Plugin csv>
+#      DataDir "/usr/var/lib/collectd/csv"
+#      StoreRates false
+#</Plugin>
+
+#<Plugin df>
+#      Device "/dev/hda1"
+#      Device "192.168.0.2:/mnt/nfs"
+#      MountPoint "/home"
+#      FSType "ext3"
+#      IgnoreSelected false
+#</Plugin>
+
+#<Plugin dns>
+#      Interface "eth0"
+#      IgnoreSource "192.168.0.1"
+#</Plugin>
+
+#<Plugin exec>
+#      Exec "user:group" "/path/to/exec"
+#      NotificationExec "/path/to/exec"
+#</Plugin>
+
+#<Plugin hddtemp>
+#      Host "127.0.0.1"
+#      Port "7634"
+#      TranslateDevicename false
+#</Plugin>
+
+#<Plugin interface>
+#      Interface "eth0"
+#      IgnoreSelected false
+#</Plugin>
+
+#<Plugin iptables>
+#      Chain table chain
+#</Plugin>
+
+#<Plugin irq>
+#      Irq 7
+#      Irq 8
+#      Irq 9
+#      IgnoreSelected true
+#</Plugin>
+
+#<Plugin libvirt>
+#      Connection "xen:///"
+#      RefreshInterval 60
+#      Domain "name"
+#      BlockDevice "name:device"
+#      InterfaceDevice "name:device"
+#      IgnoreSelected false
+#      HostnameFormat name
+#</Plugin>
+
+#<Plugin logfile>
+#      LogLevel info
+#      File STDOUT
+#      Timestamp true
+#</Plugin>
+
+#<Plugin mbmon>
+#      Host "127.0.0.1"
+#      Port "411"
+#</Plugin>
+
+#<Plugin memcached>
+#      Host "127.0.0.1"
+#      Port "11211"
+#</Plugin>
+
+#<Plugin netlink>
+#      Interface "All"
+#      VerboseInterface "All"
+#      QDisc "eth0" "pfifo_fast-1:0"
+#      Class "ppp0" "htb-1:10"
+#      Filter "ppp0" "u32-1:0"
+#      IgnoreSelected false
+#</Plugin>
+
+#<Plugin network>
+#      Server "ff18::efc0:4a42" "25826"
+#      Server "239.192.74.66" "25826"
+#      Listen "ff18::efc0:4a42" "25826"
+#      Listen "239.192.74.66" "25826"
+#      TimeToLive "128"
+#      Forward false
+#      CacheFlush 1800
+#</Plugin>
+
+#<Plugin ntpd>
+#      Host "localhost"
+#      Port 123
+#      ReverseLookups false
+#</Plugin>
+
+#<Plugin nut>
+#      UPS "upsname@hostname:port"
+#</Plugin>
+
+#<Plugin perl>
+#      IncludeDir "/my/include/path"
+#      BaseName "Collectd::Plugin"
+#      EnableDebugger ""
+#      LoadPlugin foo
+#</Plugin>
+
+#<Plugin ping>
+#      Host "host.foo.bar"
+#      TTL 255
+#</Plugin>
+
+#<Plugin processes>
+#      Process "name"
+#</Plugin>
+
+#<Plugin rrdtool>
+#      DataDir "/usr/var/lib/collectd/rrd"
+#      CacheTimeout 120
+#      CacheFlush   900
+#</Plugin>
+
+#<Plugin syslog>
+#      LogLevel info
+#</Plugin>
+
+#<Plugin tcpconns>
+#      ListeningPorts false
+#      LocalPort "25"
+#      RemotePort "25"
+#</Plugin>
+
+#<Plugin unixsock>
+#      SocketFile "/usr/var/run/collectd-unixsock"
+#      SocketGroup "collectd"
+#      SocketPerms "0660"
+#</Plugin>
+
+#<Plugin uuid>
+#      UUIDFile "/etc/uuid"
+#</Plugin>
+
+Include "/etc/collectd.d"
+
diff --git a/contrib/redhat/collectd.spec b/contrib/redhat/collectd.spec
new file mode 100644 (file)
index 0000000..bce7647
--- /dev/null
@@ -0,0 +1,410 @@
+Summary:       Statistics collection daemon for filling RRD files.
+Name:          collectd
+Version:       4.3.1
+Release:       0.centos5
+Source:                http://collectd.org/files/%{name}-%{version}.tar.gz
+License:       GPL
+Group:         System Environment/Daemons
+BuildRoot:     %{_tmppath}/%{name}-%{version}-root
+BuildPrereq:   lm_sensors-devel, mysql-devel, rrdtool-devel, curl-devel, libpcap-devel, net-snmp-devel, libstatgrab-devel, mysql-devel, libxml2-devel, libiptcdata-devel
+Requires:      rrdtool, perl-Regexp-Common, libstatgrab
+Packager:      RightScale <support@rightscale.com>
+Vendor:                collectd development team <collectd@verplant.org>
+
+%description
+collectd is a small daemon which collects system information periodically and
+provides mechanisms to monitor and store the values in a variety of ways. It
+is written in C for performance. Since the daemon doesn't need to startup
+every time it wants to update the values it's very fast and easy on the
+system. Also, the statistics are very fine grained since the files are updated
+every 10 seconds.
+
+%package apache
+Summary:       apache-plugin for collectd.
+Group:         System Environment/Daemons
+Requires:      collectd = %{version}, curl
+%description apache
+This plugin collects data provided by Apache's `mod_status'.
+
+%package email
+Summary:       email-plugin for collectd.
+Group:         System Environment/Daemons
+Requires:      collectd = %{version}, spamassassin
+%description email
+This plugin collects data provided by spamassassin.
+
+%package mysql
+Summary:       mysql-module for collectd.
+Group:         System Environment/Daemons
+Requires:      collectd = %{version}, mysql
+%description mysql
+MySQL querying plugin. This plugins provides data of issued commands, called
+handlers and database traffic.
+
+%package nginx
+Summary:       nginx-plugin for collectd.
+Group:         System Environment/Daemons
+Requires:      collectd = %{version}, curl
+%description nginx
+This plugin gets data provided by nginx.
+
+%package sensors
+Summary:       libsensors-module for collectd.
+Group:         System Environment/Daemons
+Requires:      collectd = %{version}, lm_sensors
+%description sensors
+This plugin for collectd provides querying of sensors supported by lm_sensors.
+
+%package snmp
+Summary:       snmp-module for collectd.
+Group:         System Environment/Daemons
+Requires:      collectd = %{version}, net-snmp
+%description snmp
+This plugin for collectd allows querying of network equipment using SNMP.
+
+%prep
+rm -rf $RPM_BUILD_ROOT
+%setup
+
+%build
+./configure CFLAGS=-"DLT_LAZY_OR_NOW='RTLD_LAZY|RTLD_GLOBAL'" --prefix=%{_prefix} --sbindir=%{_sbindir} --mandir=%{_mandir} --libdir=%{_libdir} --sysconfdir=%{_sysconfdir} --enable-apache --enable-email --enable-mysql --enable-dns
+make
+
+%install
+make install DESTDIR=$RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
+mkdir -p $RPM_BUILD_ROOT/var/www/cgi-bin
+cp contrib/redhat/init.d-collectd $RPM_BUILD_ROOT/etc/rc.d/init.d/collectd
+cp contrib/collection.cgi $RPM_BUILD_ROOT/var/www/cgi-bin
+mkdir -p $RPM_BUILD_ROOT/etc/collectd.d
+mkdir -p $RPM_BUILD_ROOT/var/lib/collectd
+### Clean up docs
+find contrib/ -type f -exec %{__chmod} a-x {} \;
+###Modify Config for Redhat Based Distros
+cp contrib/redhat/collectd.conf $RPM_BUILD_ROOT/etc/collectd.conf
+sed -i 's:#BaseDir     "/usr/var/lib/collectd":BaseDir     "/var/lib/collectd":' $RPM_BUILD_ROOT/etc/collectd.conf
+sed -i 's:#PIDFile     "/usr/var/run/collectd.pid":PIDFile     "/var/run/collectd.pid":' $RPM_BUILD_ROOT/etc/collectd.conf
+sed -i 's:#PluginDir   "/usr/lib/collectd":PluginDir   "/usr/lib/collectd":' $RPM_BUILD_ROOT/etc/collectd.conf
+sed -i 's:#TypesDB     "/usr/lib/collectd/types.db":TypesDB     "/usr/lib/collectd/types.db":' $RPM_BUILD_ROOT/etc/collectd.conf
+sed -i 's:#Interval     10:Interval     10:' $RPM_BUILD_ROOT/etc/collectd.conf
+sed -i 's:#ReadThreads  5:ReadThreads  5:' $RPM_BUILD_ROOT/etc/collectd.conf
+##Move config contribs
+cp contrib/redhat/apache.conf $RPM_BUILD_ROOT/etc/collectd.d/apache.conf
+cp contrib/redhat/email.conf $RPM_BUILD_ROOT/etc/collectd.d/email.conf
+cp contrib/redhat/sensors.conf $RPM_BUILD_ROOT/etc/collectd.d/sensors.conf
+cp contrib/redhat/mysql.conf $RPM_BUILD_ROOT/etc/collectd.d/mysql.conf
+cp contrib/redhat/nginx.conf $RPM_BUILD_ROOT/etc/collectd.d/nginx.conf
+cp contrib/redhat/snmp.conf $RPM_BUILD_ROOT/etc/collectd.d/snmp.conf
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+/sbin/chkconfig --add collectd
+/sbin/chkconfig collectd on
+
+%preun
+if [ "$1" = 0 ]; then
+   /sbin/chkconfig collectd off
+   /etc/init.d/collectd stop
+   /sbin/chkconfig --del collectd
+fi
+exit 0
+
+%postun
+if [ "$1" -ge 1 ]; then
+    /etc/init.d/collectd restart
+fi
+exit 0
+
+%files
+%defattr(-,root,root)
+%doc AUTHORS COPYING ChangeLog INSTALL NEWS README contrib/
+%attr(0644,root,root) %config(noreplace) /etc/collectd.conf
+%attr(0755,root,root) /etc/rc.d/init.d/collectd
+%attr(0755,root,root) /var/www/cgi-bin/collection.cgi
+%attr(0755,root,root) %{_sbindir}/collectd
+%attr(0755,root,root) %{_bindir}/collectd-nagios
+%attr(0755,root,root) %{_sbindir}/collectdmon
+%attr(0644,root,root) %{_mandir}/man1/*
+%attr(0644,root,root) %{_mandir}/man5/*
+%dir /etc/collectd.d
+
+%attr(0644,root,root) %{_libdir}/%{name}/apcups.so*
+%attr(0644,root,root) %{_libdir}/%{name}/apcups.la
+
+#%attr(0644,root,root) %{_libdir}/%{name}/apple_sensors.so*
+#%attr(0644,root,root) %{_libdir}/%{name}/apple_sensors.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/battery.so*
+%attr(0644,root,root) %{_libdir}/%{name}/battery.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/cpufreq.so*
+%attr(0644,root,root) %{_libdir}/%{name}/cpufreq.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/cpu.so*
+%attr(0644,root,root) %{_libdir}/%{name}/cpu.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/csv.so*
+%attr(0644,root,root) %{_libdir}/%{name}/csv.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/df.so*
+%attr(0644,root,root) %{_libdir}/%{name}/df.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/disk.so*
+%attr(0644,root,root) %{_libdir}/%{name}/disk.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/dns.so*
+%attr(0644,root,root) %{_libdir}/%{name}/dns.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/entropy.so*
+%attr(0644,root,root) %{_libdir}/%{name}/entropy.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/exec.so*
+%attr(0644,root,root) %{_libdir}/%{name}/exec.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/hddtemp.so*
+%attr(0644,root,root) %{_libdir}/%{name}/hddtemp.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/interface.so*
+%attr(0644,root,root) %{_libdir}/%{name}/interface.la
+
+#%attr(0644,root,root) %{_libdir}/%{name}/iptables.so*
+#%attr(0644,root,root) %{_libdir}/%{name}/iptables.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/irq.so*
+%attr(0644,root,root) %{_libdir}/%{name}/irq.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/load.so*
+%attr(0644,root,root) %{_libdir}/%{name}/load.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/logfile.so*
+%attr(0644,root,root) %{_libdir}/%{name}/logfile.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/mbmon.so
+%attr(0644,root,root) %{_libdir}/%{name}/mbmon.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/memcached.so*
+%attr(0644,root,root) %{_libdir}/%{name}/memcached.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/memory.so*
+%attr(0644,root,root) %{_libdir}/%{name}/memory.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/multimeter.so*
+%attr(0644,root,root) %{_libdir}/%{name}/multimeter.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/network.so*
+%attr(0644,root,root) %{_libdir}/%{name}/network.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/nfs.so*
+%attr(0644,root,root) %{_libdir}/%{name}/nfs.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/ntpd.so*
+%attr(0644,root,root) %{_libdir}/%{name}/ntpd.la
+
+#%attr(0644,root,root) %{_libdir}/%{name}/nut.so*
+#%attr(0644,root,root) %{_libdir}/%{name}/nut.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/perl.so*
+%attr(0644,root,root) %{_libdir}/%{name}/perl.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/ping.so*
+%attr(0644,root,root) %{_libdir}/%{name}/ping.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/processes.so*
+%attr(0644,root,root) %{_libdir}/%{name}/processes.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/rrdtool.so*
+%attr(0644,root,root) %{_libdir}/%{name}/rrdtool.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/serial.so*
+%attr(0644,root,root) %{_libdir}/%{name}/serial.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/swap.so*
+%attr(0644,root,root) %{_libdir}/%{name}/swap.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/syslog.so*
+%attr(0644,root,root) %{_libdir}/%{name}/syslog.la
+
+#%attr(0644,root,root) %{_libdir}/%{name}/tape.so*
+#%attr(0644,root,root) %{_libdir}/%{name}/tape.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/tcpconns.so*
+%attr(0644,root,root) %{_libdir}/%{name}/tcpconns.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/unixsock.so*
+%attr(0644,root,root) %{_libdir}/%{name}/unixsock.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/users.so*
+%attr(0644,root,root) %{_libdir}/%{name}/users.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/uuid.so*
+%attr(0644,root,root) %{_libdir}/%{name}/uuid.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/vserver.so*
+%attr(0644,root,root) %{_libdir}/%{name}/vserver.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/wireless.so*
+%attr(0644,root,root) %{_libdir}/%{name}/wireless.la
+
+%attr(0644,root,root) %{_libdir}/%{name}/types.db
+
+%exclude %{_libdir}/perl5/5.8.8/%{_arch}-linux-thread-multi/perllocal.pod
+%attr(0644,root,root) %{_libdir}/perl5/site_perl/5.8.8/Collectd.pm
+%attr(0644,root,root) %{_libdir}/perl5/site_perl/5.8.8/Collectd/Unixsock.pm
+%attr(0644,root,root) %{_libdir}/perl5/site_perl/5.8.8/%{_arch}-linux-thread-multi/auto/Collectd/.packlist
+%attr(0644,root,root) /usr/share/man/man3/Collectd::Unixsock.3pm.gz
+
+%dir /var/lib/collectd
+
+%files apache
+%attr(0644,root,root) %{_libdir}/%{name}/apache.so*
+%attr(0644,root,root) %{_libdir}/%{name}/apache.la
+%attr(0644,root,root) /etc/collectd.d/apache.conf
+
+%files email
+%attr(0644,root,root) %{_libdir}/%{name}/email.so*
+%attr(0644,root,root) %{_libdir}/%{name}/email.la
+%attr(0644,root,root) /etc/collectd.d/email.conf
+
+%files mysql
+%attr(0644,root,root) %{_libdir}/%{name}/mysql.so*
+%attr(0644,root,root) %{_libdir}/%{name}/mysql.la
+%attr(0644,root,root) /etc/collectd.d/mysql.conf
+
+%files nginx
+%attr(0644,root,root) %{_libdir}/%{name}/nginx.so*
+%attr(0644,root,root) %{_libdir}/%{name}/nginx.la
+%attr(0644,root,root) /etc/collectd.d/nginx.conf
+
+%files sensors
+%attr(0644,root,root) %{_libdir}/%{name}/sensors.so*
+%attr(0644,root,root) %{_libdir}/%{name}/sensors.la
+%attr(0644,root,root) /etc/collectd.d/sensors.conf
+
+%files snmp
+%attr(0644,root,root) %{_libdir}/%{name}/snmp.so*
+%attr(0644,root,root) %{_libdir}/%{name}/snmp.la
+%attr(0644,root,root) /etc/collectd.d/snmp.conf
+
+%changelog
+* Mon Mar 17 2008 RightScale <support@rightscale.com> 4.3.1
+- New upstream version
+- Changes to support 4.3.1
+- Added More Prereqs to support more plugins
+- Added support for perl plugin
+
+* Mon Aug 06 2007 Kjell Randa <Kjell.Randa@broadpark.no> 4.0.6
+- New upstream version
+
+* Wed Jul 25 2007 Kjell Randa <Kjell.Randa@broadpark.no> 4.0.5
+- New major releas
+- Changes to support 4.0.5 
+
+* Wed Jan 11 2007 Iain Lea <iain@bricbrac.de> 3.11.0-0
+- fixed spec file to build correctly on fedora core
+- added improved init.d script to work with chkconfig
+- added %post and %postun to call chkconfig automatically
+
+* Sun Jul 09 2006 Florian octo Forster <octo@verplant.org> 3.10.0-1
+- New upstream version
+
+* Tue Jun 25 2006 Florian octo Forster <octo@verplant.org> 3.9.4-1
+- New upstream version
+
+* Tue Jun 01 2006 Florian octo Forster <octo@verplant.org> 3.9.3-1
+- New upstream version
+
+* Tue May 09 2006 Florian octo Forster <octo@verplant.org> 3.9.2-1
+- New upstream version
+
+* Tue May 09 2006 Florian octo Forster <octo@verplant.org> 3.8.5-1
+- New upstream version
+
+* Fri Apr 21 2006 Florian octo Forster <octo@verplant.org> 3.9.1-1
+- New upstream version
+
+* Fri Apr 14 2006 Florian octo Forster <octo@verplant.org> 3.9.0-1
+- New upstream version
+- Added the `apache' package.
+
+* Thu Mar 14 2006 Florian octo Forster <octo@verplant.org> 3.8.2-1
+- New upstream version
+
+* Thu Mar 13 2006 Florian octo Forster <octo@verplant.org> 3.8.1-1
+- New upstream version
+
+* Thu Mar 09 2006 Florian octo Forster <octo@verplant.org> 3.8.0-1
+- New upstream version
+
+* Sat Feb 18 2006 Florian octo Forster <octo@verplant.org> 3.7.2-1
+- Include `tape.so' so the build doesn't terminate because of missing files..
+- New upstream version
+
+* Sat Feb 04 2006 Florian octo Forster <octo@verplant.org> 3.7.1-1
+- New upstream version
+
+* Mon Jan 30 2006 Florian octo Forster <octo@verplant.org> 3.7.0-1
+- New upstream version
+- Removed the extra `hddtemp' package
+
+* Tue Jan 24 2006 Florian octo Forster <octo@verplant.org> 3.6.2-1
+- New upstream version
+
+* Fri Jan 20 2006 Florian octo Forster <octo@verplant.org> 3.6.1-1
+- New upstream version
+
+* Fri Jan 20 2006 Florian octo Forster <octo@verplant.org> 3.6.0-1
+- New upstream version
+- Added config file, `collectd.conf(5)', `df.so'
+- Added package `collectd-mysql', dependency on `mysqlclient10 | mysql'
+
+* Wed Dec 07 2005 Florian octo Forster <octo@verplant.org> 3.5.0-1
+- New upstream version
+
+* Sat Nov 26 2005 Florian octo Forster <octo@verplant.org> 3.4.0-1
+- New upstream version
+
+* Sat Nov 05 2005 Florian octo Forster <octo@verplant.org> 3.3.0-1
+- New upstream version
+
+* Tue Oct 26 2005 Florian octo Forster <octo@verplant.org> 3.2.0-1
+- New upstream version
+- Added statement to remove the `*.la' files. This fixes a problem when
+  `Unpackaged files terminate build' is in effect.
+- Added `processes.so*' to the main package
+
+* Fri Oct 14 2005 Florian octo Forster <octo@verplant.org> 3.1.0-1
+- New upstream version
+- Added package `collectd-hddtemp'
+
+* Fri Sep 30 2005 Florian octo Forster <octo@verplant.org> 3.0.0-1
+- New upstream version
+- Split the package into `collectd' and `collectd-sensors'
+
+* Fri Sep 16 2005 Florian octo Forster <octo@verplant.org> 2.1.0-1
+- New upstream version
+
+* Mon Sep 10 2005 Florian octo Forster <octo@verplant.org> 2.0.0-1
+- New upstream version
+
+* Mon Aug 29 2005 Florian octo Forster <octo@verplant.org> 1.8.0-1
+- New upstream version
+
+* Sun Aug 25 2005 Florian octo Forster <octo@verplant.org> 1.7.0-1
+- New upstream version
+
+* Sun Aug 21 2005 Florian octo Forster <octo@verplant.org> 1.6.0-1
+- New upstream version
+
+* Sun Jul 17 2005 Florian octo Forster <octo@verplant.org> 1.5.1-1
+- New upstream version
+
+* Sun Jul 17 2005 Florian octo Forster <octo@verplant.org> 1.5-1
+- New upstream version
+
+* Mon Jul 11 2005 Florian octo Forster <octo@verplant.org> 1.4.2-1
+- New upstream version
+
+* Sat Jul 09 2005 Florian octo Forster <octo@verplant.org> 1.4-1
+- Built on RedHat 7.3
diff --git a/contrib/redhat/email.conf b/contrib/redhat/email.conf
new file mode 100644 (file)
index 0000000..6f2caba
--- /dev/null
@@ -0,0 +1,8 @@
+LoadPlugin email
+#<Plugin email>
+#      SocketFile "/usr/var/run/collectd-email"
+#      SocketGroup "collectd"
+#      SocketPerms "0770"
+#      MaxConns 5
+#</Plugin>
+
diff --git a/contrib/redhat/init.d-collectd b/contrib/redhat/init.d-collectd
new file mode 100644 (file)
index 0000000..b7c085c
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/bash
+#
+# collectd    Startup script for the Collectd statistics gathering daemon
+# chkconfig: - 86 15
+# description: Collectd is a statistics gathering daemon used to collect \
+#   system information ie. cpu, memory, disk, network
+# processname: collectd
+# config: /etc/collectd.conf
+# config: /etc/sysconfig/collectd
+# pidfile: /var/run/collectd.pid
+
+# Source function library.
+. /etc/init.d/functions
+
+RETVAL=0
+ARGS=""
+prog="collectdmon"
+CONFIG=/etc/collectd.conf
+COLLECTD=/usr/sbin/collectd
+COLLECTDMONPID=/var/run/collectdmon.pid
+
+if [ -r /etc/default/$prog ]; then
+       . /etc/default/$prog
+fi
+
+start () {
+       echo -n $"Starting collectd: "
+       if [ -r "$CONFIG" ]
+       then
+               daemon $prog -P $COLLECTDMONPID -c $COLLECTD -- -C "$CONFIG"
+               RETVAL=$?
+               echo
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+       fi
+}
+stop () {
+       echo -n $"Stopping collectd: "
+       killproc $prog
+       RETVAL=$?
+       echo
+       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
+}
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  status)
+       status $prog
+       ;;
+  restart|reload)
+       stop
+       start
+       ;;
+  condrestart)
+       [ -f /var/lock/subsys/$prog ] && restart || :
+       ;;
+  *)
+       echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
+       exit 1
+esac
+
+exit $?
+
+# vim:syntax=sh
diff --git a/contrib/redhat/mysql.conf b/contrib/redhat/mysql.conf
new file mode 100644 (file)
index 0000000..ad87557
--- /dev/null
@@ -0,0 +1,9 @@
+LoadPlugin mysql
+
+#<Plugin mysql>
+#      Host "database.serv.er"
+#      User "db_user"
+#      Password "secret"
+#      Database "db_name"
+#</Plugin>
+
diff --git a/contrib/redhat/nginx.conf b/contrib/redhat/nginx.conf
new file mode 100644 (file)
index 0000000..56ce35d
--- /dev/null
@@ -0,0 +1,8 @@
+LoadPlugin nginx
+
+#<Plugin nginx>
+#      URL "http://localhost/status?auto"
+#      User "www-user"
+#      Password "secret"
+#      CACert "/etc/ssl/ca.crt"
+#</Plugin>
diff --git a/contrib/redhat/sensors.conf b/contrib/redhat/sensors.conf
new file mode 100644 (file)
index 0000000..82455f8
--- /dev/null
@@ -0,0 +1,9 @@
+LoadPlugin sensors
+
+#<Plugin sensors>
+#      Sensor "it8712-isa-0290/temperature-temp1"
+#      Sensor "it8712-isa-0290/fanspeed-fan3"
+#      Sensor "it8712-isa-0290/voltage-in8"
+#      IgnoreSelected false
+#</Plugin>
+
diff --git a/contrib/redhat/snmp.conf b/contrib/redhat/snmp.conf
new file mode 100644 (file)
index 0000000..e13833c
--- /dev/null
@@ -0,0 +1,44 @@
+LoadPlugin snmp
+
+#<Plugin snmp>
+#   <Data "powerplus_voltge_input">
+#       Type "voltage"
+#       Table false
+#       Instance "input_line1"
+#       Values "SNMPv2-SMI::enterprises.6050.5.4.1.1.2.1"
+#   </Data>
+#   <Data "hr_users">
+#       Type "users"
+#       Table false
+#       Instance ""
+#       Values "HOST-RESOURCES-MIB::hrSystemNumUsers.0"
+#   </Data>
+#   <Data "std_traffic">
+#       Type "if_octets"
+#       Table true
+#       Instance "IF-MIB::ifDescr"
+#       Values "IF-MIB::ifInOctets" "IF-MIB::ifOutOctets"
+#   </Data>
+#   
+#   <Host "some.switch.mydomain.org">
+#       Address "192.168.0.2"
+#       Version 1
+#       Community "community_string"
+#       Collect "std_traffic"
+#       Inverval 120
+#   </Host>
+#   <Host "some.server.mydomain.org">
+#       Address "192.168.0.42"
+#       Version 2
+#       Community "another_string"
+#       Collect "std_traffic" "hr_users"
+#   </Host>
+#   <Host "some.ups.mydomain.org">
+#       Address "192.168.0.3"
+#       Version 1
+#       Community "more_communities"
+#       Collect "powerplus_voltge_input"
+#       Interval 300
+#   </Host>
+#</Plugin>
+
index 13116bb..2ae5163 100644 (file)
@@ -86,12 +86,12 @@ plugin within collectd. I<type> identifies the type and number of values
 (i.E<nbsp>e. data-set) passed to collectd. A large list of predefined
 data-sets is available in the B<types.db> file.
 
-The I<OptionList> is an optional list of I<Options>, where each option if a
+The I<OptionList> is an optional list of I<Options>, where each option is a
 key-value-pair. A list of currently understood options can be found below, all
 other options will be ignored.
 
 I<Valuelist> is a colon-separated list of the time and the values, each either
-an integer if the data-source is a counter, of a double if the data-source if
+an integer if the data-source is a counter, or a double if the data-source is
 of type "gauge". You can submit an undefined gauge-value by using B<U>. When
 submitting B<U> to a counter the behavior is undefined. The time is given as
 epoch (i.E<nbsp>e. standard UNIX time).
index db9285b..8cc3c8a 100644 (file)
@@ -27,6 +27,7 @@
 extern FILE *yyin;
 
 oconfig_item_t *ci_root;
+char           *c_file;
 
 static void yyset_in  (FILE *fd)
 {
@@ -38,8 +39,24 @@ oconfig_item_t *oconfig_parse_fh (FILE *fh)
   int status;
   oconfig_item_t *ret;
 
+  char file[10];
+
   yyset_in (fh);
 
+  if (NULL == c_file) {
+    int status;
+
+    status = snprintf (file, sizeof (file), "<fd#%d>", fileno (fh));
+
+    if ((status < 0) || (status >= sizeof (file))) {
+      c_file = "<unknown>";
+    }
+    else {
+      file[sizeof (file) - 1] = '\0';
+      c_file = file;
+    }
+  }
+
   status = yyparse ();
   if (status != 0)
   {
@@ -47,6 +64,8 @@ oconfig_item_t *oconfig_parse_fh (FILE *fh)
     return (NULL);
   }
 
+  c_file = NULL;
+
   ret = ci_root;
   ci_root = NULL;
   yyset_in ((FILE *) 0);
@@ -59,6 +78,8 @@ oconfig_item_t *oconfig_parse_file (const char *file)
   FILE *fh;
   oconfig_item_t *ret;
 
+  c_file = file;
+
   fh = fopen (file, "r");
   if (fh == NULL)
   {
@@ -69,6 +90,8 @@ oconfig_item_t *oconfig_parse_file (const char *file)
   ret = oconfig_parse_fh (fh);
   fclose (fh);
 
+  c_file = NULL;
+
   return (ret);
 } /* oconfig_item_t *oconfig_parse_file */
 
index 8df2c6e..49cd139 100644 (file)
@@ -30,6 +30,7 @@ extern int yylineno;
 extern char *yytext;
 
 extern oconfig_item_t *ci_root;
+extern char           *c_file;
 %}
 
 %start entire_file
@@ -64,6 +65,9 @@ extern oconfig_item_t *ci_root;
 %type <sl> statement_list
 %type <ci> entire_file
 
+/* pass an verbose, specific error message to yyerror() */
+%error-verbose
+
 %%
 string:
        QUOTED_STRING           {$$ = unquote ($1);}
@@ -192,7 +196,15 @@ entire_file:
 %%
 static int yyerror (const char *s)
 {
-       fprintf (stderr, "Error in line %i near `%s': %s\n", yylineno, yytext, s);
+       char *text;
+
+       if (*yytext == '\n')
+               text = "<newline>";
+       else
+               text = yytext;
+
+       fprintf (stderr, "Parse error in file `%s', line %i near `%s': %s\n",
+               c_file, yylineno, text, s);
        return (-1);
 } /* int yyerror */
 
index d17551e..96e8562 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * collectd - src/perl.c
- * Copyright (C) 2007  Sebastian Harl
+ * Copyright (C) 2007, 2008  Sebastian Harl
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
index 1289d4b..a96e04c 100644 (file)
@@ -341,16 +341,38 @@ static int sensors_load_conf (void)
 
                        /* "master features" only */
                        if (feature->mapping != SENSORS_NO_MAPPING)
+                       {
+                               DEBUG ("sensors plugin: sensors_load_conf: "
+                                               "Ignoring subfeature `%s', "
+                                               "because (feature->mapping "
+                                               "!= SENSORS_NO_MAPPING).",
+                                               feature->name);
                                continue;
+                       }
 
                        /* skip ignored in sensors.conf */
                        if (sensors_get_ignored (*chip, feature->number) == 0)
-                               break;
+                       {
+                               DEBUG ("sensors plugin: sensors_load_conf: "
+                                               "Ignoring subfeature `%s', "
+                                               "because "
+                                               "`sensors_get_ignored' told "
+                                               "me so.",
+                                               feature->name);
+                               continue;
+                       }
 
                        feature_type = sensors_feature_name_to_type (
                                        feature->name);
                        if (feature_type == SENSOR_TYPE_UNKNOWN)
+                       {
+                               DEBUG ("sensors plugin: sensors_load_conf: "
+                                               "Ignoring subfeature `%s', "
+                                               "because its type is "
+                                               "unknown.",
+                                               feature->name);
                                continue;
+                       }
 
                        fl = (featurelist_t *) malloc (sizeof (featurelist_t));
                        if (fl == NULL)
@@ -389,7 +411,13 @@ static int sensors_load_conf (void)
                        if ((feature->type != SENSORS_FEATURE_IN)
                                        && (feature->type != SENSORS_FEATURE_FAN)
                                        && (feature->type != SENSORS_FEATURE_TEMP))
+                       {
+                               DEBUG ("sensors plugin: sensors_load_conf: "
+                                               "Ignoring feature `%s', "
+                                               "because its type is not "
+                                               "supported.", feature->name);
                                continue;
+                       }
 
                        while ((subfeature = sensors_get_all_subfeatures (chip,
                                                        feature, &subfeature_num)) != NULL)
index 4870598..285fb74 100644 (file)
@@ -132,8 +132,8 @@ static int wireless_read (void)
                        power = 1.0; /* invalid */
 
                /* noise [dBm] < 0.0 */
-               noise = strtod (fields[3], &endptr);
-               if (fields[3] == endptr)
+               noise = strtod (fields[4], &endptr);
+               if (fields[4] == endptr)
                        noise = 1.0; /* invalid */
                else if ((noise >= 0.0) && (noise <= 100.0))
                        noise = wireless_percent_to_power (noise);