Code

Merge remote-tracking branch 'github/pr/706'
authorFlorian Forster <octo@collectd.org>
Fri, 22 Aug 2014 05:23:28 +0000 (07:23 +0200)
committerFlorian Forster <octo@collectd.org>
Fri, 22 Aug 2014 05:23:28 +0000 (07:23 +0200)
Conflicts:
src/write_riemann.c

1  2 
src/collectd.conf.in
src/collectd.conf.pod
src/write_riemann.c

Simple merge
Simple merge
index b59c3e35a2fd0082e75d0c8776437d9965b8158f,61c1391408543e2a0a0ce8049ab2367a2c9edc0e..c3740e1ddd9f5c38ffff00adb1acebc0900a6d68
@@@ -569,11 -570,19 +570,22 @@@ static Event *riemann_value_to_protobuf
                        /* host = */ "", vl->plugin, vl->plugin_instance,
                        vl->type, vl->type_instance);
        if (host->always_append_ds || (ds->ds_num > 1))
-               ssnprintf (service_buffer, sizeof (service_buffer),
-                               "%s/%s", &name_buffer[1], ds->ds[index].name);
 -              if (host->event_service_prefix == NULL || host->event_service_prefix[0] == '\0')
 -                      ssnprintf (service_buffer, sizeof (service_buffer),
 -                                      "%s/%s", &name_buffer[1], ds->ds[index].name);
++      {
++              if (host->event_service_prefix == NULL)
++                      ssnprintf (service_buffer, sizeof (service_buffer), "%s/%s",
++                                      &name_buffer[1], ds->ds[index].name);
+               else
 -                      ssnprintf (service_buffer, sizeof (service_buffer),
 -                                      "%s%s/%s", host->event_service_prefix, &name_buffer[1], ds->ds[index].name);
++                      ssnprintf (service_buffer, sizeof (service_buffer), "%s%s/%s",
++                                      host->event_service_prefix, &name_buffer[1], ds->ds[index].name);
++      }
        else
-               sstrncpy (service_buffer, &name_buffer[1],
-                               sizeof (service_buffer));
 -              if (host->event_service_prefix == NULL || host->event_service_prefix[0] == '\0')
 -                      sstrncpy (service_buffer, &name_buffer[1],
 -                                      sizeof (service_buffer));
++      {
++              if (host->event_service_prefix == NULL)
++                      sstrncpy (service_buffer, &name_buffer[1], sizeof (service_buffer));
+               else
 -                      ssnprintf (service_buffer, sizeof (service_buffer),
 -                                      "%s%s", host->event_service_prefix, &name_buffer[1]);
++                      ssnprintf (service_buffer, sizeof (service_buffer), "%s%s",
++                                      host->event_service_prefix, &name_buffer[1]);
++      }
  
        event->service = strdup (service_buffer);
  
@@@ -751,14 -760,18 +763,18 @@@ static int riemann_config_node(oconfig_
                        status = cf_util_get_string (child, &host->node);
                        if (status != 0)
                                break;
 -        } else if (strcasecmp ("Notifications", child->key) == 0) {
 -            status = cf_util_get_boolean(child, &host->notifications);
 -            if (status != 0)
 -                break;
 -        } else if (strcasecmp ("EventServicePrefix", child->key) == 0) {
 -            status = cf_util_get_string (child, &host->event_service_prefix);
 -            if (status != 0)
 -                break;
 -        } else if (strcasecmp ("CheckThresholds", child->key) == 0) {
 -            status = cf_util_get_boolean(child, &host->check_thresholds);
 -            if (status != 0)
 -                break;
 +              } else if (strcasecmp ("Notifications", child->key) == 0) {
 +                      status = cf_util_get_boolean(child, &host->notifications);
 +                      if (status != 0)
 +                              break;
++              } else if (strcasecmp ("EventServicePrefix", child->key) == 0) {
++                      status = cf_util_get_string (child, &host->event_service_prefix);
++                      if (status != 0)
++                              break;
 +              } else if (strcasecmp ("CheckThresholds", child->key) == 0) {
 +                      status = cf_util_get_boolean(child, &host->check_thresholds);
 +                      if (status != 0)
 +                              break;
                } else if (strcasecmp ("Port", child->key) == 0) {
                        status = cf_util_get_service (child, &host->service);
                        if (status != 0) {