Merge branch 'master' of github.com:bbczeuz/collectd
authorClaudius Zingerli <gitmail@zeuz.ch>
Fri, 12 Feb 2016 10:48:19 +0000 (11:48 +0100)
committerClaudius Zingerli <gitmail@zeuz.ch>
Fri, 12 Feb 2016 10:48:19 +0000 (11:48 +0100)
19 files changed:
ChangeLog
contrib/redhat/collectd.spec
contrib/systemd.collectd.service
contrib/wiki2changelog.pl
src/collectd.conf.in
src/collectd.conf.pod
src/collectdmon.c
src/daemon/plugin.c
src/daemon/utils_ignorelist.c
src/daemon/utils_ignorelist.h
src/df.c
src/drbd.c
src/processes.c
src/turbostat.c
src/utils_mount.c
src/utils_mount.h
src/virt.c
src/write_sensu.c
version-gen.sh

index b0a997c..48dc6ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,76 @@
+2016-01-22, Version 5.5.1
+       * Build system: Compilation errors have been avoided by correctly
+         defining package name and version used by autoconf. Thanks to Nathan
+         Berkley. #1063
+       * Build system: Dependency ordering was fixed to ensure parallel builds
+         work reliably. Thanks to Gustavo Zacarias. #1125
+       * Build system: Error messages have been improved and building the unit
+         tests has been fixed on Solaris. Thanks to Florian Forster and
+         Dagobert Michelsen. #1077
+       * Build system: The move of the "utils_ignorelist" functions has been
+         reverted. This fixes build issues of numerous plugins. Thanks to
+         Benjamin Drung;. #1323
+       * Build system: The fhcount plugin has been restricted to Linux. Thanks
+         to Ruben Kerkhof. #1195
+       * Build system: Detection of header files for the turbostat plugin has
+         been fixed. Thanks to Marc Fournier. #1075
+       * collectd: The "LC_NUMERIC" locale is now forced, to prevent issues
+         with some plugins on environments using a comma as decimal separator.
+         Thanks to Florian Forster. #1237
+       * Documentation: Some precisions related to the virt plugin have beed
+         added. Thanks to Wojtek Bocer and Ruben Kerkhof.
+       * Documentation: The CollectdInternalStats documentation has been
+         improved. Thanks to Yves Mettier and Florian Forster.
+       * Battery plugin: A missing Type has been added. Thanks to Marc
+         Fournier. #1338
+       * Bind plugin: An off-by-one error has been fixed: an index was checked
+         against a wrong variable, which may lead to an out-of-bounds read.
+         Thanks to Michal Humpula. #1123
+       * Ceph plugin: JSON parsing has been refactored to support ceph 10.0.0
+         and fixes several buffer overflows. Thanks to Florian Forster. #1350
+       * CPU plugin: A Mac OS X specific bug has been fixed: the plugin
+         expected an incorrect number of CPU states, resulting in failing read
+         callbacks. This regression was introduced in 5.5.0. Thanks to Robert
+         Viduya.
+       * Disk plugin: Support for Mac OS X 10.10 has been added. Thanks to
+         Robert Viduya. #1065
+       * IPC plugin: Support for building with musl-libc has been added. Thanks
+         to Natanael Copa. #1147
+       * Log Logstash plugin: A segfault when using libyajl, version 1 was
+         fixed. Thanks to Vincent Bernat. #1190
+       * Log Logstash plugin: The timestamp is now ISO 8601 compliant. Thanks
+         to Marc Fournier. #1132
+       * memcached plugin: The Type of the listen-disabled metric was fixed.
+         Thanks to Florian Forster. #1356
+       * MySQL plugin: The Type used by Innodb_buffer_pool_pages_flushed was
+         fixed. Thanks to Marek Becka. #1085
+       * OpenLDAP plugin: A crash when using LDAPI (LDAP-over-IPC) got fixed.
+         Thanks to Marek Becka. #1080
+       * OpenLDAP plugin: Support for Mac OS X has been added. Thanks to Ruben
+         Kerkhof. #1489
+       * SMART plugin: A memory leak has been fixed. Thanks to Florian
+         Schüller and Pierre-Yves Ritschard. #1076
+       * Swap plugin: A regression that would lead to swap usage being reported
+         in kilobytes (instead of bytes) has been fixed. Thanks to Marek Becka.
+         #1071
+       * Varnish plugin: Support for FreeBSD has been added. Thanks to Ruben
+         Kerkhof. #1182
+       * Varnish plugin: Support for versions 3 and 4 has been made more
+         tolerant to minor changes in Varnish point releases. Thanks to Marc
+         Fournier. #1302
+       * virt plugin: A copy-and-paste mistake in an error message has been
+         fixed. Thanks to Ruben Kerkhof. #1101
+       * Write Kafka plugin: Support for Solaris has been added. Thanks to
+         Shahul Hameed. #1171
+       * Write Redis plugin: Dead code has been removed. Thanks to Brian Kelly.
+         #1143
+       * 27 patches have been applied to numerous plugins and core components,
+         fixing various programming errors which were reported by scan-build,
+         libasan, FBInfer, coverity-scan and clang: Thanks to Ruben Kerkhof,
+         Florian Forster and Marek Becka.
+       * Collectd::Unixsock: A Perl error got corrected. Thanks to Ciaran Mac
+         An Iomaire. #1295
+
 2015-05-27, Version 5.5.0
        * Build system: Ability to make out-of-tree builds has been fixed.
          Thanks to Vincent Bernat. #792
