collectd.git
15 years agoMerge branch 'collectd-4.4'
Florian Forster [Sun, 6 Jul 2008 14:17:27 +0000 (16:17 +0200)]
Merge branch 'collectd-4.4'

Conflicts:

src/apache.c
src/apcups.c
src/apple_sensors.c
src/battery.c
src/cpu.c
src/cpufreq.c
src/df.c
src/disk.c
src/dns.c
src/email.c
src/entropy.c
src/hddtemp.c
src/interface.c
src/ipvs.c
src/irq.c
src/load.c
src/mbmon.c
src/memcached.c
src/memory.c
src/multimeter.c
src/mysql.c
src/netlink.c
src/network.c
src/nfs.c
src/nginx.c
src/ntpd.c
src/nut.c
src/ping.c
src/processes.c
src/rrdtool.c
src/serial.c
src/snmp.c
src/swap.c
src/tape.c
src/tcpconns.c
src/users.c
src/utils_cmd_putval.c
src/vserver.c
src/wireless.c
src/xmms.c

15 years agoemail plugin: Don't print `pthread_t'.
Florian Forster [Sun, 6 Jul 2008 13:24:59 +0000 (15:24 +0200)]
email plugin: Don't print `pthread_t'.

It may be a struct, so printing it is not portable.

15 years agoMerge branch 'collectd-4.3' into collectd-4.4
Florian Forster [Sun, 6 Jul 2008 13:04:41 +0000 (15:04 +0200)]
Merge branch 'collectd-4.3' into collectd-4.4

15 years agocontrib/collection.cgi: Added basic support for "postgresql" statistics.
Sebastian Harl [Sat, 5 Jul 2008 10:06:25 +0000 (12:06 +0200)]
contrib/collection.cgi: Added basic support for "postgresql" statistics.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agopostgresql plugin: Added a plugin to collect PostgreSQL database statistics.
Sebastian Harl [Sat, 5 Jul 2008 10:03:51 +0000 (12:03 +0200)]
postgresql plugin: Added a plugin to collect PostgreSQL database statistics.

This plugin collects active server connections, transaction numbers, block IO
and table row manipulations of PostgreSQL databases. For this purpose it keeps
persistent connections to all configured databases. The statistics are
collected from PostgreSQL's "statistics collector" subsystem.

Currently, statistics are collected from the pg_stat_database,
pg_stat_user_tables and pg_statio_user_tables views. The following new types
have been introduced: pg_blks, pg_n_tup_c, pg_n_tup_g, pg_numbackends, pg_scan
and pg_xact. The type names are basically the same as the column names in the
queried views to keep things consistent. For the number of tuples, counter and
gauge values exist, so the type names have been prefixed with "_c" and "_g"
respectively.

Sample plugin configuration:

  <Plugin postgresql>
    <Database foo>
      Host "hostname"
      Port "5432"
      User "username"
      Password "secret"
      SSLMode "prefer"
      KRBSrvName "kerberos_service_name"
    </Database>
    <Database bar>
      Service "service_name"
    </Database>
  </Plugin>

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agosrc/utils_complain: Changed c_release() into a macro.
Sebastian Harl [Wed, 2 Jul 2008 14:29:07 +0000 (16:29 +0200)]
src/utils_complain: Changed c_release() into a macro.

While the c_complain*() functions are usually used in error conditions only,
c_release() is usually used whenever things went right (which should be the
more common case ;-)). In order to minimize the overhead in the latter case,
c_release() has been changed into a macro which checks if the complaint
actually has to be released and calls c_do_release() in that case. This
function then takes care of reporting the release-message (this is the
original implementation of c_release()). So, we remove the overhead of a
function call in the usual case, i.e. when we don't have to report any
messages.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agosrc/plugin.c: Initialize plugins before checking if read callbacks are available.
Sebastian Harl [Wed, 2 Jul 2008 14:26:46 +0000 (16:26 +0200)]
src/plugin.c: Initialize plugins before checking if read callbacks are available.

plugin_init_all() checks if any read callbacks are available before starting
the read threads. A few plugins register their read callback from their
init callback though. By initializing the plugins before that the read
threads are still started correctly if all plugins register the read
callback in the init callback.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agoqmail plugin: Don't recurse into ".", ".." and other directories beginning with a...
Benjamin Pineau [Sat, 5 Jul 2008 08:45:09 +0000 (10:45 +0200)]
qmail plugin: Don't recurse into ".", ".." and other directories beginning with a dot.

Also use PATH_MAX instead of 4096.

