bind plugin: Fix building with --enable-standards.
[collectd.git] / src / netapp.c
index f01a7b4..fc65358 100644 (file)
@@ -837,7 +837,8 @@ static int cna_handle_wafl_data (const char *hostname, cfg_wafl_t *cfg_wafl, /*
        if (instances == NULL)
        {
                ERROR ("netapp plugin: cna_handle_wafl_data: "
-                               "na_elem_child (\"instances\") failed.");
+                               "na_elem_child (\"instances\") failed "
+                               "for host %s.", hostname);
                return (-1);
        }
 
@@ -845,7 +846,8 @@ static int cna_handle_wafl_data (const char *hostname, cfg_wafl_t *cfg_wafl, /*
        if (plugin_inst == NULL)
        {
                ERROR ("netapp plugin: cna_handle_wafl_data: "
-                               "na_child_get_string (\"name\") failed.");
+                               "na_child_get_string (\"name\") failed "
+                               "for host %s.", hostname);
                return (-1);
        }
 
@@ -892,7 +894,8 @@ static int cna_handle_wafl_data (const char *hostname, cfg_wafl_t *cfg_wafl, /*
                        perf_data.flags |= HAVE_WAFL_INODE_CACHE_MISS;
                } else {
                        DEBUG("netapp plugin: cna_handle_wafl_data: "
-                                       "Found unexpected child: %s", name);
+                                       "Found unexpected child: %s "
+                                       "for host %s.", name, hostname);
                }
        }
 
@@ -925,14 +928,14 @@ static int cna_setup_wafl (cfg_wafl_t *cw) /* {{{ */
                ERROR ("netapp plugin: na_elem_new failed.");
                return (-1);
        }
-       na_child_add_string(e, "foo", "name_cache_hit");
-       na_child_add_string(e, "foo", "name_cache_miss");
-       na_child_add_string(e, "foo", "find_dir_hit");
-       na_child_add_string(e, "foo", "find_dir_miss");
-       na_child_add_string(e, "foo", "buf_hash_hit");
-       na_child_add_string(e, "foo", "buf_hash_miss");
-       na_child_add_string(e, "foo", "inode_cache_hit");
-       na_child_add_string(e, "foo", "inode_cache_miss");
+       na_child_add_string(e, "counter", "name_cache_hit");
+       na_child_add_string(e, "counter", "name_cache_miss");
+       na_child_add_string(e, "counter", "find_dir_hit");
+       na_child_add_string(e, "counter", "find_dir_miss");
+       na_child_add_string(e, "counter", "buf_hash_hit");
+       na_child_add_string(e, "counter", "buf_hash_miss");
+       na_child_add_string(e, "counter", "inode_cache_hit");
+       na_child_add_string(e, "counter", "inode_cache_miss");
 
        na_child_add(cw->query, e);
 
@@ -964,8 +967,8 @@ static int cna_query_wafl (host_config_t *host) /* {{{ */
        data = na_server_invoke_elem(host->srv, host->cfg_wafl->query);
        if (na_results_status (data) != NA_OK)
        {
-               ERROR ("netapp plugin: cna_query_wafl: na_server_invoke_elem failed: %s",
-                               na_results_reason (data));
+               ERROR ("netapp plugin: cna_query_wafl: na_server_invoke_elem failed for host %s: %s",
+                               host->name, na_results_reason (data));
                na_elem_free (data);
                return (-1);
        }
@@ -998,7 +1001,8 @@ static int cna_handle_disk_data (const char *hostname, /* {{{ */
        if (instances == NULL)
        {
                ERROR ("netapp plugin: cna_handle_disk_data: "
-                               "na_elem_child (\"instances\") failed.");
+                               "na_elem_child (\"instances\") failed "
+                               "for host %s.", hostname);
                return (-1);
        }
 
@@ -1125,8 +1129,8 @@ static int cna_setup_disk (cfg_disk_t *cd) /* {{{ */
                ERROR ("netapp plugin: na_elem_new failed.");
                return (-1);
        }
-       na_child_add_string(e, "foo", "disk_busy");
-       na_child_add_string(e, "foo", "base_for_disk_busy");
+       na_child_add_string(e, "counter", "disk_busy");
+       na_child_add_string(e, "counter", "base_for_disk_busy");
        na_child_add(cd->query, e);
 
        return (0);
@@ -1158,8 +1162,8 @@ static int cna_query_disk (host_config_t *host) /* {{{ */
        data = na_server_invoke_elem(host->srv, host->cfg_disk->query);
        if (na_results_status (data) != NA_OK)
        {
-               ERROR ("netapp plugin: cna_query_disk: na_server_invoke_elem failed: %s",
-                               na_results_reason (data));
+               ERROR ("netapp plugin: cna_query_disk: na_server_invoke_elem failed for host %s: %s",
+                               host->name, na_results_reason (data));
                na_elem_free (data);
                return (-1);
        }
@@ -1188,7 +1192,8 @@ static int cna_handle_volume_perf_data (const char *hostname, /* {{{ */
        if (elem_instances == NULL)
        {
                ERROR ("netapp plugin: handle_volume_perf_data: "
-                               "na_elem_child (\"instances\") failed.");
+                               "na_elem_child (\"instances\") failed "
+                               "for host %s.", hostname);
                return (-1);
        }
 
@@ -1291,13 +1296,12 @@ static int cna_setup_volume_perf (cfg_volume_perf_t *cd) /* {{{ */
                ERROR ("netapp plugin: na_elem_new failed.");
                return (-1);
        }
