Code

Merge branch 'collectd-4.5'
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Fri, 3 Oct 2008 21:18:28 +0000 (23:18 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Fri, 3 Oct 2008 21:18:28 +0000 (23:18 +0200)
src/collectd.conf.pod
src/collectdmon.c
src/iptables.c
src/ipvs.c
src/utils_ignorelist.c

index 0bca23e35cf86530049e684e93871cb88f3b6c1a..0cf1c2435c9f5ab1d011d4a9468233df29e49a74 100644 (file)
@@ -2022,6 +2022,9 @@ hosts sends it's CPU statistics to the server every 60 seconds, a notification
 will be dispatched after about 120 seconds. It may take a little longer because
 the timeout is checked only once each B<Interval> on the server.
 
+When a value comes within range again or is received after it was missing, an
+"OKAY-notification" is dispatched.
+
 Here is a configuration example to get you started. Read below for more
 information.
 
index e496eb07a65d23138513786967fb0fb2350f6fa3..015344f96a8e07b0fabf1dba614b559b280e0397 100644 (file)
@@ -331,12 +331,6 @@ int main (int argc, char **argv)
                return 1;
        }
 
-       sigaddset (&sa.sa_mask, SIGCHLD);
-       if (0 != sigprocmask (SIG_BLOCK, &sa.sa_mask, NULL)) {
-               syslog (LOG_ERR, "Error: sigprocmask() failed: %s", strerror (errno));
-               return 1;
-       }
-
        while (0 == loop) {
                int status = 0;
 
index 4d15c6e0896ac62e15b3082fb6c622403c4add2d..e1694af3475407ae75ba98de73e8b48598e63a56 100644 (file)
@@ -107,8 +107,8 @@ static int iptables_config (const char *key, const char *value)
                table = fields[0];
                chain = fields[1];
 
-               table_len = strlen (table);
-               if ((unsigned int)table_len >= sizeof(temp.table))
+               table_len = strlen (table) + 1;
+               if ((unsigned int)table_len > sizeof(temp.table))
                {
                        ERROR ("Table `%s' too long.", table);
                        free (value_copy);
@@ -116,8 +116,8 @@ static int iptables_config (const char *key, const char *value)
                }
                sstrncpy (temp.table, table, table_len);
 
-               chain_len = strlen (chain);
-               if ((unsigned int)chain_len >= sizeof(temp.chain))
+               chain_len = strlen (chain) + 1;
+               if ((unsigned int)chain_len > sizeof(temp.chain))
                {
                        ERROR ("Chain `%s' too long.", chain);
                        free (value_copy);
index 10c4d1517415cb7bf0b57a216f5cd4f3a8c22513..85e65d27e57823f2fa3776237d125cf5db82e4d3 100644 (file)
@@ -280,7 +280,7 @@ static void cipvs_submit_dest (char *pi, struct ip_vs_dest_entry *de) {
 
        char ti[DATA_MAX_NAME_LEN];
 
-       if (0 != get_ti (de, ti, DATA_MAX_NAME_LEN))
+       if (0 != get_ti (de, ti, sizeof (ti)))
                return;
 
        cipvs_submit_connections (pi, ti, stats.conns);
@@ -298,7 +298,7 @@ static void cipvs_submit_service (struct ip_vs_service_entry *se)
 
        int i = 0;
 
-       if (0 != get_pi (se, pi, DATA_MAX_NAME_LEN))
+       if (0 != get_pi (se, pi, sizeof (pi)))
                return;
 
        cipvs_submit_connections (pi, NULL, stats.conns);
index 518715b1f48ada50c018e38f600dd6c14bcbd66f..de42d0fa399035e0f2e3930866d2be670557fc72 100644 (file)
@@ -306,11 +306,12 @@ int ignorelist_add (ignorelist_t *il, const char *entry)
        if ((entry_len > 2) && (entry[0] == '/') && entry[entry_len - 1] == '/')
        {
                char *entry_copy;
+               size_t entry_copy_size;
 
                /* We need to copy `entry' since it's const */
-               entry_copy = smalloc (entry_len);
-               memset (entry_copy, '\0', entry_len);
-               sstrncpy (entry_copy, entry + 1, entry_len - 2);
+               entry_copy_size = entry_len - 1;
+               entry_copy = smalloc (entry_copy_size);
+               sstrncpy (entry_copy, entry + 1, entry_copy_size);
 
                DEBUG("I'm about to add regex entry: %s", entry_copy);
                ret = ignorelist_append_regex(il, entry_copy);