15 years agorrdtool plugin: Use a hack to case the `argv' pointers in a portable way.
Florian Forster [Wed, 2 Jul 2008 13:21:55 +0000 (15:21 +0200)]
rrdtool plugin: Use a hack to case the `argv' pointers in a portable way.

15 years agoBuild system: Added the qmail plugin.
Florian Forster [Wed, 2 Jul 2008 13:21:27 +0000 (15:21 +0200)]
Build system: Added the qmail plugin.

15 years agoqmail plugin: Various cleanups and bugfixes.
Florian Forster [Wed, 2 Jul 2008 13:21:03 +0000 (15:21 +0200)]
qmail plugin: Various cleanups and bugfixes.

15 years agoqmail plugin: Added a plugin to count messages in qmail queues.
Alessandro Iurlano [Wed, 2 Jul 2008 12:23:46 +0000 (14:23 +0200)]
qmail plugin: Added a plugin to count messages in qmail queues.

Hello.
Here is my first collectd plugin.
It shows the two values of qmail queues, messages and todo.
The latter should be zero in normal cases. I included it because it
may help diagnose problems.
Maybe a config parameter could be added for it.

It supports a parameter for the Qmail base directory:

<Plugin qmail_queue>
       QmailDir "/var/qmail"
</Plugin>

Feel free to modify it if you need.
Alessandro

15 years agosrc/{exec,types_list,utils_cache}.c: Fix format strings.
Florian Forster [Mon, 30 Jun 2008 16:16:07 +0000 (18:16 +0200)]
src/{exec,types_list,utils_cache}.c: Fix format strings.

15 years agoipmi plugin: s/sstrerror_r/sstrerror/.
Florian Forster [Mon, 30 Jun 2008 16:15:52 +0000 (18:15 +0200)]
ipmi plugin: s/sstrerror_r/sstrerror/.

15 years agoChangeLog: Recoded to UTF-8.
Florian Forster [Wed, 25 Jun 2008 13:36:09 +0000 (15:36 +0200)]
ChangeLog: Recoded to UTF-8.

15 years agoprocesses plugin: Use read_file_contents().
Michał Mirosław [Sat, 21 Jun 2008 20:21:56 +0000 (22:21 +0200)]
processes plugin: Use read_file_contents().

src/processes.c: use read_file_contents()

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agosrc/common.c: Move read_file_contents() to here.
Michał Mirosław [Sat, 21 Jun 2008 20:21:07 +0000 (22:21 +0200)]
src/common.c: Move read_file_contents() to here.

src/common.c: move read_file_contents() from thermal plugin

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agobattery plugin: Use walk_directory().
Michał Mirosław [Sat, 21 Jun 2008 20:20:24 +0000 (22:20 +0200)]
battery plugin: Use walk_directory().

src/battery.c: use walk_directory()

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agosrc/common.c: Move walk_directory() to here.
Michał Mirosław [Sat, 21 Jun 2008 20:19:41 +0000 (22:19 +0200)]
src/common.c: Move walk_directory() to here.

src/common.c: Move walk_directory() from thermal plugin

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agoemail plugin: Don't unlink the socket file on startup.
Sebastian Harl [Tue, 17 Jun 2008 17:59:14 +0000 (19:59 +0200)]
email plugin: Don't unlink the socket file on startup.

Usually, collectd runs as user root, thus making it an unsafe operation to
unconditionally remove the file even though one should be able to assume
that it "belongs" to collectd.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agocollectd.conf(5), collectd.conf: Added the thermal plugin.
Sebastian Harl [Mon, 23 Jun 2008 20:53:03 +0000 (22:53 +0200)]
collectd.conf(5), collectd.conf: Added the thermal plugin.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agosrc/common.c: Not enough memory is an error, not a debug message!
Florian Forster [Fri, 20 Jun 2008 12:47:16 +0000 (14:47 +0200)]
src/common.c: Not enough memory is an error, not a debug message!

15 years agosrc/Makefile.am: Define HAS_BOOL when building the perl plugin.
Sebastian Harl [Mon, 16 Jun 2008 21:03:17 +0000 (23:03 +0200)]
src/Makefile.am: Define HAS_BOOL when building the perl plugin.

This works around a bug in Perl, which despite C99 defining the "bool" type
defines its own version of that type unless HAS_BOOL is defined... :-/

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agoUse -Wall -Werror (AM_CFLAGS) when building any module.
Sebastian Harl [Mon, 16 Jun 2008 21:02:36 +0000 (23:02 +0200)]
Use -Wall -Werror (AM_CFLAGS) when building any module.

A few plugins have to set custom CFLAGS. When using "<plugin>_la_CFLAGS =",
$(AM_CFLAGS) will no longer be used when compiling <plugin> as that resets the
CFLAGS to the empty string. So, in that case, we have to explicitly add
$(AM_CFLAGS) to the custom CFLAGS of that plugin.