-       /* "foo" means: This string has to be here but the content doesn't matter. */
-       na_child_add_string(e, "foo", "read_ops");
-       na_child_add_string(e, "foo", "write_ops");
-       na_child_add_string(e, "foo", "read_data");
-       na_child_add_string(e, "foo", "write_data");
-       na_child_add_string(e, "foo", "read_latency");
-       na_child_add_string(e, "foo", "write_latency");
+       na_child_add_string(e, "counter", "read_ops");
+       na_child_add_string(e, "counter", "write_ops");
+       na_child_add_string(e, "counter", "read_data");
+       na_child_add_string(e, "counter", "write_data");
+       na_child_add_string(e, "counter", "read_latency");
+       na_child_add_string(e, "counter", "write_latency");
        na_child_add(cd->query, e);
 
        return (0);
@@ -1329,8 +1333,8 @@ static int cna_query_volume_perf (host_config_t *host) /* {{{ */
        data = na_server_invoke_elem (host->srv, host->cfg_volume_perf->query);
        if (na_results_status (data) != NA_OK)
        {
-               ERROR ("netapp plugin: cna_query_volume_perf: na_server_invoke_elem failed: %s",
-                               na_results_reason (data));
+               ERROR ("netapp plugin: cna_query_volume_perf: na_server_invoke_elem failed for host %s: %s",
+                               host->name, na_results_reason (data));
                na_elem_free (data);
                return (-1);
        }
@@ -1385,8 +1389,8 @@ static int cna_submit_volume_usage_data (const char *hostname, /* {{{ */
                        else
                        {
                                ERROR ("netapp plugin: (norm_used = %"PRIu64") < (snap_norm_used = "
-                                               "%"PRIu64"). Invalidating both.",
-                                               norm_used, snap_norm_used);
+                                               "%"PRIu64") for host %s. Invalidating both.",
+                                               norm_used, snap_norm_used, hostname);
                                v->flags &= ~(HAVE_VOLUME_USAGE_NORM_USED | HAVE_VOLUME_USAGE_SNAP_USED);
                        }
                }
@@ -1471,8 +1475,8 @@ static void cna_handle_volume_snap_usage(const host_config_t *host, /* {{{ */
                                cna_change_volume_status (host->name, v);
                } else {
                        ERROR ("netapp plugin: cna_handle_volume_snap_usage: na_server_invoke_elem for "
-                                       "volume \"%s\" failed with error %d: %s", v->name,
-                                       na_results_errno(data), na_results_reason(data));
+                                       "volume \"%s\" on host %s failed with error %d: %s", v->name,
+                                       host->name, na_results_errno(data), na_results_reason(data));
                }
                na_elem_free(data);
                return;
@@ -1485,7 +1489,8 @@ static void cna_handle_volume_snap_usage(const host_config_t *host, /* {{{ */
        if (elem_snapshots == NULL)
        {
                ERROR ("netapp plugin: cna_handle_volume_snap_usage: "
-                               "na_elem_child (\"snapshots\") failed.");
+                               "na_elem_child (\"snapshots\") failed "
+                               "for host %s.", host->name);
                na_elem_free(data);
                return;
        }
@@ -1519,7 +1524,8 @@ static int cna_handle_volume_usage_data (const host_config_t *host, /* {{{ */
        if (elem_volumes == NULL)
        {
                ERROR ("netapp plugin: cna_handle_volume_usage_data: "
-                               "na_elem_child (\"volumes\") failed.");
+                               "na_elem_child (\"volumes\") failed "
+                               "for host %s.", host->name);
                return (-1);
        }
 
@@ -1691,8 +1697,8 @@ static int cna_query_volume_usage (host_config_t *host) /* {{{ */
        data = na_server_invoke_elem(host->srv, host->cfg_volume_usage->query);
        if (na_results_status (data) != NA_OK)
        {
-               ERROR ("netapp plugin: cna_query_volume_usage: na_server_invoke_elem failed: %s",
-                               na_results_reason (data));
+               ERROR ("netapp plugin: cna_query_volume_usage: na_server_invoke_elem failed for host %s: %s",
+                               host->name, na_results_reason (data));
                na_elem_free (data);
                return (-1);
        }
@@ -1728,7 +1734,8 @@ static int cna_handle_system_data (const char *hostname, /* {{{ */
        if (instances == NULL)
        {
                ERROR ("netapp plugin: cna_handle_system_data: "
-                               "na_elem_child (\"instances\") failed.");
+                               "na_elem_child (\"instances\") failed "
+                               "for host %s.", hostname);
                return (-1);
        }
 
@@ -1736,7 +1743,8 @@ static int cna_handle_system_data (const char *hostname, /* {{{ */
        if (instance == NULL)
        {
                ERROR ("netapp plugin: cna_handle_system_data: "
-                               "na_child_get_string (\"name\") failed.");
+                               "na_child_get_string (\"name\") failed "
+                               "for host %s.", hostname);
                return (-1);
        }
 
@@ -1848,8 +1856,8 @@ static int cna_query_system (host_config_t *host) /* {{{ */
        data = na_server_invoke_elem(host->srv, host->cfg_system->query);
        if (na_results_status (data) != NA_OK)
        {
-               ERROR ("netapp plugin: cna_query_system: na_server_invoke_elem failed: %s",
-                               na_results_reason (data));
+               ERROR ("netapp plugin: cna_query_system: na_server_invoke_elem failed for host %s: %s",
+                               host->name, na_results_reason (data));
                na_elem_free (data);
                return (-1);
        }