+
+ return (0);
+} /* }}} int cna_handle_disk_data */
+
+static int cna_setup_disk (cfg_disk_t *cd) /* {{{ */
+{
+ na_elem_t *e;
+
+ if (cd == NULL)
+ return (EINVAL);
+
+ if (cd->query != NULL)
+ return (0);
+
+ cd->query = na_elem_new ("perf-object-get-instances");
+ if (cd->query == NULL)
+ {
+ ERROR ("netapp plugin: na_elem_new failed.");
+ return (-1);
+ }
+ na_child_add_string (cd->query, "objectname", "disk");
+
+ e = na_elem_new("counters");
+ if (e == NULL)
+ {
+ na_elem_free (cd->query);
+ cd->query = NULL;
+ 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(cd->query, e);
+
+ return (0);
+} /* }}} int cna_setup_disk */
+
+static int cna_query_disk (host_config_t *host) /* {{{ */
+{
+ na_elem_t *data;
+ int status;
+ time_t now;
+
+ if (host == NULL)
+ return (EINVAL);
+
+ if (host->cfg_disk == NULL)
+ return (0);
+
+ now = time (NULL);
+ if ((host->cfg_disk->interval.interval + host->cfg_disk->interval.last_read) > now)
+ return (0);
+
+ status = cna_setup_disk (host->cfg_disk);
+ if (status != 0)
+ return (status);
+ assert (host->cfg_disk->query != NULL);
+
+ 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));
+ na_elem_free (data);
+ return (-1);
+ }
+
+ status = cna_handle_disk_data (host->name, host->cfg_disk, data);
+
+ if (status == 0)
+ host->cfg_disk->interval.last_read = now;
+
+ na_elem_free (data);
+ return (status);
+} /* }}} int cna_query_disk */