After doing so, a couple of problems have been identified which have been
fixed in this patch as well. That includes a possible SEGFAULT in the snmp
plugin which was missing an argument to WARNING().

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agoconfigure: Include libesmtp in the summary output.
Sebastian Harl [Mon, 16 Jun 2008 21:03:50 +0000 (23:03 +0200)]
configure: Include libesmtp in the summary output.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agocontrib/examples/: Be more verbose about how to handle types.
Sebastian Harl [Mon, 16 Jun 2008 21:35:28 +0000 (23:35 +0200)]
contrib/examples/: Be more verbose about how to handle types.

As suggested by Wolfgang Kroener.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agoMerge branch 'master' of /var/lib/git/collectd
Florian Forster [Sat, 14 Jun 2008 15:53:25 +0000 (17:53 +0200)]
Merge branch 'master' of /var/lib/git/collectd

Conflicts:

src/email.c

15 years agosrc/common.c: Add end-of-line characters to strsplit()
Michał Mirosław [Sat, 14 Jun 2008 00:29:05 +0000 (02:29 +0200)]
src/common.c: Add end-of-line characters to strsplit()

This fixes plugins that use it to break lines read using fgets()
and forget that "\n" is left at the buffer's end. At least
battery and wireless plugins is affected.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agoemail plugin: Fix a format string.
Florian Forster [Sat, 14 Jun 2008 15:51:36 +0000 (17:51 +0200)]
email plugin: Fix a format string.

15 years agosrc/collectd.conf.in: Fix the NotificationExec example.
Florian Forster [Fri, 13 Jun 2008 12:57:39 +0000 (14:57 +0200)]
src/collectd.conf.in: Fix the NotificationExec example.

15 years agosrc/plugin.c: Add assertions to detect if two linked lists are the same.
Florian Forster [Fri, 13 Jun 2008 12:57:10 +0000 (14:57 +0200)]
src/plugin.c: Add assertions to detect if two linked lists are the same.

This will catch errors as just fixed in the exec plugin in the future.

15 years agoexec plugin: Set notify->meta to NULL before copying the list.
Florian Forster [Fri, 13 Jun 2008 12:56:10 +0000 (14:56 +0200)]
exec plugin: Set notify->meta to NULL before copying the list.

Otherwise we will run into a nasty endless loop.

15 years agoexec plugin: Added support for notification meta information.
Florian Forster [Thu, 12 Jun 2008 14:08:58 +0000 (16:08 +0200)]
exec plugin: Added support for notification meta information.

15 years agosrc/plugin.[ch]: Implement `plugin_notification_meta_copy'.
Florian Forster [Thu, 12 Jun 2008 13:44:59 +0000 (15:44 +0200)]
src/plugin.[ch]: Implement `plugin_notification_meta_copy'.

The exec plugin copies the notifications before creating threads, so we need to
be able to copy the meta data to a second notification.

15 years agosrc/utils_threashold.c: Add meta data to the notifications.
Florian Forster [Thu, 12 Jun 2008 13:27:10 +0000 (15:27 +0200)]
src/utils_threashold.c: Add meta data to the notifications.

The min/max warning/failure values, the current value and name of the
data source are now included in the meta data part of the notification.

15 years agosrc/plugin.[ch]: Use different functions instead of a void pointer.
Florian Forster [Thu, 12 Jun 2008 13:25:16 +0000 (15:25 +0200)]
src/plugin.[ch]: Use different functions instead of a void pointer.

15 years agosrc/plugin.[ch]: Add `notification meta data' to notification_t.
Florian Forster [Thu, 12 Jun 2008 09:44:23 +0000 (11:44 +0200)]
src/plugin.[ch]: Add `notification meta data' to notification_t.

The plan is to have arbitrary values attached to notifications that user
defined actions can use to get machine parseable values for building
own notification strings or the like.

For example, the threshold checking stuff will (in the near future) add
the current (offending) value as well as the threshold values themselves
to the notification, so that notifying plugins don't need to parse the
(freely formatted) notification string to get that information.

15 years agoBuild system: Check for and include <stdbool.h>.
Florian Forster [Thu, 12 Jun 2008 09:40:10 +0000 (11:40 +0200)]
Build system: Check for and include <stdbool.h>.

15 years agoemail plugin: Cast a `size_t' to `unsigned long' to make format checking happy.
Florian Forster [Thu, 12 Jun 2008 09:35:39 +0000 (11:35 +0200)]
email plugin: Cast a `size_t' to `unsigned long' to make format checking happy.

