[collectd] [PATCH 2/2] Add config file for init script Separate mackages for rrdtool/rrdcached Run as non-privileged user
Signed-off-by: Fabien Wernli c...@faxm0dem.org --- contrib/redhat/collectd.conf |6 - contrib/redhat/collectd.spec | 41 ++-- contrib/redhat/init.d-collectd| 15 ++--- contrib/redhat/rrdcached.conf |9 contrib/redhat/rrdtool.conf |8 +++ contrib/redhat/sysconfig-collectd |6 + 6 files changed, 72 insertions(+), 13 deletions(-) create mode 100644 contrib/redhat/rrdcached.conf create mode 100644 contrib/redhat/rrdtool.conf create mode 100644 contrib/redhat/sysconfig-collectd diff --git a/contrib/redhat/collectd.conf b/contrib/redhat/collectd.conf index f8352ff..458fa4c 100644 --- a/contrib/redhat/collectd.conf +++ b/contrib/redhat/collectd.conf @@ -180,12 +180,6 @@ LoadPlugin wireless # Process name #/Plugin -#Plugin rrdtool -# DataDir /usr/var/lib/collectd/rrd -# CacheTimeout 120 -# CacheFlush 900 -#/Plugin - #Plugin syslog # LogLevel info #/Plugin diff --git a/contrib/redhat/collectd.spec b/contrib/redhat/collectd.spec index 5f31655..e928e0c 100644 --- a/contrib/redhat/collectd.spec +++ b/contrib/redhat/collectd.spec @@ -12,7 +12,7 @@ BuildRoot:%{_tmppath}/%{name}-%{version}-root BuildPrereq: lm_sensors-devel, rrdtool-devel, libpcap-devel, net-snmp-devel, libstatgrab-devel, libxml2-devel, libiptcdata-devel # libcurl deps BuildPrereq: curl-devel,libidn-devel,openssl-devel -Requires: rrdtool, perl-Regexp-Common, libstatgrab +Requires: perl-Regexp-Common, libstatgrab Packager: RightScale supp...@rightscale.com Vendor:collectd development team collectd@verplant.org @@ -54,6 +54,20 @@ Requires:collectd = %{version}, curl %description nginx This plugin gets data provided by nginx. +%package rrdcached +Summary: rrdcached-plugin for collectd. +Group: System Environment/Daemons +Requires: collectd = %{version}, rrdtool = 1.4 +%description rrdcached +This plugin for collectd provides write plugin for rrdcached. + +%package rrdtool +Summary: rrdtool-plugin for collectd. +Group: System Environment/Daemons +Requires: collectd = %{version}, rrdtool +%description rrdtool +This plugin for collectd provides write plugin for rrd files. + %package sensors Summary: libsensors-module for collectd. Group: System Environment/Daemons @@ -92,8 +106,10 @@ make %install make install DESTDIR=$RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +mkdir -p $RPM_BUILD_ROOT/etc/sysconfig 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/redhat/sysconfig-collectd $RPM_BUILD_ROOT/etc/sysconfig/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 @@ -116,11 +132,16 @@ 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/rrdcached.conf $RPM_BUILD_ROOT/etc/collectd.d/rrdcached.conf +cp contrib/redhat/rrdtool.conf $RPM_BUILD_ROOT/etc/collectd.d/rrdtool.conf cp contrib/redhat/snmp.conf $RPM_BUILD_ROOT/etc/collectd.d/snmp.conf %clean rm -rf $RPM_BUILD_ROOT +%pre +/usr/sbin/useradd -d /dev/null -r -s /sbin/nologin collectd /dev/null 21 || : + %post /sbin/chkconfig --add collectd /sbin/chkconfig collectd on @@ -143,6 +164,7 @@ exit 0 %defattr(-,root,root) %doc AUTHORS COPYING ChangeLog INSTALL NEWS README contrib/ %config %attr(0644,root,root) /etc/collectd.conf +%config %attr(0644,root,root) /etc/sysconfig/collectd %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 @@ -175,6 +197,7 @@ exit 0 %plugin_macro cpu %plugin_macro csv %plugin_macro curl +%plugin_macro curl_json %plugin_macro curl_xml %plugin_macro dbi %plugin_macro df @@ -217,8 +240,6 @@ exit 0 %plugin_macro processes %plugin_macro protocols %plugin_macro python -%plugin_macro rrdtool -%plugin_macro rrdcached %plugin_macro serial %plugin_macro sensors %plugin_macro swap @@ -284,6 +305,14 @@ exit 0 %config %attr(0644,root,root) /etc/collectd.d/nginx.conf %plugin_macro nginx +%files rrdcached +%config %attr(0644,root,root) /etc/collectd.d/rrdcached.conf +%plugin_macro rrdcached + +%files rrdtool +%config %attr(0644,root,root) /etc/collectd.d/rrdtool.conf +%plugin_macro rrdtool + %files sensors %attr(0644,root,root) %{_libdir}/%{name}/sensors.so* %attr(0644,root,root) %{_libdir}/%{name}/sensors.la @@ -294,6 +323,12 @@ exit 0 %plugin_macro snmp %changelog +* Mon Sep 05 2011 faxm0dem faxm0...@cpan.org 5.0.0 +- New upstream version +- Added /etc/sysconfig/collectd +- Added
Re: [collectd] perl -mCollectd --error-- Bareword LOG_ERR not allowed while strict subs in use at Collectd.pm line 164.
Hi, On Tue, Oct 25, 2011 at 12:58:21PM -0700, Brian Shore wrote: I don't see any response to this post (April 21, 2011). I'm getting the same result under CentOS 5, perl 5.8.8, Collectd 5.0.1. I don't see any changes in the git log for Collectd.pm that would seem toeffect this in any prior release. Is anyone using the perl plugin? Did you patch the collectd perl modules? Collectd.pm can only be used by perl plugin, as it defines some variables (see perl.c). For testing purposes, may I suggest running your plugin using 'collectd -f' and in debugging mode. ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] dynamic types for network plugin?
Hi, On Thu, Dec 01, 2011 at 08:21:14AM -0800, Sage Weil wrote: Resending this, since I haven't heard anything. This really seems like a general problem with dynamically typed plugins mixed with the network plugin. So I give it you're using plugin_register_data_set() in your plugin? ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] Collectd complex perl plugin question ...
Hi, On Wed, Apr 04, 2012 at 10:58:07AM +0200, Sebastian Harl wrote: However, you could simple skip a couple of intervals in the read callback function. I.e., use a global variable (for each instance of the callback) to count down the number of intervals to be skipped. Make sure to return 0 in case you skip the current interval. Then, manually set the interval appropriately when dispatching values. Here's my two cents of what I have in all my perl plugins to handle the Interval config option: -- package Collectd::Plugins::Mine; use Collectd qw( :all ); my $interval = $interval_g; my $hostname = $hostname_g; my $last_ts = time(); [...] sub my_config { for my $child (@{$_[0] - {children}}) { if ($child - {key} eq Interval) { $interval = $child - {values} - [0]; [...] sub my_get { my $ts = time; return 1 if ($ts $interval + $last_ts); [...] plugin_dispatch_values(...); [...] $last_ts = $ts; return 1; } -- Cheers ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] Collectd complex perl plugin question ...
Hi, On Wed, Apr 04, 2012 at 12:53:18PM +, Sebastien Cramatte wrote: Thanks a lot for snippet. I've still have an issue :( Found a configuration for the Mine plugin, but the plugin isn't loaded or didn't register a configuration callback. In my plugin source I've got this line ... plugin_register (TYPE_CONFIG, mine, mine_config); Any Idea of what occurs ? Yes I scratched my head quite a bit on that one :-) The BaseName/LoadPlugin directive will select the right perl Module. The Plugin ... directive refers to the plugin_register() callback's plugin name. If your __PACKAGE__ is Collectd::Plugins::Mine, and is calling plugin_register ([...], mine) you need something like: -- LoadPlugin perl Globals true /LoadPlugin Plugin perl BaseName Collectd::Plugins LoadPlugin Mine [... this will look for PERL5LIB(s).../Collectd/Plugins/Mine.pm ...] Plugin mine [... this will register with the plugin called mine ...] Interval300 [...] /Plugin /Plugin ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] Modbus segfault
Hi, On Fri, May 04, 2012 at 11:23:42AM +0200, colle...@faxm0dem.org wrote: Attached patch solves this (to be applied agains stefan's fork). Stefan: can you add it to your github, then issue a pull request? Attachement didn't make it. Here's the fork: https://github.com/faxm0dem/collectd/tree/faxm0dem/modbus Cheers, ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] collectd 5.10 threading
Hi, On Fri, Sep 14, 2012 at 05:37:08PM +0200, Cyril Feraudet wrote: A friend of mine is currently writing a plugin to do aggregation of metric directly in Collectd if this is the subject. You are aware of the following branch, aren't you? https://github.com/collectd/collectd/tree/ff/aggregate ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] New aggregator plugin basic_aggregator (#136)
Hi, Adding a configuration reload is an excellent idea, and is one of the big missing features of collectd IMHO. I quite agree with Lindsay's remarks: there should simply be a warning for the plugins that don't support reconfiguration. On the other hand, maybe there should be the option to restart the thread, if it doesn't register the cb. just my 2 euros Cheers ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] New aggregator plugin basic_aggregator (#136)
On Sat, Oct 13, 2012 at 09:27:25AM +0200, Sebastian Harl wrote: most/many/all parts of collectd actually support reconfigure as people might expect too much from SIGHUP else. agreed Just to be sure: the main collectd thread has no control over its child threads in the current implementation? ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] Modbus plugin seems to read garbage values
Hi, On Fri, Oct 12, 2012 at 05:30:32PM +0200, Gerry Demaret wrote: I've been playing with the modbus plugin to read the values from a Schneider Electric PowerLogic EGX100. I'm using Debian testing which has collectd 5.1. Are you sure the device is sending correct values? We've got an EGX400, and it's been a real PITA ever since we've comissioned it. We ended up writing our own plugin retrieving the data via ftp/http from the box. Then again, I've never used float type for registers, but I guess you've already played with that, as the EGX100 user guide seems rather sparse on this matter. Anyway, if it's just a matter of linear transformation, you could use the scale target plugin. Your config looks fine to me - Cheers ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] Plugins values
Hi, On Thu, Feb 07, 2013 at 01:33:19PM +0100, Frédéric Pégé wrote: The load values are returned in 3 different values under the same item. load/load. Values are longterm, shortterm and midterm. And I'm ok with that. Just my two cents on loadavg: IMHO it's totally useless to keep anything else than shortterm, if you're using some kind of historization like rrdtool, as you'll get the two others for free. midterm/longterm are only useful when no history is available, e.g. from the command line, or if you're using some kind of realtime visualization. Do you have an explanation for these different ways ? Anyways, back to your real question: The reason for the differences is purely historical. The tendency is to move away from multiple datasources (like load, if_octets, etc.) and use only simple datasources, like gauge, cpu, etc. Maybe this will happen in collectd 6, if two wisely chosen guys have the courage to do so ;-) ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] Collectd Nagios IP Socket
Hi, On Thu, Feb 14, 2013 at 10:05:31PM +, Crowder, Travis wrote: Is there a way for Collectd and Nagios to play together over an IP socket instead of a Unix socket? There's always nrpe, if you want an even simpler solution ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] Fwd: [5.1] Multiple mysql instances?
Hi Jacek, On Mon, Mar 18, 2013 at 09:37:22AM +0100, Jacek Osiecki wrote: LoadPlugin mysql Plugin mysql Database sqlone User backup Password Host 192.168.0.21 Database mysql #Socket /var/lib/mysql/sc-sqlcrit/mysql.sock /Database Database sqltwo User backup2 Password Database mysql Host 192.168.0.22 #Socket /var/lib/mysql/sc-sqlmain/mysql.sock /Database /Plugin I tried many combinations: using Host in first database and Socket in second one, using different users - nothing helped. Always only the first database is handled. Am I doing something wrong, or is collectd simply unable to handle two (or more) mysql servers? I think the 'Database' directive *in* the block overrides the name in the 'Database' *definition*. This means that in your example, `sqlone` and `sqltwo` are both being overridden by `mysql`, thus yielding the error message. I remember banging my head on a hard surface too when trying to achieve the same goal. If I were you, I'd simply drop the `Database mysql` from your example, and it should work as-is. ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] Collectd, snmp linux interface stats
Hi, If I were you I'd use one of the latest collectd builds, which has a fix [1] which seems to address issues ppl are having especially on Cisco hw. Cheers [1] https://github.com/collectd/collectd/issues/131 On Sun, Jun 16, 2013 at 11:48:38PM +0800, Brendan Horan wrote: Hi List, I am really enjoying collectd, thank you. I have two issues with collectd and SNMP plugin. I am using the following block to collect interface traffic stats : Data std_traffic Type if_octets Table true Instance IF-MIB::ifDescr Values IF-MIB::ifInOctets IF-MIB::ifOutOctets /Data This works fine for my Cisco kit, but all my Linux hosts never get any data inside collectd. That seems odd becase if I run the following snmpwalk -v2c -c public $HOSTNAME IF-MIB::ifInOctets I get back the expected values. I don't understand what I am doing wrong. The above works for my Cisco kit, works via snmpwalk. The second issue I have and of much less importance is that on my Cisco switch the above data block only brings back one VLAN. On my Cisco Router all VLAN's are brought back. Unsure why my switch won't get all the VLANS, all physical switchports are fine. Can someone give me a hand ? Thanks Brendan ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] notify_email no longer working...
Hi, You should use Plugin threshold instead of Threshold There is a docbug which has been fixed https://github.com/collectd/collectd/pull/443 Cheers On Fri, Oct 11, 2013 at 11:02:59PM +0200, Dirk Geschke wrote: Hi all, I have just noticed, that notify_email is no longer working. And it seems that it happened with the upgrade to wheezy, with squeeze it worked... Now I noticed, that one has now to load the plugin threshold explicitly, but this seems not to help at all. Probably it is only a configuration error, but I have no clue what it might be. Has anyone an idea? For example I have something like: LoadPlugin threshold Threshold Type load DataSource midterm WarningMax 10 Hits 3 Hysteresis 3 /Type /Threshold and: LoadPlugin notify_email Plugin notify_email SMTPServer 127.0.0.1 SMTPPort 25 From colle...@lug-erding.de Subject [collectd] %s on %s! Recipient d...@lug-erding.de /Plugin Has anyone an idea where I can locate the problem? I guess, it is a problem between version 4.10 (squeeze) and 5.1 (wheezy). But somehow I did not see it... Best regards Dirk -- +--+ | Dr. Dirk Geschke / Plankensteinweg 61/ 85435 Erding| | Telefon: 08122-559448 / Mobil: 0176-96906350 / Fax: 08122-9818106 | | d...@geschke-online.de / d...@lug-erding.de / kont...@lug-erding.de | +--+ ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd