diff --git a/src/frontend/query.c b/src/frontend/query.c
index 63ec226c6dc17cea869c3187a66908f28b26117f..aef0ddcc6d7112300f6d1aca90fbd42062b43650 100644 (file)
--- a/src/frontend/query.c
+++ b/src/frontend/query.c
filter = CONN_LOOKUP(node)->filter->matcher;
return sdb_fe_exec_lookup(conn,
CONN_LOOKUP(node)->type, m, filter);
+ case SDB_CONNECTION_STORE_HOST:
+ {
+ conn_store_host_t *n = CONN_STORE_HOST(node);
+ sdb_proto_host_t host = { n->last_update, n->name };
+ return sdb_fe_store_host(conn, &host);
+ }
+ case SDB_CONNECTION_STORE_SERVICE:
+ {
+ conn_store_svc_t *n = CONN_STORE_SVC(node);
+ sdb_proto_service_t svc = { n->last_update, n->hostname, n->name };
+ return sdb_fe_store_service(conn, &svc);
+ }
+ case SDB_CONNECTION_STORE_METRIC:
+ {
+ conn_store_metric_t *n = CONN_STORE_METRIC(node);
+ sdb_proto_metric_t metric = {
+ n->last_update, n->hostname, n->name,
+ n->store_type, n->store_id
+ };
+ return sdb_fe_store_metric(conn, &metric);
+ }
+ case SDB_CONNECTION_STORE_ATTRIBUTE:
+ {
+ conn_store_attr_t *n = CONN_STORE_ATTR(node);
+ sdb_proto_attribute_t attr = {
+ n->last_update, n->parent_type, n->hostname, n->parent,
+ n->key, n->value
+ };
+ return sdb_fe_store_attribute(conn, &attr);
+ }
case SDB_CONNECTION_TIMESERIES:
return sdb_fe_exec_timeseries(conn,
CONN_TS(node)->hostname, CONN_TS(node)->metric,
SDB_STORE_TYPE_TO_NAME(type), hostname, name);
return -1;
}
+ if (type == SDB_HOST)
+ name = hostname;
host = sdb_store_get_host(hostname);
if ((! host) || (filter
sdb_strbuf_sprintf(conn->errbuf, "Failed to fetch %s %s.%s: "
"%s not found", SDB_STORE_TYPE_TO_NAME(type),
hostname, name, name);
+ if (obj)
+ sdb_object_deref(SDB_OBJ(obj));
+ sdb_object_deref(SDB_OBJ(host));
return -1;
}
sdb_object_deref(SDB_OBJ(host));
}
+ host = NULL;
buf = sdb_strbuf_create(1024);
if (! buf) {