summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5eb9fab)
raw | patch | inline | side by side (parent: 5eb9fab)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 8 Aug 2015 07:57:48 +0000 (09:57 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 8 Aug 2015 07:57:48 +0000 (09:57 +0200) |
src/core/plugin.c | patch | blob | history |
diff --git a/src/core/plugin.c b/src/core/plugin.c
index 26b1408001717d0a7fb2aa9d953a3c3a0125a8f9..da8a485b960a4786b914102e9f9fbc741378170a 100644 (file)
--- a/src/core/plugin.c
+++ b/src/core/plugin.c
if (! name)
return -1;
+ if (! sdb_llist_len(writer_list)) {
+ sdb_log(SDB_LOG_ERR, "core: Cannot store host: "
+ "no writers registered");
+ return -1;
+ }
+
iter = sdb_llist_get_iter(writer_list);
while (sdb_llist_iter_has_next(iter)) {
writer_t *writer = WRITER(sdb_llist_iter_get_next(iter));
if ((! hostname) || (! name))
return -1;
+ if (! sdb_llist_len(writer_list)) {
+ sdb_log(SDB_LOG_ERR, "core: Cannot store service: "
+ "no writers registered");
+ return -1;
+ }
+
iter = sdb_llist_get_iter(writer_list);
while (sdb_llist_iter_has_next(iter)) {
writer_t *writer = WRITER(sdb_llist_iter_get_next(iter));
if ((! hostname) || (! name))
return -1;
+ if (! sdb_llist_len(writer_list)) {
+ sdb_log(SDB_LOG_ERR, "core: Cannot store metric: "
+ "no writers registered");
+ return -1;
+ }
+
if (store && ((! store->type) || (! store->id)))
store = NULL;
if ((! hostname) || (! key) || (! value))
return -1;
+ if (! sdb_llist_len(writer_list)) {
+ sdb_log(SDB_LOG_ERR, "core: Cannot store attribute: "
+ "no writers registered");
+ return -1;
+ }
+
iter = sdb_llist_get_iter(writer_list);
while (sdb_llist_iter_has_next(iter)) {
writer_t *writer = WRITER(sdb_llist_iter_get_next(iter));
@@ -1563,6 +1587,12 @@ sdb_plugin_store_service_attribute(const char *hostname, const char *service,
if ((! hostname) || (! service) || (! key) || (! value))
return -1;
+ if (! sdb_llist_len(writer_list)) {
+ sdb_log(SDB_LOG_ERR, "core: Cannot store service attribute: "
+ "no writers registered");
+ return -1;
+ }
+
iter = sdb_llist_get_iter(writer_list);
while (sdb_llist_iter_has_next(iter)) {
writer_t *writer = WRITER(sdb_llist_iter_get_next(iter));
if ((! hostname) || (! metric) || (! key) || (! value))
return -1;
+ if (! sdb_llist_len(writer_list)) {
+ sdb_log(SDB_LOG_ERR, "core: Cannot store metric attribute: "
+ "no writers registered");
+ return -1;
+ }
+
iter = sdb_llist_get_iter(writer_list);
while (sdb_llist_iter_has_next(iter)) {
writer_t *writer = WRITER(sdb_llist_iter_get_next(iter));