index 4dfcc9a..f0feb90 100644 (file)
@@ -62,7 +62,6 @@
 %{?el7:%global _has_lvm2app_h 1}
 %{?el7:%global _has_libudev 1}
 %{?el7:%global _has_recent_librrd 1}
-%{?el7:%global _has_varnish4 1}
 %{?el7:%global _has_broken_libmemcached 1}
 %{?el7:%global _has_iproute 1}
 %{?el7:%global _has_atasmart 1}
 %define with_uptime 0%{!?_without_uptime:1}
 %define with_users 0%{!?_without_users:1}
 %define with_uuid 0%{!?_without_uuid:1}
-%define with_varnish 0%{!?_without_varnish:0%{!?_has_varnish4:1}}
+%define with_varnish 0%{!?_without_varnish:1}
 %define with_vmem 0%{!?_without_vmem:1}
 %define with_vserver 0%{!?_without_vserver:1}
 %define with_wireless 0%{!?_without_wireless:1}
index 0e758e4..c7806fe 100644 (file)
@@ -10,12 +10,22 @@ EnvironmentFile=-/etc/default/collectd
 ProtectSystem=full
 ProtectHome=true
 
-# drop all capabilities:
-CapabilityBoundingSet=
-# use this instead if you use the dns or ping plugin
-#CapabilityBoundingSet=CAP_NET_RAW
-# turn this on if you use the iptables next to the dns or ping plugin
+# A few plugins won't work without some privileges, which you'll have to
+# specify using the CapabilityBoundingSet directive below.
+#
+# Here's a (incomplete) list of the plugins known capability requirements:
+#   ceph            CAP_DAC_OVERRIDE
+#   dns             CAP_NET_RAW
+#   exec            CAP_SETUID CAP_SETGID
+#   iptables        CAP_NET_ADMIN
+#   ping            CAP_NET_RAW
+#   turbostat       CAP_SYS_RAWIO
+#
+# Example, if you use the iptables plugin alongside the dns or ping plugin:
 #CapabilityBoundingSet=CAP_NET_RAW CAP_NET_ADMIN
+#
+# By default, drop all capabilities:
+CapabilityBoundingSet=
 
 NoNewPrivileges=true
 
index b8fc965..e6affa5 100755 (executable)
@@ -64,8 +64,8 @@ while (<>)
 
        $line =~ s#\{\{Plugin\|([^}]+)\}\}#$1 plugin#g;
        $line =~ s@\{\{Issue\|([^}]+)\}\}@#$1@g;
-       $line =~ s#\[\[[^|]+\|([^\]]+)\]\]#$1#g;
-       $line =~ s#\[\[([^|]+)\]\]#$1#g;
+       $line =~ s#\[\[[^|\]]+\|([^\]]+)\]\]#$1#g;
+       $line =~ s#\[\[([^|\]]+)\]\]#$1#g;
 
        $line =~ s#'''(.*?)'''#*$1*#g;
        $line =~ s#''(.*?)''#$1#g;
index bb1d667..953b5e4 100644 (file)
 #      FSType "ext3"
 #      IgnoreSelected false
 #      ReportByDevice false
