summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e214a01)
raw | patch | inline | side by side (parent: e214a01)
author | Sven Trenkel <collectd@semidefinite.de> | |
Mon, 28 Sep 2009 10:40:44 +0000 (12:40 +0200) | ||
committer | Sven Trenkel <collectd@semidefinite.de> | |
Mon, 28 Sep 2009 10:40:44 +0000 (12:40 +0200) |
src/netapp.c | patch | blob | history |
diff --git a/src/netapp.c b/src/netapp.c
index 47f3b01acb2d96c59f069d5242133701d16ce8af..446f8bf6f1c2ad37cfe2b6ac0635e60834232777 100644 (file)
--- a/src/netapp.c
+++ b/src/netapp.c
@@ -827,17 +827,22 @@ static void collect_volume_data(host_config_t *host, na_elem_t *out, void *data)
/* 2^4 exa-bytes? This will take a while ;) */
size_free = na_child_get_uint64(inst, "size-available", UINT64_MAX);
- if (size_free != UINT64_MAX)
- submit_double (host->name, volume->name, "df_complex", "used",
- (double) size_used, /* time = */ 0);
-
- size_used = na_child_get_uint64(inst, "size-used", UINT64_MAX);
if (size_free != UINT64_MAX)
submit_double (host->name, volume->name, "df_complex", "free",
(double) size_free, /* time = */ 0);
+ size_used = na_child_get_uint64(inst, "size-used", UINT64_MAX);
+ if (size_used != UINT64_MAX) {
+ if ((volume->cfg_volume_usage.flags & HAVE_VOLUME_USAGE_SNAP)
+ && (size_used >= volume->cfg_volume_usage.snap_used))
+ size_used -= volume->cfg_volume_usage.snap_used;
+ submit_double (host->name, volume->name, "df_complex", "used",
+ (double) size_used, /* time = */ 0);
+ }
+
snap_reserved = na_child_get_uint64(inst, "snapshot-blocks-reserved", UINT64_MAX);
- if (snap_reserved != UINT64_MAX)
+ if (!(volume->cfg_volume_usage.flags & HAVE_VOLUME_USAGE_SNAP) && (snap_reserved != UINT64_MAX))
+ /* If we have snap usage data this value has already been submitted. */
/* 1 block == 1024 bytes as per API docs */
submit_double (host->name, volume->name, "df_complex", "snap_reserved",
(double) (1024 * snap_reserved), /* time = */ 0);
const host_config_t *default_host, const cfg_service_t *def_def_service)
{
oconfig_item_t *item;
- host_config_t *host, *hc;
+ host_config_t *host;
cfg_service_t default_service = *def_def_service;
int status;
int i;