15 years agoMerge branch 'master' of /var/lib/git/collectd
Florian Forster [Thu, 12 Jun 2008 08:24:10 +0000 (10:24 +0200)]
Merge branch 'master' of /var/lib/git/collectd

15 years agothermal plugin: Updated the submit function to the new infrastructure.
Florian Forster [Thu, 12 Jun 2008 08:23:49 +0000 (10:23 +0200)]
thermal plugin: Updated the submit function to the new infrastructure.

15 years agosrc/thermal.c: Changed file encoding from ISO-8859-2 to UTF-8.
Florian Forster [Thu, 12 Jun 2008 08:22:36 +0000 (10:22 +0200)]
src/thermal.c: Changed file encoding from ISO-8859-2 to UTF-8.

15 years agothermal plugin: Linux ACPI thermal zone plugin
Michał Mirosław [Wed, 11 Jun 2008 21:38:14 +0000 (23:38 +0200)]
thermal plugin: Linux ACPI thermal zone plugin

Hello Florian,

On Wed, Jun 11, 2008 at 02:19:14PM +0200, Florian Forster wrote:
> On Mon, Jun 09, 2008 at 08:33:23PM +0200, Michał Mirosław wrote:
> > Here's temperature monitoring plugin using Linux ACPI thermal zone
> > data from /sys/class/thermal/ or /proc/acpi/thermal_zone/.
> thank you very much for your patch :)
> I have a few (minor) requests for changes though ;)
[cut]

I updated the patch basing on your suggestions. You probably can use
the 'walk_directory()' function in other plugins. And it would be
useful to have some standard functions to use in config callback
like boolean entry parser or common ignorelist entry names/parser.
I could send a patch for some cleanups if nobody is working on that,
yet.

Best Regards,
Michał Mirosław

ACPI thermal zone plugin for collectd 4.4.1

Here's temperature monitoring plugin using Linux ACPI thermal zone
data from /sys/class/thermal/ or /proc/acpi/thermal_zone/. Since
this is the same source of data, only first directory found is used.

Plugin configuration:

<Plugin thermal>
ForceUseProcfs true # default is false (prefer new sysfs interface)
        Device "THRM" # default: no selection (include all devices found)
IgnoreSelected true # default is false
</Plugin>

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agosrc/utils_dns.c: Fix version information for __NAMESER >= 19961001.
Florian Forster [Wed, 11 Jun 2008 13:29:02 +0000 (15:29 +0200)]
src/utils_dns.c: Fix version information for __NAMESER >= 19961001.

Thanks to Oleg for reporting this.
Resolves: #22

15 years agoReplace all occurrences of `strcpy' with `sstrncpy', again.
Florian Forster [Wed, 11 Jun 2008 12:32:19 +0000 (14:32 +0200)]
Replace all occurrences of `strcpy' with `sstrncpy', again.

This changes all files that are new in 4.4.

15 years agoMerge branch 'collectd-4.3' into collectd-4.4
Florian Forster [Wed, 11 Jun 2008 12:30:56 +0000 (14:30 +0200)]
Merge branch 'collectd-4.3' into collectd-4.4

15 years agosrc/collectd.h: Use `#pragma GCC poison' to disable evil functions.
Florian Forster [Wed, 11 Jun 2008 12:30:39 +0000 (14:30 +0200)]
src/collectd.h: Use `#pragma GCC poison' to disable evil functions.

15 years agolibvirt plugin: Replace `strcat' with `strncat'.
Florian Forster [Wed, 11 Jun 2008 12:30:02 +0000 (14:30 +0200)]
libvirt plugin: Replace `strcat' with `strncat'.

15 years agoReplace all occurrences of `strcpy' with `sstrncpy'.
Florian Forster [Wed, 11 Jun 2008 12:29:31 +0000 (14:29 +0200)]
Replace all occurrences of `strcpy' with `sstrncpy'.

15 years agonginx plugin: Use `strtok_r' instead of `strtok'.
Florian Forster [Wed, 11 Jun 2008 12:24:34 +0000 (14:24 +0200)]
nginx plugin: Use `strtok_r' instead of `strtok'.

15 years agoMerge branch 'collectd-4.4'
Florian Forster [Tue, 10 Jun 2008 15:10:05 +0000 (17:10 +0200)]
Merge branch 'collectd-4.4'

15 years agoMerge branch 'collectd-4.3' into collectd-4.4
Florian Forster [Tue, 10 Jun 2008 15:09:46 +0000 (17:09 +0200)]
Merge branch 'collectd-4.3' into collectd-4.4