-#      ReportReserved false
 #      ReportInodes false
 #      ValuesAbsolute true
 #      ValuesPercentage false
index b992eac..6a94edc 100644 (file)
@@ -2540,6 +2540,23 @@ do that: By setting B<IgnoreSelected> to I<true> the effect of
 B<Interface> is inverted: All selected interfaces are ignored and all
 other interfaces are collected.
 
+It is possible to use regular expressions to match interface names, if the
+name is surrounded by I</.../> and collectd was compiled with support for
+regexps. This is useful if there's a need to collect (or ignore) data
+for a group of interfaces that are similarly named, without the need to
+explicitly list all of them (especially useful if the list is dynamic).
+Example:
+
+ Interface "lo"
+ Interface "/^veth/"
+ Interface "/^tun[0-9]+/"
+ IgnoreSelected "true"
+
+This will ignore the loopback interface, all interfaces with names starting
+with I<veth> and all interfaces with names starting with I<tun> followed by
+at least one digit.
+
+
 =item B<UniqueName> I<true>|I<false>
 
 Interface name is not unique on Solaris (KSTAT), interface name is unique 
@@ -4483,6 +4500,18 @@ Sets the I<command file> to write to. Defaults to F</usr/local/nagios/var/rw/nag
 
 =head2 Plugin C<ntpd>
 
+The C<ntpd> plugin collects per-peer ntpd data such as time offset and time
+dispersion.
+
+For talking to B<ntpd>, it mimics what the B<ntpdc> control program does on
+wire - using B<mode 7> specific requests. This mode is deprecated with
+newer B<ntpd> releases (4.2.7p230 and later). For the C<ntpd> plugin to work
+correctly with them, the ntp daemon must be explicitly configured to
+enable B<mode 7> (which is disabled by default). Refer to the I<ntp.conf(5)>
+manual page for details.
+
+Available configuration options for the C<ntpd> plugin:
+
 =over 4
 
 =item B<Host> I<Hostname>
@@ -6271,9 +6300,9 @@ removed from the internal cache.
 
 =item B<CounterSum> B<false>|B<true>
 
-When enabled, create a C<count> metric which reports the change since the last
+When enabled, creates a C<count> metric which reports the change since the last
 read. This option primarily exists for compatibility with the I<statsd>
-impelemtation by Etsy.
+implementation by Etsy.
 
 =item B<TimerPercentile> I<Percent>
 
