Code

Merge "fix xff excessive rounding" into collectd-4.10
authorFlorian Forster <octo@collectd.org>
Fri, 26 Aug 2011 12:37:25 +0000 (14:37 +0200)
committerGerrit Code Review <gerrit2@huhu.verplant.org>
Fri, 26 Aug 2011 12:37:25 +0000 (14:37 +0200)
.gitignore
configure.in
contrib/collectd_unixsock.py
src/plugin.c

index e8f9af66d7879336910ff56dd76f8b70d796dd23..b85bdec680ee0f1f2342be127cd25fce740605af 100644 (file)
@@ -33,6 +33,7 @@ src/stamp-h1
 .libs/
 src/collectd
 src/collectd-nagios
+src/collectdctl
 src/collectdmon
 src/*.1
 src/*.5
index d4874bde448fab657b82e81c4f676c3b3ea906f0..254e7fdfaa936a8a128ef11fc0c24ebae142269a 100644 (file)
@@ -1638,7 +1638,8 @@ then
        [
                with_libiptc="yes"
                with_own_libiptc="yes"
-       ])
+       ],
+       [-lip4tc -lip6tc])
 fi
 # The system wide version failed for some reason. Check if we have the required
 # headers to build the shipped version.
index ebe040d6a11846ab77fe446112668e29354f904f..1b8e6b174ed8d8ad1a7abc1237842e03d5908075 100644 (file)
@@ -68,8 +68,9 @@ class Collectd():
         """
         numvalues = self._cmd('GETTHRESHOLD "%s"' % identifier)
         lines = []
-        if numvalues:
-            lines = self._readlines(numvalues)
+        if not numvalues or numvalues < 0:
+            raise KeyError("Identifier '%s' not found" % identifier)
+        lines = self._readlines(numvalues)
         return lines
 
     def getval(self, identifier, flush_after=True):
@@ -83,8 +84,9 @@ class Collectd():
         """
         numvalues = self._cmd('GETVAL "%s"' % identifier)
         lines = []
-        if numvalues:
-            lines = self._readlines(numvalues)
+        if not numvalues or numvalues < 0:
+            raise KeyError("Identifier '%s' not found" % identifier)
+        lines = self._readlines(numvalues)
         if flush_after:
             self.flush(identifiers=[identifier])
         return lines
index a3f10ae2b4952e954f0213f9edac18e9ce3e869c..6d7c96e4e8862784ba3b1f3a4737057bd8701688 100644 (file)
@@ -1358,7 +1358,8 @@ int plugin_dispatch_values (value_list_t *vl)
        if ((vl == NULL) || (vl->type[0] == 0)
                        || (vl->values == NULL) || (vl->values_len < 1))
        {
-               ERROR ("plugin_dispatch_values: Invalid value list.");
+               ERROR ("plugin_dispatch_values: Invalid value list "
+                               "from plugin %s.", vl->plugin);
                return (-1);
        }