15 years agorrdtool plugin: Put files to the front of the update queue when receiving a flush...
Florian Forster [Mon, 9 Jun 2008 13:57:37 +0000 (15:57 +0200)]
rrdtool plugin: Put files to the front of the update queue when receiving a flush callback.

15 years agowireless plugins: Interpret noise/power values >100 as (dBm + 256).
JoW [Mon, 9 Jun 2008 11:27:16 +0000 (13:27 +0200)]
wireless plugins: Interpret noise/power values >100 as (dBm + 256).

Hi list,

I currently develop an embedded statistics application and web interface
for OpenWrt Kamikaze based on Collectd and RRDTool.

While working with the wireless plugin I noticed some incompatibilities
with different drivers, namely the Broadcom proprietary driver and madwifi.

  /proc/net/wireless on Broadcom:

   Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
    face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 18
      wl0: 0000    2.  179.  163.       0      0   8040    723      0        0

  With the Broadcom proprietary driver you get the actual signal and noise
  dbm units by substracting 255 from the values in /proc:

   level: 179 - 255 = -76 dBm
   noise: 163 - 255 = -92 dBm

  /proc/net/wireless on Atheros SoC:

   Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
    face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
     ath0: 0004   21.  -73.  -94.   21841      0      0      0      0        0

  Madwifi writes the actual dBm values into /proc.

So we have (at least for now) three possible types of values:

   ( x > 0.0   && x <= 100.0 ) current implementation: x is in percent (?)

   ( x > 100.0 && x <= 255.0 ) broadcom: range intersects with percents but
values below 100.0 (100.0 - 255.0 = -155.0 dBm)
are somewhat unlikely to occur

   ( x < 0.0 ) atheros: value is already in dBm

A patch which implements the two additional possibilities in collectd's wireless
plugin can be found in the OpenWrt Trac:

https://dev.openwrt.org/browser/packages/utils/collectd/patches/200-wireless-compat.patch

The patch was made against v4.4.0 of collectd but should work with v4.4.1 too.
It would be nice to have this in the next release or so :)

Greetings,
JoW

15 years agodisk plugin: Use correct name under Linux 2.4
Alessandro Iurlano [Sat, 7 Jun 2008 13:16:18 +0000 (15:16 +0200)]
disk plugin: Use correct name under Linux 2.4

Hello everybody.

I have noticed that disk graphs are displayed by collection.cgi as
disk (71687000) instead of the correct disk name on 2.4.x linux
kernels.
The problem seems caused by the fact that the position of disk name of
/proc/partitions (used in 2.4 kernels) differs from /proc/diskstats
(used in 2.6 kernels).

I include as attachment a patch that seems to fix this problem.
I have tested it on 2.4.20 (REDHAT 9) and 2.6.24.4 (Debian Sid) systems.

Thanks a lot for Collectd. It is a _very_ useful program.

Alessandro

Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agonetwork plugin: Don't blindly re-initialize everything in the init callback.
Florian Forster [Sat, 7 Jun 2008 18:39:04 +0000 (20:39 +0200)]
network plugin: Don't blindly re-initialize everything in the init callback.

Under Solaris the init functions are called every time the kstat chain
is updated. Since, among other things, send_buffer_fill was set to zero
here, the plugin ``forgot'' about values.

Thank you very much to Eric LeBlanc for debugging this issue.

15 years agoREADME: Added the "notify_email" plugin and "libesmtp".
Sebastian Harl [Thu, 5 Jun 2008 13:06:14 +0000 (15:06 +0200)]
README: Added the "notify_email" plugin and "libesmtp".

Also, the list of libraries in the "Prerequisites" has been sorted
alphabetically.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agoRenamed the desktop_notification plugin in README and collectd.conf as well.
Sebastian Harl [Thu, 5 Jun 2008 12:56:28 +0000 (14:56 +0200)]
Renamed the desktop_notification plugin in README and collectd.conf as well.

Also, reordered collectd.conf to restore alphabetical sorting.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agosrc/collectd.h: Try even harder to determine endianess.
Florian Forster [Fri, 6 Jun 2008 10:32:13 +0000 (12:32 +0200)]
src/collectd.h: Try even harder to determine endianess.

NexentaStor 1.0.2 doesn't have <endian.h>, for example :/

15 years agosrc/plugin.h: Use __attribute__((format)) for plugin_log.
Florian Forster [Fri, 6 Jun 2008 10:21:01 +0000 (12:21 +0200)]
src/plugin.h: Use __attribute__((format)) for plugin_log.

All __attribute__'s will be automatically set to /**/ when not using the
GNU CC via a macro in src/collectd.h. This way this should be portable.

