X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbind.c;h=c0b18323651c719d56edbfc671194731a8901d0e;hb=e0e406ccbebea436f736fa13b9345eb7b110d5b6;hp=b464f8de64841f1b389a87e36eb85958db96018f;hpb=6d86a97190a193863aadc252f20f6b9dba61c263;p=collectd.git diff --git a/src/bind.c b/src/bind.c index b464f8de..c0b18323 100644 --- a/src/bind.c +++ b/src/bind.c @@ -497,7 +497,7 @@ static int bind_parse_generic_name_value (const char *xpath_expression, /* {{{ * list_callback_t list_callback, void *user_data, xmlDoc *doc, xmlXPathContext *xpathCtx, - time_t current_time) + time_t current_time, int ds_type) { xmlXPathObject *xpathObj = NULL; int num_entries; @@ -545,7 +545,10 @@ static int bind_parse_generic_name_value (const char *xpath_expression, /* {{{ * value_t value; int status; - status = bind_xml_read_counter (doc, counter, &value.counter); + if (ds_type == DS_TYPE_GAUGE) + status = bind_xml_read_gauge (doc, counter, &value.gauge); + else + status = bind_xml_read_counter (doc, counter, &value.counter); if (status != 0) continue; @@ -809,7 +812,7 @@ static int bind_xml_stats_handle_view (int version, xmlDoc *doc, /* {{{ */ list_info_ptr_t list_info = { plugin_instance, - /* type = */ "dns_qtype" + /* type = */ "dns_qtype_gauge" }; ssnprintf (plugin_instance, sizeof (plugin_instance), "%s-qtypes", @@ -818,7 +821,7 @@ static int bind_xml_stats_handle_view (int version, xmlDoc *doc, /* {{{ */ bind_parse_generic_name_value (/* xpath = */ "rdtype", /* callback = */ bind_xml_list_callback, /* user_data = */ &list_info, - doc, path_ctx, current_time); + doc, path_ctx, current_time, DS_TYPE_COUNTER); } /* }}} */ if (view->resolver_stats != 0) /* {{{ */ @@ -837,7 +840,7 @@ static int bind_xml_stats_handle_view (int version, xmlDoc *doc, /* {{{ */ bind_parse_generic_name_value ("resstat", /* callback = */ bind_xml_table_callback, /* user_data = */ &table_ptr, - doc, path_ctx, current_time); + doc, path_ctx, current_time, DS_TYPE_COUNTER); } /* }}} */ if (view->cacherrsets != 0) /* {{{ */ @@ -846,7 +849,7 @@ static int bind_xml_stats_handle_view (int version, xmlDoc *doc, /* {{{ */ list_info_ptr_t list_info = { plugin_instance, - /* type = */ "dns_qtype" + /* type = */ "dns_qtype_gauge" }; ssnprintf (plugin_instance, sizeof (plugin_instance), "%s-cache_rr_sets", @@ -855,7 +858,7 @@ static int bind_xml_stats_handle_view (int version, xmlDoc *doc, /* {{{ */ bind_parse_generic_name_value (/* xpath = */ "cache/rrset", /* callback = */ bind_xml_list_callback, /* user_data = */ &list_info, - doc, path_ctx, current_time); + doc, path_ctx, current_time, DS_TYPE_GAUGE); } /* }}} */ if (view->zones_num > 0) @@ -944,7 +947,7 @@ static int bind_xml_stats (int version, xmlDoc *doc, /* {{{ */ bind_parse_generic_name_value (/* xpath = */ "server/requests/opcode", /* callback = */ bind_xml_list_callback, /* user_data = */ &list_info, - doc, xpathCtx, current_time); + doc, xpathCtx, current_time, DS_TYPE_COUNTER); } /* XPath: server/queries-in/rdtype @@ -969,7 +972,7 @@ static int bind_xml_stats (int version, xmlDoc *doc, /* {{{ */ bind_parse_generic_name_value (/* xpath = */ "server/queries-in/rdtype", /* callback = */ bind_xml_list_callback, /* user_data = */ &list_info, - doc, xpathCtx, current_time); + doc, xpathCtx, current_time, DS_TYPE_COUNTER); } /* XPath: server/nsstats, server/nsstat @@ -1019,7 +1022,7 @@ static int bind_xml_stats (int version, xmlDoc *doc, /* {{{ */ bind_parse_generic_name_value ("server/nsstat", /* callback = */ bind_xml_table_callback, /* user_data = */ &table_ptr, - doc, xpathCtx, current_time); + doc, xpathCtx, current_time, DS_TYPE_COUNTER); } } @@ -1065,7 +1068,7 @@ static int bind_xml_stats (int version, xmlDoc *doc, /* {{{ */ bind_parse_generic_name_value ("server/zonestat", /* callback = */ bind_xml_table_callback, /* user_data = */ &table_ptr, - doc, xpathCtx, current_time); + doc, xpathCtx, current_time, DS_TYPE_COUNTER); } } @@ -1112,7 +1115,7 @@ static int bind_xml_stats (int version, xmlDoc *doc, /* {{{ */ bind_parse_generic_name_value ("server/resstat", /* callback = */ bind_xml_table_callback, /* user_data = */ &table_ptr, - doc, xpathCtx, current_time); + doc, xpathCtx, current_time, DS_TYPE_COUNTER); } }