summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3dfc071)
raw | patch | inline | side by side (parent: 3dfc071)
author | Florian Forster <ff@octo.it> | |
Tue, 15 Jun 2010 13:24:14 +0000 (15:24 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 15 Jun 2010 13:24:14 +0000 (15:24 +0200) |
collection.conf | patch | blob | history | |
graph.c | patch | blob | history | |
graph.h | patch | blob | history | |
graph_instance.c | patch | blob | history |
diff --git a/collection.conf b/collection.conf
index 58d8c4e122ce43aafaedb7efdd738bd4e10a2676..cabea9c6fbc4ac7daaf1d4384040165ae9545768 100644 (file)
--- a/collection.conf
+++ b/collection.conf
TypeInstance "/all/"
Title "Diskspace"
+ VerticalLabel "Bytes"
<DEF>
TypeInstance "used"
index 79964f3b5b25ffb7d866fc53ea269699a6432ed5..154af77915f198f3525d788317fabdde6f6462bb 100644 (file)
--- a/graph.c
+++ b/graph.c
return (0);
} /* }}} int graph_clear_instances */
+int graph_get_rrdargs (graph_config_t *cfg, graph_instance_t *inst, /* {{{ */
+ str_array_t *args)
+{
+ if ((cfg == NULL) || (inst == NULL) || (args == NULL))
+ return (EINVAL);
+
+ if (cfg->title != NULL)
+ {
+ array_append (args, "-t");
+ array_append (args, cfg->title);
+ }
+
+ if (cfg->vertical_label != NULL)
+ {
+ array_append (args, "-v");
+ array_append (args, cfg->vertical_label);
+ }
+
+ return (0);
+} /* }}} int graph_get_rrdargs */
+
/* vim: set sw=2 sts=2 et fdm=marker : */
index 25da1e0184cf52060b5018655ca50e4ca87c00d0..6e9ae07fb0e2cb03e459173bd3d6030c3d4c15ba 100644 (file)
--- a/graph.h
+++ b/graph.h
#include "graph_ident.h"
#include "graph_instance.h"
#include "oconfig.h"
+#include "utils_array.h"
/*
* Functions
int graph_clear_instances (graph_config_t *cfg);
+int graph_get_rrdargs (graph_config_t *cfg, graph_instance_t *inst,
+ str_array_t *args);
+
#endif /* GRAPH_H */
/* vim: set sw=2 sts=2 et fdm=marker : */
diff --git a/graph_instance.c b/graph_instance.c
index d9821d004ce0991f2a40f2c0ae1b4d7ef82501f4..103be23860ba2b913633a9c11a4018989e670b26 100644 (file)
--- a/graph_instance.c
+++ b/graph_instance.c
if ((cfg == NULL) || (inst == NULL) || (args == NULL))
return (EINVAL);
-/* FIXME: Re-enable title and vertical label stuff. */
-#if 0
- if (cfg->title != NULL)
- {
- array_append (args, "-t");
- array_append (args, cfg->title);
- }
-
- if (cfg->vertical_label != NULL)
- {
- array_append (args, "-v");
- array_append (args, cfg->vertical_label);
- }
-#endif
+ status = graph_get_rrdargs (cfg, inst, args);
+ if (status != 0)
+ return (status);
defs = graph_get_defs (cfg);
if (defs == NULL)