15 years agonotify_desktop plugin: Renamed the desktop_notification plugin.
Florian Forster [Wed, 4 Jun 2008 21:28:54 +0000 (23:28 +0200)]
notify_desktop plugin: Renamed the desktop_notification plugin.

This way it's more consistent with the notify_email plugin.

15 years agonotify_email plugin: Renamed some configuration options.
Florian Forster [Wed, 4 Jun 2008 13:50:56 +0000 (15:50 +0200)]
notify_email plugin: Renamed some configuration options.

SMTPHost    -> SMTPServer
SMTPFrom    -> From
SMTPSubject -> Subject
EmailTo     -> Recipient

15 years agonotify_email plugin: Renamed the `emails' variable to `recipients'.
Florian Forster [Wed, 4 Jun 2008 13:45:10 +0000 (15:45 +0200)]
notify_email plugin: Renamed the `emails' variable to `recipients'.

This is much easier to understand.

15 years agonotify_email plugin: Some minor code cleanup.
Florian Forster [Wed, 4 Jun 2008 13:41:43 +0000 (15:41 +0200)]
notify_email plugin: Some minor code cleanup.

15 years agonotify_email plugin: Replace all sprintf's with ssnprintf's.
Florian Forster [Wed, 4 Jun 2008 13:32:40 +0000 (15:32 +0200)]
notify_email plugin: Replace all sprintf's with ssnprintf's.

Some other buffer handling has been improved, too.

15 years agonotify_email plugin: Add plugin to send notifications via email.
Oleg King [Wed, 4 Jun 2008 13:22:45 +0000 (15:22 +0200)]
notify_email plugin: Add plugin to send notifications via email.

Hello, Collectd.

I wrote a new plugin - notify_email.

This plugin will notify you when threshold conditions are met - one email per
one threshold notify. Email can be sent more then one recipient. Plugin does
this by initiating SMTP session to specified SMTP server (it can also do SMTP
AUTH if needed).

Plugin uses libesmtp library.

Please note:
  1. SMTPFrom value sometimes is checked by SMTP server - you
     can get failure from SMTP server if you are using not-existent
     email.

  2. SMTPSubject can contain two '%s' - first for severity and
     second for hostname.

  3. Hostname used in SMTP connection - is hostname_g, hostname
     that is used for all collectd host identification. If it cannot
     be resolved by internet DNS - you can expect problems when sending
     emails.

Patch and new file are included as attach.

15 years agoMerge branch 'collectd-4.4'
Florian Forster [Tue, 3 Jun 2008 17:20:49 +0000 (19:20 +0200)]
Merge branch 'collectd-4.4'

15 years agoBumped version to 4.4.1; Updated ChangeLog. collectd-4.4.1
Florian Forster [Tue, 3 Jun 2008 17:09:14 +0000 (19:09 +0200)]
Bumped version to 4.4.1; Updated ChangeLog.

15 years agoascent plugin: Added "Verify{Peer,Host}" configuration options.
Sebastian Harl [Sun, 1 Jun 2008 13:44:10 +0000 (15:44 +0200)]
ascent plugin: Added "Verify{Peer,Host}" configuration options.

Those options may be used to disable peer SSL certificate or peer host name
verification respectively. The apache and nginx plugins already support those
options, so this makes configuration of plugins using libcurl more consistent.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agoCollectd.pm: Updated copyright information.
Sebastian Harl [Thu, 29 May 2008 22:13:07 +0000 (00:13 +0200)]
Collectd.pm: Updated copyright information.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agoperl plugin: Fixed a segfault that appeared in Perl 5.10.
Sebastian Harl [Thu, 29 May 2008 22:12:36 +0000 (00:12 +0200)]
perl plugin: Fixed a segfault that appeared in Perl 5.10.

In Perl 5.10, av_clear() (amongst others) does no longer allow NULL for
the passed array object pointer, thus we have to check for it ourselves.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agoperl plugin: Don't abort if initializing the interpreter failed.
Sebastian Harl [Thu, 29 May 2008 22:09:18 +0000 (00:09 +0200)]
perl plugin: Don't abort if initializing the interpreter failed.

There is no reason to shutdown collectd completely just because of some
Perl specific error. An error message is logged in this case, so the user
has means to detect it.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agosrc/collectd.conf.in: Fix a typo.
Florian Forster [Sat, 31 May 2008 08:35:40 +0000 (10:35 +0200)]
src/collectd.conf.in: Fix a typo.

