From 8c659521864ad0516d6eccad68bf22e2c4195ff1 Mon Sep 17 00:00:00 2001 From: octo Date: Sat, 21 Jan 2006 10:57:46 +0000 Subject: [PATCH] Bumped version to 3.5.2 Ported improvements on ping-plugin from 3.6.0 to 3.5.2 Fixed typo in the signal handling.. --- ChangeLog | 5 +++++ collectd.spec | 5 ++++- configure.in | 2 +- debian/changelog | 6 +++++ src/collectd.c | 2 +- src/ping.c | 58 ++++++++++++++++++++++++++++++------------------ 6 files changed, 53 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index a785e3b3..4c42b007 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-01-21, Version 3.5.2 + * Fixed yet another bug in the signal handling.. Stupid typo.. + * Improved the ping plugin to not give up on socket errors (backport + from 3.6.0). + 2005-12-18, Version 3.5.1 * The PID-file is now deleted correctly when shutting down the daemon. * SIGINT and SIGTERM are now handled correctly. diff --git a/collectd.spec b/collectd.spec index 0bc5bd2c..6e20862d 100644 --- a/collectd.spec +++ b/collectd.spec @@ -1,6 +1,6 @@ Summary: Statistics collection daemon for filling RRD files. Name: collectd -Version: 3.5.1 +Version: 3.5.2 Release: 1 Source: http://verplant.org/collectd/%{name}-%{version}.tar.gz License: GPL @@ -84,6 +84,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0444,root,root) %{_libdir}/%{name}/hddtemp.so* %changelog +* Sat Jan 21 2006 Florian octo Forster 3.5.2-1 +- New upstream version + * Wed Dec 07 2005 Florian octo Forster 3.5.0-1 - New upstream version diff --git a/configure.in b/configure.in index db2fdb5e..bed79f5e 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(collectd, 3.5.0) +AC_INIT(collectd, 3.5.2) AC_CONFIG_SRCDIR(src/collectd.c) AC_CONFIG_HEADERS(src/config.h) AM_INIT_AUTOMAKE(dist-bzip2) diff --git a/debian/changelog b/debian/changelog index 9488d3cf..97801ab3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +collectd (3.5.2-1) unstable; urgency=low + + * New upstream version + + -- Florian Forster Sat, 21 Jan 2006 11:55:49 +0200 + collectd (3.5.1-1) unstable; urgency=low * New upstream version diff --git a/src/collectd.c b/src/collectd.c index 4fdfcf10..97f1edce 100644 --- a/src/collectd.c +++ b/src/collectd.c @@ -411,7 +411,7 @@ int main (int argc, char **argv) sigIntAction.sa_handler = sigIntHandler; sigaction (SIGINT, &sigIntAction, NULL); - sigIntAction.sa_handler = sigTermHandler; + sigTermAction.sa_handler = sigTermHandler; sigaction (SIGTERM, &sigTermAction, NULL); /* diff --git a/src/ping.c b/src/ping.c index d418232f..32cfd29b 100644 --- a/src/ping.c +++ b/src/ping.c @@ -31,9 +31,11 @@ #include #include "libping/ping.h" -extern char *pinghosts[MAX_PINGHOSTS]; -extern int num_pinghosts; -static int pingerrors[MAX_PINGHOSTS]; +static char *hosts[MAX_PINGHOSTS]; +static int hosts_flags[MAX_PINGHOSTS]; +static int hosts_disable[MAX_PINGHOSTS]; +static int hosts_backoff[MAX_PINGHOSTS]; +static int num_pinghosts; static char *file_template = "ping-%s.rrd"; @@ -48,8 +50,12 @@ void ping_init (void) { int i; - for (i = 0; i < num_pinghosts; i++) - pingerrors[i] = 0; + for (i = 0; i < MAX_PINGHOSTS; i++) + { + hosts_flags[i] = 0; + hosts_disable[i] = 0; + hosts_backoff[i] = 1; + } return; } @@ -87,41 +93,49 @@ void ping_read (void) for (i = 0; i < num_pinghosts; i++) { - if (pingerrors[i] & 0x30) + if (hosts_disable[i] > 0) + { + hosts_disable[i]--; continue; + } - ping = tpinghost (pinghosts[i]); + ping = tpinghost (hosts[i]); switch (ping) { case 0: - if (!(pingerrors[i] & 0x01)) - syslog (LOG_WARNING, "ping %s: Connection timed out.", pinghosts[i]); - pingerrors[i] |= 0x01; + if (!(hosts_flags[i] & 0x01)) + syslog (LOG_WARNING, "ping %s: Connection timed out.", hosts[i]); + hosts_flags[i] |= 0x01; break; case -1: - if (!(pingerrors[i] & 0x02)) - syslog (LOG_WARNING, "ping %s: Host or service is not reachable.", pinghosts[i]); - pingerrors[i] |= 0x02; + if (!(hosts_flags[i] & 0x02)) + syslog (LOG_WARNING, "ping %s: Host or service is not reachable.", hosts[i]); + hosts_flags[i] |= 0x02; break; case -2: - syslog (LOG_ERR, "ping %s: Socket error. Ping will be disabled.", pinghosts[i]); - pingerrors[i] |= 0x10; + syslog (LOG_ERR, "ping %s: Socket error. Ping will be disabled for %i iteration(s).", + hosts[i], hosts_backoff[i]); + hosts_disable[i] = hosts_backoff[i]; + if (hosts_backoff[i] < 8192) /* 22 3/4 hours */ + hosts_backoff[i] *= 2; + hosts_flags[i] |= 0x10; break; case -3: - if (!(pingerrors[i] & 0x04)) - syslog (LOG_WARNING, "ping %s: Connection refused.", pinghosts[i]); - pingerrors[i] |= 0x04; + if (!(hosts_flags[i] & 0x04)) + syslog (LOG_WARNING, "ping %s: Connection refused.", hosts[i]); + hosts_flags[i] |= 0x04; break; default: - if (pingerrors[i] != 0x00) - syslog (LOG_NOTICE, "ping %s: Back to normal: %ims.", pinghosts[i], ping); - pingerrors[i] = 0x00; - ping_submit (ping, pinghosts[i]); + if (hosts_flags[i] != 0x00) + syslog (LOG_NOTICE, "ping %s: Back to normal: %ims.", hosts[i], ping); + hosts_flags[i] = 0x00; + hosts_backoff[i] = 1; + ping_submit (ping, hosts[i]); } /* switch (ping) */ } /* for (i = 0; i < num_pinghosts; i++) */ } -- 2.30.2