This came up during testing with the ntp plugin. The ds_name was being
sent with an ip in the string. This will prevent the result from nesting
in the carbon store.
-static int normalize_hostname (char *dst, const char *src)
+static int mangle_dots (char *dst, const char *src)
const char *prefix, const char *ds_name)
{
int status;
const char *prefix, const char *ds_name)
{
int status;
+ char *n_hostname = 0;
+ char *n_ds_name = 0;
assert (plugin != NULL);
assert (type != NULL);
assert (plugin != NULL);
assert (type != NULL);
- if (normalize_hostname(n_hostname, hostname) == -1)
+ if (mangle_dots(n_hostname, hostname) == -1)
{
ERROR ("Unable to normalize hostname");
return (-1);
}
{
ERROR ("Unable to normalize hostname");
return (-1);
}
+ if (ds_name && ds_name[0] != '\0') {
+ if (mangle_dots(n_ds_name, ds_name) == -1)
+ {
+ ERROR ("Unable to normalize datasource name");
+ return (-1);
+ }
+ }
+
if ((plugin_instance == NULL) || (plugin_instance[0] == '\0'))
{
if ((type_instance == NULL) || (type_instance[0] == '\0'))
if ((plugin_instance == NULL) || (plugin_instance[0] == '\0'))
{
if ((type_instance == NULL) || (type_instance[0] == '\0'))