The config for the disk plugin was in a block for the `df' plugin.
Thanks to onebinary for pointing this out :)

15 years agosrc/processes.c: Remove an unused variable.
Florian Forster [Fri, 30 May 2008 13:08:54 +0000 (15:08 +0200)]
src/processes.c: Remove an unused variable.

Thanks to Oleg for pointing this out :)

15 years agoMerge branch 'collectd-4.4' of octo@verplant.org:/var/lib/git/collectd into collectd-4.4
Florian Forster [Tue, 27 May 2008 15:52:36 +0000 (17:52 +0200)]
Merge branch 'collectd-4.4' of octo@verplant.org:/var/lib/git/collectd into collectd-4.4

15 years agoprocesses plugin: Remove trailing whitespaces.
Florian Forster [Tue, 27 May 2008 15:51:07 +0000 (17:51 +0200)]
processes plugin: Remove trailing whitespaces.

15 years agoprocesses plugin: Use `strjoin' to create cmdline from argv.
Florian Forster [Tue, 27 May 2008 15:50:41 +0000 (17:50 +0200)]
processes plugin: Use `strjoin' to create cmdline from argv.

15 years agoprocesses plugin: Convert C++-style comments to C89-style.
Florian Forster [Tue, 27 May 2008 15:36:17 +0000 (17:36 +0200)]
processes plugin: Convert C++-style comments to C89-style.

And remove a newline.

15 years agoprocesses plugin: ps_list_match: If a regex is configures, only use that regex.
Florian Forster [Tue, 27 May 2008 15:27:15 +0000 (17:27 +0200)]
processes plugin: ps_list_match: If a regex is configures, only use that regex.

15 years agoprocesses plugin: Fixed the config callback to return the right values.
Florian Forster [Tue, 27 May 2008 15:21:42 +0000 (17:21 +0200)]
processes plugin: Fixed the config callback to return the right values.

15 years agoprocesses plugin: Updated copyright information.
Florian Forster [Tue, 27 May 2008 15:20:57 +0000 (17:20 +0200)]
processes plugin: Updated copyright information.

15 years agoprocesses plugin: Let `ps_list_register' fail if any part of the regex stuff fails.
Florian Forster [Tue, 27 May 2008 15:13:35 +0000 (17:13 +0200)]
processes plugin: Let `ps_list_register' fail if any part of the regex stuff fails.

15 years agoprocesses plugin: Use STATIC_ARRAY_SIZE instead of numeric value.
Florian Forster [Tue, 27 May 2008 14:53:14 +0000 (16:53 +0200)]
processes plugin: Use STATIC_ARRAY_SIZE instead of numeric value.

15 years agoprocesses plugin: Add the `ProcessMatch' option.
Oleg King [Tue, 27 May 2008 14:48:51 +0000 (16:48 +0200)]
processes plugin: Add the `ProcessMatch' option.

Hello!

There is a patch for processes plugin:

1. Added support for libkvm, so processes plugin will be run under
FreeBSD.

2. Added ProcessMatch "NAME" "REGEXP" directive, that adds process
into list of processes that we watch on, but with identification by
Regexp. Rexexp matched against command line, if command line is
empty, than against task name.

3. Changed way we finding processes. Now we match not only first
process, but all processes that match selected criteria. This allows
to make some type of "grouping":

Process "httpd"
Process "dhclient"
ProcessMatch "only-my-perl-program" "perl(.*)my-program\.pl"
ProcessMatch "perl-programs" "^/usr/bin/perl"
ProcessMatch "all-tasks" "(.*)"

Patch is attached to this message.

To octo: it is neede to make some thiungs I have not done:

1. make changes in manpages
2. make changes in config file
3. write rules that users should use when giving names with ProcessMatch

15 years agonetwork plugin: Documented (in the source) that the network plugin cannot flush indiv...
Florian Forster [Tue, 27 May 2008 14:37:35 +0000 (16:37 +0200)]
network plugin: Documented (in the source) that the network plugin cannot flush individual values.

15 years agoMerge branch 'collectd-4.4'
Florian Forster [Tue, 27 May 2008 11:16:55 +0000 (13:16 +0200)]
Merge branch 'collectd-4.4'

15 years agoMerge branch 'collectd-4.3' into collectd-4.4
Florian Forster [Tue, 27 May 2008 11:16:46 +0000 (13:16 +0200)]
Merge branch 'collectd-4.3' into collectd-4.4

15 years agobuild.sh: Check for lex and yacc.
Sebastian Harl [Sat, 24 May 2008 20:29:56 +0000 (22:29 +0200)]
build.sh: Check for lex and yacc.

Warn the user, if lex(1) and yacc(1) cannot be found. This is not
necessarily an error, as flex(1) or bison(1) might be available.

As suggested by Kevin Trumbull (onebinary) on IRC.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agosrc/liboconfig/oconfig.c: Declare "c_file" as "const char *".
Sebastian Harl [Sat, 24 May 2008 18:32:43 +0000 (20:32 +0200)]
src/liboconfig/oconfig.c: Declare "c_file" as "const char *".

This fixes an "assignment discards qualifiers from pointer target type"
warning. That string stores the name of the config file which is not
going to be modified by liboconfig.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agosrc/plugin.c: Don't require write callbacks to be present.
Sebastian Harl [Thu, 22 May 2008 11:37:57 +0000 (13:37 +0200)]
src/plugin.c: Don't require write callbacks to be present.

plugin_dispatch_values() used to fail, if no write callbacks had been
registered. As that function is used to update the cache and check
threshold as well, this limited the flexibility of collectd setups. Thus,
the error message has been downgraded to a one-time complaint.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agosrc/utils_complain.[ch]: Reintroduced an improved version of the complain mechanism.
Sebastian Harl [Thu, 22 May 2008 11:34:54 +0000 (13:34 +0200)]
src/utils_complain.[ch]: Reintroduced an improved version of the complain mechanism.

This has been asked for a couple of times and since I need it now, here it
goes... ;-) I've done the following modifications to Florian's original
version:

 * Renamed "plugin_complain" to "c_complain".
 * Renamed "plugin_relief" to "c_release", thus using two verbs which is
   more consistent imho.
 * Added "c_complain_once" to report a complaint only once.
 * Use timestamps instead of counting multiples of "interval_g" to
   determine when to report again. Thus, multiple calls to the complain-
   functions in one interval are allowed.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agosrc/utils_llist.c: Improved robustness against NULL pointers.
Sebastian Harl [Thu, 22 May 2008 11:36:00 +0000 (13:36 +0200)]
src/utils_llist.c: Improved robustness against NULL pointers.

All functions searching for some list entry now return NULL if the given
list equals NULL. Imho, that's the expected behavior. Also, it removes the
need to check the lists from the calling function while that function
usually checks the returned list entry anyway.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agocollectd-nagios: Updated to the new "unixsock" protocol.
Sebastian Harl [Wed, 21 May 2008 14:50:07 +0000 (16:50 +0200)]
collectd-nagios: Updated to the new "unixsock" protocol.

When disambiguating the protocol used by the unixsock plugin in commit
90287c6d240a168fca8d01f8330e2e2263e1f0a4 ("Disambiguated the protocol used
by the unixsock (and other) plugins.") the formatting of the return values
of the "GETVAL" command has been modified. This patch updates
collectd-nagios to handle the new format correctly.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agosrc/{email,ntpd,utils_cmd_getval}.c: Fix formatting errors.
Florian Forster [Mon, 26 May 2008 13:27:35 +0000 (15:27 +0200)]
src/{email,ntpd,utils_cmd_getval}.c: Fix formatting errors.

15 years agosrc/utils_threshold.c: Fix wrong output (was `min, min', should be `min, max') in...
Dieter Bloms [Sun, 25 May 2008 09:15:15 +0000 (11:15 +0200)]
src/utils_threshold.c: Fix wrong output (was `min, min', should be `min, max') in the created notification.

Resolves: #16

15 years agosrc/collectd.conf.in: Add sample section for the disk plugin.
Florian Forster [Sun, 25 May 2008 09:11:28 +0000 (11:11 +0200)]
src/collectd.conf.in: Add sample section for the disk plugin.

Resolves: #15

15 years agoconfigure: Reformatted the configuration summary.
Sebastian Harl [Mon, 19 May 2008 21:12:42 +0000 (23:12 +0200)]
configure: Reformatted the configuration summary.

The name of the "desktop_notification" plugin was too long to fit into the
formatting of the summary printed at the end of the configure run. To keep
the other patch readable, fixing this has been split into an extra patch.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
15 years agodesktop_notification: Added a plugin to send desktop notifications.
Sebastian Harl [Mon, 19 May 2008 21:08:17 +0000 (23:08 +0200)]
desktop_notification: Added a plugin to send desktop notifications.

This plugin sends desktop notifications to a notification daemon, as
defined in the Desktop Notification Specification (see
http://www.galago-project.org/specs/notification/).

The timeout after which to expire the displayed notification may be
configured in collectd.conf.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
16 years agocontrib/cussh.pl: Implemented a `HELP' command.
Florian Forster [Tue, 13 May 2008 15:05:30 +0000 (17:05 +0200)]
contrib/cussh.pl: Implemented a `HELP' command.

16 years agoMerge branch 'collectd-4.4'
Florian Forster [Tue, 13 May 2008 14:58:41 +0000 (16:58 +0200)]
Merge branch 'collectd-4.4'