- char errbuf[1024]; \
- ERROR("powerdns plugin: %s failed: %s", func, \
- sstrerror(errno, errbuf, sizeof(errbuf))); \
+ ERROR("powerdns plugin: %s failed: %s", func, STRERRNO); \
ERROR("powerdns plugin: Socket `%s` %s failed: %s", sockpath, func, \
ERROR("powerdns plugin: Socket `%s` %s failed: %s", sockpath, func, \
answers-slow counts the number of queries answered after 1 second
answers0-1 counts the number of queries answered within 1 millisecond
answers1-10 counts the number of queries answered within 10
answers-slow counts the number of queries answered after 1 second
answers0-1 counts the number of queries answered within 1 millisecond
answers1-10 counts the number of queries answered within 10
answers100-1000 counts the number of queries answered within 1 second
cache-bytes size of the cache in bytes (since 3.3.1)
cache-entries shows the number of entries in the cache
cache-hits counts the number of cache hits since starting, this does
answers100-1000 counts the number of queries answered within 1 second
cache-bytes size of the cache in bytes (since 3.3.1)
cache-entries shows the number of entries in the cache
cache-hits counts the number of cache hits since starting, this does
cache-misses counts the number of cache misses since starting
case-mismatches counts the number of mismatches in character case since
cache-misses counts the number of cache misses since starting
case-mismatches counts the number of mismatches in character case since
chain-resends number of queries chained to existing outstanding query
client-parse-errors counts number of client packets that could not be parsed
concurrent-queries shows the number of MThreads currently running
dlg-only-drops number of records dropped because of delegation only
chain-resends number of queries chained to existing outstanding query
client-parse-errors counts number of client packets that could not be parsed
concurrent-queries shows the number of MThreads currently running
dlg-only-drops number of records dropped because of delegation only
edns-ping-matches number of servers that sent a valid EDNS PING respons
edns-ping-mismatches number of servers that sent an invalid EDNS PING response
failed-host-entries number of servers that failed to resolve
ipv6-outqueries number of outgoing queries over IPv6
ipv6-questions counts all End-user initiated queries with the RD bit set,
edns-ping-matches number of servers that sent a valid EDNS PING respons
edns-ping-mismatches number of servers that sent an invalid EDNS PING response
failed-host-entries number of servers that failed to resolve
ipv6-outqueries number of outgoing queries over IPv6
ipv6-questions counts all End-user initiated queries with the RD bit set,
max-mthread-stack maximum amount of thread stack ever used
negcache-entries shows the number of entries in the Negative answer cache
no-packet-error number of errorneous received packets
noedns-outqueries number of queries sent out without EDNS
noerror-answers counts the number of times it answered NOERROR since
max-mthread-stack maximum amount of thread stack ever used
negcache-entries shows the number of entries in the Negative answer cache
no-packet-error number of errorneous received packets
noedns-outqueries number of queries sent out without EDNS
noerror-answers counts the number of times it answered NOERROR since
noping-outqueries number of queries sent out without ENDS PING
nsset-invalidations number of times an nsset was dropped because it no longer
noping-outqueries number of queries sent out without ENDS PING
nsset-invalidations number of times an nsset was dropped because it no longer
nsspeeds-entries shows the number of entries in the NS speeds map
nxdomain-answers counts the number of times it answered NXDOMAIN since
nsspeeds-entries shows the number of entries in the NS speeds map
nxdomain-answers counts the number of times it answered NXDOMAIN since
packetcache-bytes size of the packet cache in bytes (since 3.3.1)
packetcache-entries size of packet cache (since 3.2)
packetcache-hits packet cache hits (since 3.2)
packetcache-bytes size of the packet cache in bytes (since 3.3.1)
packetcache-entries size of packet cache (since 3.2)
packetcache-hits packet cache hits (since 3.2)
qa-latency shows the current latency average
questions counts all end-user initiated queries with the RD bit set
resource-limits counts number of queries that could not be performed
qa-latency shows the current latency average
questions counts all end-user initiated queries with the RD bit set
resource-limits counts number of queries that could not be performed
security-status security status based on security polling
server-parse-errors counts number of server replied packets that could not be
security-status security status based on security polling
server-parse-errors counts number of server replied packets that could not be
sys-msec number of CPU milliseconds spent in 'system' mode
tcp-client-overflow number of times an IP address was denied TCP access
sys-msec number of CPU milliseconds spent in 'system' mode
tcp-client-overflow number of times an IP address was denied TCP access
tcp-clients counts the number of currently active TCP/IP clients
tcp-outqueries counts the number of outgoing TCP queries since starting
tcp-questions counts all incoming TCP queries (since starting)
throttle-entries shows the number of entries in the throttle map
throttled-out counts the number of throttled outgoing UDP queries since
tcp-clients counts the number of currently active TCP/IP clients
tcp-outqueries counts the number of outgoing TCP queries since starting
tcp-questions counts all incoming TCP queries (since starting)
throttle-entries shows the number of entries in the throttle map
throttled-out counts the number of throttled outgoing UDP queries since
throttled-outqueries idem to throttled-out
unauthorized-tcp number of TCP questions denied because of allow-from
throttled-outqueries idem to throttled-out
unauthorized-tcp number of TCP questions denied because of allow-from
uptime number of seconds process has been running (since 3.1.5)
user-msec number of CPU milliseconds spent in 'user' mode
}}} */
uptime number of seconds process has been running (since 3.1.5)
user-msec number of CPU milliseconds spent in 'user' mode
}}} */
{"ipv6-questions", "dns_question", "incoming-ipv6"},
{"malloc-bytes", "gauge", "malloc_bytes"},
{"max-mthread-stack", "gauge", "max_mthread_stack"},
{"ipv6-questions", "dns_question", "incoming-ipv6"},
{"malloc-bytes", "gauge", "malloc_bytes"},
{"max-mthread-stack", "gauge", "max_mthread_stack"},
- {"no-packet-error", "gauge", "no_packet_error"},
+ {"no-packet-error", "errors", "no_packet_error"},
{"noedns-outqueries", "dns_question", "outgoing-noedns"},
{"noping-outqueries", "dns_question", "outgoing-noping"},
{"over-capacity-drops", "dns_question", "incoming-over_capacity"},
{"noedns-outqueries", "dns_question", "outgoing-noedns"},
{"noping-outqueries", "dns_question", "outgoing-noping"},
{"over-capacity-drops", "dns_question", "incoming-over_capacity"},
{"unauthorized-tcp", "counter", "denied-unauthorized_tcp"},
{"unauthorized-udp", "counter", "denied-unauthorized_udp"},
{"unexpected-packets", "dns_answer", "unexpected"},
{"unauthorized-tcp", "counter", "denied-unauthorized_tcp"},
{"unauthorized-udp", "counter", "denied-unauthorized_udp"},
{"unexpected-packets", "dns_answer", "unexpected"},
{"uptime", "uptime", NULL}}; /* }}} */
static int lookup_table_length = STATIC_ARRAY_SIZE(lookup_table);
{"uptime", "uptime", NULL}}; /* }}} */
static int lookup_table_length = STATIC_ARRAY_SIZE(lookup_table);
"but I can only handle one.",
type, ds->ds_num);
return;
}
if (0 != parse_value(value_str, &value, ds->ds[0].type)) {
"but I can only handle one.",
type, ds->ds_num);
return;
}
if (0 != parse_value(value_str, &value, ds->ds[0].type)) {
-static int powerdns_get_data_dgram(list_item_t *item, /* {{{ */
- char **ret_buffer, size_t *ret_buffer_size) {
+static int powerdns_get_data_dgram(list_item_t *item, char **ret_buffer) {
+ /* {{{ */
if ((status != 0) && (errno != ENOENT)) {
SOCK_ERROR("unlink", sa_unix.sun_path);
close(sd);
if ((status != 0) && (errno != ENOENT)) {
SOCK_ERROR("unlink", sa_unix.sun_path);
close(sd);
buffer_new = realloc(buffer, buffer_size + status + 1);
if (buffer_new == NULL) {
FUNC_ERROR("realloc");
buffer_new = realloc(buffer, buffer_size + status + 1);
if (buffer_new == NULL) {
FUNC_ERROR("realloc");
-static int powerdns_get_data(list_item_t *item, char **ret_buffer,
- size_t *ret_buffer_size) {
+static int powerdns_get_data(list_item_t *item, char **ret_buffer) {
item->command = strdup(SERVER_COMMAND);
if (item->command == NULL) {
ERROR("powerdns plugin: strdup failed.");
item->command = strdup(SERVER_COMMAND);
if (item->command == NULL) {
ERROR("powerdns plugin: strdup failed.");
- size_t buffer_size = 0;
- int status = powerdns_get_data(item, &buffer, &buffer_size);
- if (status != 0)
- return (-1);
- if ((buffer == NULL) || (buffer_size == 0)) {
+ int status = powerdns_get_data(item, &buffer);
+ if (status != 0) {
+ ERROR("powerdns plugin: powerdns_get_data failed.");
+ return status;
+ }
+ if (buffer == NULL) {
if (li->fields_num < 1) {
sstrncpy(buffer, RECURSOR_COMMAND, sizeof(buffer));
if (li->fields_num < 1) {
sstrncpy(buffer, RECURSOR_COMMAND, sizeof(buffer));
li->command = strdup(buffer);
if (li->command == NULL) {
ERROR("powerdns plugin: strdup failed.");
li->command = strdup(buffer);
if (li->command == NULL) {
ERROR("powerdns plugin: strdup failed.");
} /* }}} int powerdns_update_recursor_command */
static int powerdns_read_recursor(list_item_t *item) /* {{{ */
{
char *buffer = NULL;
} /* }}} int powerdns_update_recursor_command */
static int powerdns_read_recursor(list_item_t *item) /* {{{ */
{
char *buffer = NULL;
status = powerdns_update_recursor_command(item);
if (status != 0) {
ERROR("powerdns plugin: powerdns_update_recursor_command failed.");
status = powerdns_update_recursor_command(item);
if (status != 0) {
ERROR("powerdns plugin: powerdns_update_recursor_command failed.");
} /* }}} int powerdns_read_recursor */
static int powerdns_config_add_collect(list_item_t *li, /* {{{ */
} /* }}} int powerdns_read_recursor */
static int powerdns_config_add_collect(list_item_t *li, /* {{{ */
if (ci->values_num < 1) {
WARNING("powerdns plugin: The `Collect' option needs "
"at least one argument.");
if (ci->values_num < 1) {
WARNING("powerdns plugin: The `Collect' option needs "
"at least one argument.");
}
for (int i = 0; i < ci->values_num; i++)
if (ci->values[i].type != OCONFIG_TYPE_STRING) {
WARNING("powerdns plugin: Only string arguments are allowed to "
"the `Collect' option.");
}
for (int i = 0; i < ci->values_num; i++)
if (ci->values[i].type != OCONFIG_TYPE_STRING) {
WARNING("powerdns plugin: Only string arguments are allowed to "
"the `Collect' option.");
}
temp =
realloc(li->fields, sizeof(char *) * (li->fields_num + ci->values_num));
if (temp == NULL) {
WARNING("powerdns plugin: realloc failed.");
}
temp =
realloc(li->fields, sizeof(char *) * (li->fields_num + ci->values_num));
if (temp == NULL) {
WARNING("powerdns plugin: realloc failed.");
} /* }}} int powerdns_config_add_collect */
static int powerdns_config_add_server(oconfig_item_t *ci) /* {{{ */
} /* }}} int powerdns_config_add_collect */
static int powerdns_config_add_server(oconfig_item_t *ci) /* {{{ */
if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING)) {
WARNING("powerdns plugin: `%s' needs exactly one string argument.",
ci->key);
if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING)) {
WARNING("powerdns plugin: `%s' needs exactly one string argument.",
ci->key);
}
item = calloc(1, sizeof(*item));
if (item == NULL) {
ERROR("powerdns plugin: calloc failed.");
}
item = calloc(1, sizeof(*item));
if (item == NULL) {
ERROR("powerdns plugin: calloc failed.");
}
item->instance = strdup(ci->values[0].value.string);
if (item->instance == NULL) {
ERROR("powerdns plugin: strdup failed.");
sfree(item);
}
item->instance = strdup(ci->values[0].value.string);
if (item->instance == NULL) {
ERROR("powerdns plugin: strdup failed.");
sfree(item);
for (llentry_t *e = llist_head(list); e != NULL; e = e->next) {
list_item_t *item = (list_item_t *)e->value;
for (llentry_t *e = llist_head(list); e != NULL; e = e->next) {
list_item_t *item = (list_item_t *)e->value;
plugin_register_read("powerdns", powerdns_read);
plugin_register_shutdown("powerdns", powerdns_shutdown);
} /* void module_register */
plugin_register_read("powerdns", powerdns_read);
plugin_register_shutdown("powerdns", powerdns_shutdown);
} /* void module_register */