index f2798ee..65271dd 100644 (file)
@@ -119,7 +119,7 @@ static int pidfile_delete (void)
 static int daemonize (void)
 {
        struct rlimit rl;
-       int status;
+       int dev_null;
 
        pid_t pid = 0;
        int   i   = 0;
@@ -153,29 +153,30 @@ static int daemonize (void)
        for (i = 0; i < (int)rl.rlim_max; ++i)
                close (i);
 
-       errno = 0;
-       status = open ("/dev/null", O_RDWR);
-       if (status != 0) {
-               syslog (LOG_ERR, "Error: couldn't connect STDIN to /dev/null: %s",
-                               strerror (errno));
+       dev_null = open ("/dev/null", O_RDWR);
+       if (dev_null == -1) {
+               syslog (LOG_ERR, "Error: couldn't failed to open /dev/null: %s", strerror (errno));
                return -1;
        }
 
-       errno = 0;
-       status = dup (0);
-       if (status != 1) {
-               syslog (LOG_ERR, "Error: couldn't connect STDOUT to /dev/null: %s",
-                               strerror (errno));
+       if (dup2 (dev_null, STDIN_FILENO) == -1) {
+               syslog (LOG_ERR, "Error: couldn't connect STDIN to /dev/null: %s", strerror (errno));
                return -1;
        }
 
-       errno = 0;
-       status = dup (0);
-       if (status != 2) {
-               syslog (LOG_ERR, "Error: couldn't connect STDERR to /dev/null: %s",
-                               strerror (errno));
+       if (dup2 (dev_null, STDOUT_FILENO) == -1) {
+               syslog (LOG_ERR, "Error: couldn't connect STDOUT to /dev/null: %s", strerror (errno));
                return -1;
        }
+
+       if (dup2 (dev_null, STDERR_FILENO) == -1) {
+               syslog (LOG_ERR, "Error: couldn't connect STDERR to /dev/null: %s", strerror (errno));
+               return -1;
+       }
+
+       if ((dev_null != STDIN_FILENO) && (dev_null != STDOUT_FILENO) && (dev_null != STDERR_FILENO))
+               close (dev_null);
+
        return 0;
 } /* daemonize */
 
index 0919bdf..e5e0a45 100644 (file)
@@ -2402,7 +2402,7 @@ int plugin_dispatch_multivalue (value_list_t const *template, /* {{{ */
                case DS_TYPE_GAUGE:
                        vl->values[0].gauge = va_arg (ap, gauge_t);
                        if (store_percentage)
-                               vl->values[0].gauge *= 100.0 / sum;
+                               vl->values[0].gauge *= sum ? (100.0 / sum) : 0;
                        break;
                case DS_TYPE_ABSOLUTE:
                        vl->values[0].absolute = va_arg (ap, absolute_t);
index 60a8c27..1268838 100644 (file)
  * ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * See the GNU General Public Licence for more details.
  *
- * You should have received a copy of the GNU General Public
- * Licence along with this program; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
- * USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  *
  * Authors:
  *   Lubos Stanek <lubek at users.sourceforge.net>
index b47b55a..db7535f 100644 (file)
  * ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * See the GNU General Public Licence for more details.
  *
- * You should have received a copy of the GNU General Public
- * Licence along with this program; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
- * USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  *
  * Authors:
  *   Lubos Stanek <lubek at users.sourceforge.net>
index ef9e413..ff70172 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -53,7 +53,6 @@ static const char *config_keys[] =
        "FSType",
        "IgnoreSelected",
        "ReportByDevice",
-       "ReportReserved",
        "ReportInodes",
        "ValuesAbsolute",
        "ValuesPercentage"
@@ -271,11 +270,7 @@ static int df_read (void)
                else
                {
                        if (strcmp (mnt_ptr->dir, "/") == 0)
-                       {
-                               if (strcmp (mnt_ptr->type, "rootfs") == 0)
-                                       continue;
                                sstrncpy (disk_name, "root", sizeof (disk_name));
-                       }
                        else
                        {
                                int i, len;
index cc306dc..d46bb02 100644 (file)
@@ -142,8 +142,12 @@ static int drbd_read (void)
                                fields, STATIC_ARRAY_SIZE (fields));
 
                /* ignore headers (first two iterations) */
-               if (fields_num < 4)
+               if ((strcmp(fields[0], "version:") == 0) ||
+                               (strcmp(fields[0], "srcversion:") == 0) ||
+                               (strcmp(fields[0], "GIT-hash:") == 0))
+               {
                        continue;
+               }
 
                if (isdigit(fields[0][0]))
                {
index beee341..a53d276 100644 (file)
@@ -314,7 +314,9 @@ static void ps_list_register (const char *name, const char *regexp)
                                        "`ProcessMatch' with the same name. "
                                        "All but the first setting will be "
                                        "ignored.");
+#if HAVE_REGEX_H
                        sfree (new->re);
+#endif
                        sfree (new);
                        return;
                }
@@ -359,6 +361,31 @@ static int ps_list_match (const char *name, const char *cmdline, procstat_t *ps)
        return (0);
 } /* int ps_list_match */
 
+static void ps_update_counter (
+        _Bool init,
+        derive_t *group_counter,
+        derive_t *curr_counter, unsigned long *curr_value,
+        derive_t new_counter, unsigned long new_value) {
+    if (init)
+    {
+        *curr_value = new_value;
+        *curr_counter += new_value;
+        *group_counter += new_value;
+        return;
+    }
+
+    if (new_counter < *curr_counter)
+    {
+        *curr_value = new_counter + (ULONG_MAX - *curr_counter);
+    }
+    else
+    {
+        *curr_value = new_counter - *curr_counter;
+    }
+    *curr_counter = new_counter;
+    *group_counter += *curr_value;
+}
+
 /* add process entry to 'instances' of process 'name' (or refresh it) */
 static void ps_list_add (const char *name, const char *cmdline, procstat_entry_t *entry)
 {
@@ -370,6 +397,8 @@ static void ps_list_add (const char *name, const char *cmdline, procstat_entry_t
 
        for (ps = list_head_g; ps != NULL; ps = ps->next)
        {
+        _Bool want_init;
+
                if ((ps_list_match (name, cmdline, ps)) == 0)
                        continue;
 
@@ -426,79 +455,27 @@ static void ps_list_add (const char *name, const char *cmdline, procstat_entry_t
                ps->cswitch_vol   += ((pse->cswitch_vol == -1)?0:pse->cswitch_vol);
                ps->cswitch_invol += ((pse->cswitch_invol == -1)?0:pse->cswitch_invol);
 
-               if ((entry->vmem_minflt_counter == 0)
-                               && (entry->vmem_majflt_counter == 0))
-               {
-                       pse->vmem_minflt_counter += entry->vmem_minflt;
-                       pse->vmem_minflt = entry->vmem_minflt;
-
-                       pse->vmem_majflt_counter += entry->vmem_majflt;
-                       pse->vmem_majflt = entry->vmem_majflt;
-               }
-               else
-               {
-                       if (entry->vmem_minflt_counter < pse->vmem_minflt_counter)
-                       {
-                               pse->vmem_minflt = entry->vmem_minflt_counter
-                                       + (ULONG_MAX - pse->vmem_minflt_counter);
-                       }
-                       else
-                       {
-                               pse->vmem_minflt = entry->vmem_minflt_counter - pse->vmem_minflt_counter;
-                       }
-                       pse->vmem_minflt_counter = entry->vmem_minflt_counter;
-
-                       if (entry->vmem_majflt_counter < pse->vmem_majflt_counter)
-                       {
-                               pse->vmem_majflt = entry->vmem_majflt_counter
-                                       + (ULONG_MAX - pse->vmem_majflt_counter);
-                       }
-                       else
-                       {
-                               pse->vmem_majflt = entry->vmem_majflt_counter - pse->vmem_majflt_counter;
-                       }
-                       pse->vmem_majflt_counter = entry->vmem_majflt_counter;
-               }
-
-               ps->vmem_minflt_counter += pse->vmem_minflt;
-               ps->vmem_majflt_counter += pse->vmem_majflt;
-
-               if ((entry->cpu_user_counter == 0)
-                               && (entry->cpu_system_counter == 0))
-               {
-                       pse->cpu_user_counter += entry->cpu_user;
-                       pse->cpu_user = entry->cpu_user;
-
-                       pse->cpu_system_counter += entry->cpu_system;
-                       pse->cpu_system = entry->cpu_system;
-               }
-               else
-               {
-                       if (entry->cpu_user_counter < pse->cpu_user_counter)
-                       {
-                               pse->cpu_user = entry->cpu_user_counter
-                                       + (ULONG_MAX - pse->cpu_user_counter);
-                       }
-                       else
-                       {
-                               pse->cpu_user = entry->cpu_user_counter - pse->cpu_user_counter;
-                       }
-                       pse->cpu_user_counter = entry->cpu_user_counter;
-
-                       if (entry->cpu_system_counter < pse->cpu_system_counter)
-                       {
-                               pse->cpu_system = entry->cpu_system_counter
-                                       + (ULONG_MAX - pse->cpu_system_counter);
-                       }
-                       else
-                       {
-                               pse->cpu_system = entry->cpu_system_counter - pse->cpu_system_counter;
-                       }
-                       pse->cpu_system_counter = entry->cpu_system_counter;
-               }
-
-               ps->cpu_user_counter   += pse->cpu_user;
-               ps->cpu_system_counter += pse->cpu_system;
+               want_init = (entry->vmem_minflt_counter == 0)
+                               && (entry->vmem_majflt_counter == 0);
+               ps_update_counter (want_init,
+                               &ps->vmem_minflt_counter,
+                               &pse->vmem_minflt_counter, &pse->vmem_minflt,
+                               entry->vmem_minflt_counter, entry->vmem_minflt);
+               ps_update_counter (want_init,
+                               &ps->vmem_majflt_counter,
+                               &pse->vmem_majflt_counter, &pse->vmem_majflt,
+                               entry->vmem_majflt_counter, entry->vmem_majflt);
+
+               want_init = (entry->cpu_user_counter == 0)
+                               && (entry->cpu_system_counter == 0);
+               ps_update_counter (want_init,
+                               &ps->cpu_user_counter,
+                               &pse->cpu_user_counter, &pse->cpu_user,
+                               entry->cpu_user_counter, entry->cpu_user);
+               ps_update_counter (want_init,
+                               &ps->cpu_system_counter,
+                               &pse->cpu_system_counter, &pse->cpu_system,
+                               entry->cpu_system_counter, entry->cpu_system);
        }
 }
 
@@ -1326,8 +1303,8 @@ static int read_fork_rate ()
 #endif /*KERNEL_LINUX */
 
 #if KERNEL_SOLARIS
-static const char *ps_get_cmdline (long pid, /* {{{ */
-               char *buffer, size_t buffer_size)
+static char *ps_get_cmdline (pid_t pid, char *name __attribute__((unused)), /* {{{ */
+    char *buffer, size_t buffer_size)
 {
        char path[PATH_MAX];
        psinfo_t info;
@@ -2440,7 +2417,7 @@ static int ps_read (void)
 
 
                ps_list_add (ps.name,
-                               ps_get_cmdline (pid, cmdline, sizeof (cmdline)),
+                               ps_get_cmdline (pid, ps.name, cmdline, sizeof (cmdline)),
                                &pse);
        } /* while(readdir) */
        closedir (proc);
index 5ab073d..14ce29f 100644 (file)
@@ -1516,7 +1516,7 @@ check_permissions(void)
        }
 
        if (euidaccess("/dev/cpu/0/msr", R_OK)) {
-               WARNING("turbostat plugin: Collectd cannot open"
+               WARNING("turbostat plugin: Collectd cannot open "
                        "/dev/cpu/0/msr. If you don't want to run collectd as "
                        "root, you need to change the ownership (chown) and "
                        "permissions on /dev/cpu/*/msr to allow such access");
@@ -1539,8 +1539,8 @@ turbostat_init(void)
        int ret;
 
        if (stat("/dev/cpu/0/msr", &sb)) {
-               ERROR("turbostat plugin: Initialization failed: /dev/cpu/0/msr"
-                     " does not exist while the CPU supports MSR. You may be "
+               ERROR("turbostat plugin: Initialization failed: /dev/cpu/0/msr "
+                     "does not exist while the CPU supports MSR. You may be "
                      "missing the corresponding kernel module, please try '# "
                      "modprobe msr'");
                return -1;
index f2b7943..36d8d64 100644 (file)
  * ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * See the GNU General Public Licence for more details.
  *
- * You should have received a copy of the GNU General Public
- * Licence along with this program; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
- * USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  *
  * Author:
  *   Niki W. Waibel <niki.waibel@gmx.net>
index bc0077f..7518188 100644 (file)
  * ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * See the GNU General Public Licence for more details.
  *
- * You should have received a copy of the GNU General Public
- * Licence along with this program; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
- * USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  *
  * Author:
  *   Niki W. Waibel <niki.waibel@gmx.net>
index 6824b13..b9da68e 100644 (file)
@@ -327,8 +327,8 @@ lv_init (void)
 {
     if (virInitialize () != 0)
         return -1;
-
-       return 0;
+    else
+        return 0;
 }
 
 static int
index 2336541..b09dcc8 100644 (file)
@@ -455,7 +455,7 @@ static char *sensu_value_to_json(struct sensu_host const *host, /* {{{ */
        }
 
        // incorporate sensu tags from config if any
-       if (strlen(sensu_tags) != 0) {
+       if ((sensu_tags != NULL) && (strlen(sensu_tags) != 0)) {
                res = asprintf(&temp_str, "%s, %s", ret_str, sensu_tags);
                free(ret_str);
                if (res == -1) {
@@ -752,7 +752,7 @@ static char *sensu_notification_to_json(struct sensu_host *host, /* {{{ */
        }
 
        // incorporate sensu tags from config if any
-       if (strlen(sensu_tags) != 0) {
+       if ((sensu_tags != NULL) && (strlen(sensu_tags) != 0)) {
                res = asprintf(&temp_str, "%s, %s", ret_str, sensu_tags);
                free(ret_str);
                if (res == -1) {
index 493a6eb..d7c6a76 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-DEFAULT_VERSION="5.5.0.git"
+DEFAULT_VERSION="5.5.1.git"
 
 if [ -d .git ]; then
        VERSION="`git describe --dirty=+ --abbrev=7 2> /dev/null | grep collectd | sed -e 's/^collectd-//' -e 's/-/./g'`"