summaryrefslogtreecommitdiffstats
path: root/collectors/proc.plugin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-06 16:11:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-06 16:11:34 +0000
commitd079b656b4719739b2247dcd9d46e9bec793095a (patch)
treed2c950c70a776bcf697c963151c5bd959f8a9f03 /collectors/proc.plugin
parentReleasing debian version 1.37.1-2. (diff)
downloadnetdata-d079b656b4719739b2247dcd9d46e9bec793095a.tar.xz
netdata-d079b656b4719739b2247dcd9d46e9bec793095a.zip
Merging upstream version 1.38.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/proc.plugin')
-rw-r--r--collectors/proc.plugin/README.md10
-rw-r--r--collectors/proc.plugin/ipc.c36
-rw-r--r--collectors/proc.plugin/plugin_proc.c45
-rw-r--r--collectors/proc.plugin/plugin_proc.h3
-rw-r--r--collectors/proc.plugin/proc_diskstats.c62
-rw-r--r--collectors/proc.plugin/proc_interrupts.c4
-rw-r--r--collectors/proc.plugin/proc_loadavg.c4
-rw-r--r--collectors/proc.plugin/proc_mdstat.c12
-rw-r--r--collectors/proc.plugin/proc_meminfo.c8
-rw-r--r--collectors/proc.plugin/proc_net_dev.c33
-rw-r--r--collectors/proc.plugin/proc_net_netstat.c2441
-rw-r--r--collectors/proc.plugin/proc_net_rpc_nfs.c10
-rw-r--r--collectors/proc.plugin/proc_net_rpc_nfsd.c20
-rw-r--r--collectors/proc.plugin/proc_net_sctp_snmp.c2
-rw-r--r--collectors/proc.plugin/proc_net_softnet_stat.c2
-rw-r--r--collectors/proc.plugin/proc_net_stat_conntrack.c2
-rw-r--r--collectors/proc.plugin/proc_net_stat_synproxy.c2
-rw-r--r--collectors/proc.plugin/proc_pagetypeinfo.c14
-rw-r--r--collectors/proc.plugin/proc_pressure.c4
-rw-r--r--collectors/proc.plugin/proc_self_mountinfo.c9
-rw-r--r--collectors/proc.plugin/proc_softirqs.c4
-rw-r--r--collectors/proc.plugin/proc_spl_kstat_zfs.c14
-rw-r--r--collectors/proc.plugin/proc_stat.c54
-rw-r--r--collectors/proc.plugin/proc_vmstat.c2
-rw-r--r--collectors/proc.plugin/sys_block_zram.c12
-rw-r--r--collectors/proc.plugin/sys_class_infiniband.c21
-rw-r--r--collectors/proc.plugin/sys_class_power_supply.c14
-rw-r--r--collectors/proc.plugin/sys_devices_system_edac_mc.c2
-rw-r--r--collectors/proc.plugin/sys_devices_system_node.c4
-rw-r--r--collectors/proc.plugin/sys_fs_btrfs.c40
30 files changed, 1473 insertions, 1417 deletions
diff --git a/collectors/proc.plugin/README.md b/collectors/proc.plugin/README.md
index 32e2112a..f0355060 100644
--- a/collectors/proc.plugin/README.md
+++ b/collectors/proc.plugin/README.md
@@ -1,6 +1,10 @@
<!--
-title: "proc.plugin"
-custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/proc.plugin/README.md
+title: "OS provided metrics (proc.plugin)"
+custom_edit_url: "https://github.com/netdata/netdata/edit/master/collectors/proc.plugin/README.md"
+sidebar_label: "OS provided metrics (proc.plugin)"
+learn_status: "Published"
+learn_topic_type: "References"
+learn_rel_path: "References/Collectors references/System metrics"
-->
# proc.plugin
@@ -400,7 +404,7 @@ You can set the following values for each configuration option:
There are several alarms defined in `health.d/net.conf`.
-The tricky ones are `inbound packets dropped` and `inbound packets dropped ratio`. They have quite a strict policy so that they warn users about possible issues. These alarms can be annoying for some network configurations. It is especially true for some bonding configurations if an interface is a child or a bonding interface itself. If it is expected to have a certain number of drops on an interface for a certain network configuration, a separate alarm with different triggering thresholds can be created or the existing one can be disabled for this specific interface. It can be done with the help of the [families](/health/REFERENCE.md#alarm-line-families) line in the alarm configuration. For example, if you want to disable the `inbound packets dropped` alarm for `eth0`, set `families: !eth0 *` in the alarm definition for `template: inbound_packets_dropped`.
+The tricky ones are `inbound packets dropped` and `inbound packets dropped ratio`. They have quite a strict policy so that they warn users about possible issues. These alarms can be annoying for some network configurations. It is especially true for some bonding configurations if an interface is a child or a bonding interface itself. If it is expected to have a certain number of drops on an interface for a certain network configuration, a separate alarm with different triggering thresholds can be created or the existing one can be disabled for this specific interface. It can be done with the help of the [families](https://github.com/netdata/netdata/blob/master/health/REFERENCE.md#alarm-line-families) line in the alarm configuration. For example, if you want to disable the `inbound packets dropped` alarm for `eth0`, set `families: !eth0 *` in the alarm definition for `template: inbound_packets_dropped`.
#### configuration
diff --git a/collectors/proc.plugin/ipc.c b/collectors/proc.plugin/ipc.c
index 7d3d2ecb..adfc15be 100644
--- a/collectors/proc.plugin/ipc.c
+++ b/collectors/proc.plugin/ipc.c
@@ -82,7 +82,7 @@ static inline int ipc_sem_get_limits(struct ipc_limits *lim) {
ff = procfile_open(filename, NULL, PROCFILE_FLAG_DEFAULT);
if(unlikely(!ff)) {
if(unlikely(!error_shown)) {
- error("IPC: Cannot open file '%s'.", filename);
+ collector_error("IPC: Cannot open file '%s'.", filename);
error_shown = 1;
}
goto ipc;
@@ -92,7 +92,7 @@ static inline int ipc_sem_get_limits(struct ipc_limits *lim) {
ff = procfile_readall(ff);
if(unlikely(!ff)) {
if(unlikely(!error_shown)) {
- error("IPC: Cannot read file '%s'.", filename);
+ collector_error("IPC: Cannot read file '%s'.", filename);
error_shown = 1;
}
goto ipc;
@@ -108,7 +108,7 @@ static inline int ipc_sem_get_limits(struct ipc_limits *lim) {
}
else {
if(unlikely(!error_shown)) {
- error("IPC: Invalid content in file '%s'.", filename);
+ collector_error("IPC: Invalid content in file '%s'.", filename);
error_shown = 1;
}
goto ipc;
@@ -122,7 +122,7 @@ ipc:
union semun arg = {.array = (ushort *) &seminfo};
if(unlikely(semctl(0, 0, IPC_INFO, arg) < 0)) {
- error("IPC: Failed to read '%s' and request IPC_INFO with semctl().", filename);
+ collector_error("IPC: Failed to read '%s' and request IPC_INFO with semctl().", filename);
goto error;
}
@@ -166,7 +166,7 @@ static inline int ipc_sem_get_status(struct ipc_status *st) {
/* kernel not configured for semaphores */
static int error_shown = 0;
if(unlikely(!error_shown)) {
- error("IPC: kernel is not configured for semaphores");
+ collector_error("IPC: kernel is not configured for semaphores");
error_shown = 1;
}
st->semusz = 0;
@@ -195,7 +195,7 @@ int ipc_msq_get_info(char *msg_filename, struct message_queue **message_queue_ro
size_t words = 0;
if(unlikely(lines < 2)) {
- error("Cannot read %s. Expected 2 or more lines, read %zu.", procfile_filename(ff), lines);
+ collector_error("Cannot read %s. Expected 2 or more lines, read %zu.", procfile_filename(ff), lines);
return 1;
}
@@ -205,7 +205,7 @@ int ipc_msq_get_info(char *msg_filename, struct message_queue **message_queue_ro
words = procfile_linewords(ff, l);
if(unlikely(words < 2)) continue;
if(unlikely(words < 14)) {
- error("Cannot read %s line. Expected 14 params, read %zu.", procfile_filename(ff), words);
+ collector_error("Cannot read %s line. Expected 14 params, read %zu.", procfile_filename(ff), words);
continue;
}
@@ -250,7 +250,7 @@ int ipc_shm_get_info(char *shm_filename, struct shm_stats *shm) {
size_t words = 0;
if(unlikely(lines < 2)) {
- error("Cannot read %s. Expected 2 or more lines, read %zu.", procfile_filename(ff), lines);
+ collector_error("Cannot read %s. Expected 2 or more lines, read %zu.", procfile_filename(ff), lines);
return 1;
}
@@ -263,7 +263,7 @@ int ipc_shm_get_info(char *shm_filename, struct shm_stats *shm) {
words = procfile_linewords(ff, l);
if(unlikely(words < 2)) continue;
if(unlikely(words < 16)) {
- error("Cannot read %s line. Expected 16 params, read %zu.", procfile_filename(ff), words);
+ collector_error("Cannot read %s line. Expected 16 params, read %zu.", procfile_filename(ff), words);
continue;
}
@@ -306,11 +306,11 @@ int do_ipc(int update_every, usec_t dt) {
// make sure it works
if(ipc_sem_get_limits(&limits) == -1) {
- error("unable to fetch semaphore limits");
+ collector_error("unable to fetch semaphore limits");
do_sem = CONFIG_BOOLEAN_NO;
}
else if(ipc_sem_get_status(&status) == -1) {
- error("unable to fetch semaphore statistics");
+ collector_error("unable to fetch semaphore statistics");
do_sem = CONFIG_BOOLEAN_NO;
}
else {
@@ -362,7 +362,7 @@ int do_ipc(int update_every, usec_t dt) {
}
if(unlikely(do_sem == CONFIG_BOOLEAN_NO && do_msg == CONFIG_BOOLEAN_NO)) {
- error("ipc module disabled");
+ collector_error("ipc module disabled");
return 1;
}
}
@@ -370,7 +370,7 @@ int do_ipc(int update_every, usec_t dt) {
if(likely(do_sem != CONFIG_BOOLEAN_NO)) {
if(unlikely(read_limits_next < 0)) {
if(unlikely(ipc_sem_get_limits(&limits) == -1)) {
- error("Unable to fetch semaphore limits.");
+ collector_error("Unable to fetch semaphore limits.");
}
else {
if(semaphores_max) rrdvar_custom_host_variable_set(localhost, semaphores_max, limits.semmns);
@@ -386,7 +386,7 @@ int do_ipc(int update_every, usec_t dt) {
read_limits_next--;
if(unlikely(ipc_sem_get_status(&status) == -1)) {
- error("Unable to get semaphore statistics");
+ collector_error("Unable to get semaphore statistics");
return 0;
}
@@ -478,8 +478,8 @@ int do_ipc(int update_every, usec_t dt) {
long long dimensions_num = rrdset_number_of_dimensions(st_msq_messages);
if(unlikely(dimensions_num > dimensions_limit)) {
- info("Message queue statistics has been disabled");
- info("There are %lld dimensions in memory but limit was set to %lld", dimensions_num, dimensions_limit);
+ collector_info("Message queue statistics has been disabled");
+ collector_info("There are %lld dimensions in memory but limit was set to %lld", dimensions_num, dimensions_limit);
rrdset_is_obsolete(st_msq_messages);
rrdset_is_obsolete(st_msq_bytes);
st_msq_messages = NULL;
@@ -487,11 +487,11 @@ int do_ipc(int update_every, usec_t dt) {
do_msg = CONFIG_BOOLEAN_NO;
}
else if(unlikely(!message_queue_root)) {
- info("Making chart %s (%s) obsolete since it does not have any dimensions", rrdset_name(st_msq_messages), rrdset_id(st_msq_messages));
+ collector_info("Making chart %s (%s) obsolete since it does not have any dimensions", rrdset_name(st_msq_messages), rrdset_id(st_msq_messages));
rrdset_is_obsolete(st_msq_messages);
st_msq_messages = NULL;
- info("Making chart %s (%s) obsolete since it does not have any dimensions", rrdset_name(st_msq_bytes), rrdset_id(st_msq_bytes));
+ collector_info("Making chart %s (%s) obsolete since it does not have any dimensions", rrdset_name(st_msq_bytes), rrdset_id(st_msq_bytes));
rrdset_is_obsolete(st_msq_bytes);
st_msq_bytes = NULL;
}
diff --git a/collectors/proc.plugin/plugin_proc.c b/collectors/proc.plugin/plugin_proc.c
index 1b24df45..1f52713c 100644
--- a/collectors/proc.plugin/plugin_proc.c
+++ b/collectors/proc.plugin/plugin_proc.c
@@ -86,7 +86,7 @@ static void proc_main_cleanup(void *ptr)
struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
static_thread->enabled = NETDATA_MAIN_THREAD_EXITING;
- info("cleaning up...");
+ collector_info("cleaning up...");
if (netdev_thread) {
netdata_thread_join(*netdev_thread, NULL);
@@ -98,6 +98,41 @@ static void proc_main_cleanup(void *ptr)
worker_unregister();
}
+bool inside_lxc_container = false;
+
+static bool is_lxcfs_proc_mounted() {
+ procfile *ff = NULL;
+
+ if (unlikely(!ff)) {
+ char filename[FILENAME_MAX + 1];
+ snprintfz(filename, FILENAME_MAX, "/proc/self/mounts");
+ ff = procfile_open(filename, " \t", PROCFILE_FLAG_DEFAULT);
+ if (unlikely(!ff))
+ return false;
+ }
+
+ ff = procfile_readall(ff);
+ if (unlikely(!ff))
+ return false;
+
+ unsigned long l, lines = procfile_lines(ff);
+
+ for (l = 0; l < lines; l++) {
+ size_t words = procfile_linewords(ff, l);
+ if (words < 2) {
+ continue;
+ }
+ if (!strcmp(procfile_lineword(ff, l, 0), "lxcfs") && !strncmp(procfile_lineword(ff, l, 1), "/proc", 5)) {
+ procfile_close(ff);
+ return true;
+ }
+ }
+
+ procfile_close(ff);
+
+ return false;
+}
+
void *proc_main(void *ptr)
{
worker_register("PROC");
@@ -128,15 +163,17 @@ void *proc_main(void *ptr)
heartbeat_t hb;
heartbeat_init(&hb);
- while (!netdata_exit) {
+ inside_lxc_container = is_lxcfs_proc_mounted();
+
+ while (service_running(SERVICE_COLLECTORS)) {
worker_is_idle();
usec_t hb_dt = heartbeat_next(&hb, step);
- if (unlikely(netdata_exit))
+ if (unlikely(!service_running(SERVICE_COLLECTORS)))
break;
for (i = 0; proc_modules[i].name; i++) {
- if (unlikely(netdata_exit))
+ if (unlikely(!service_running(SERVICE_COLLECTORS)))
break;
struct proc_module *pm = &proc_modules[i];
diff --git a/collectors/proc.plugin/plugin_proc.h b/collectors/proc.plugin/plugin_proc.h
index d67ccd6e..e8746ba3 100644
--- a/collectors/proc.plugin/plugin_proc.h
+++ b/collectors/proc.plugin/plugin_proc.h
@@ -8,7 +8,7 @@
#define PLUGIN_PROC_CONFIG_NAME "proc"
#define PLUGIN_PROC_NAME PLUGIN_PROC_CONFIG_NAME ".plugin"
-#define THREAD_NETDEV_NAME "PLUGIN[proc netdev]"
+#define THREAD_NETDEV_NAME "P[proc netdev]"
void *netdev_main(void *ptr);
int do_proc_net_wireless(int update_every, usec_t dt);
@@ -48,6 +48,7 @@ int get_numa_node_count(void);
// metrics that need to be shared among data collectors
extern unsigned long long zfs_arcstats_shrinkable_cache_size_bytes;
+extern bool inside_lxc_container;
// netdev renames
void netdev_rename_device_add(
diff --git a/collectors/proc.plugin/proc_diskstats.c b/collectors/proc.plugin/proc_diskstats.c
index 28d0e758..b487f291 100644
--- a/collectors/proc.plugin/proc_diskstats.c
+++ b/collectors/proc.plugin/proc_diskstats.c
@@ -214,7 +214,7 @@ static unsigned long long int bcache_read_number_with_units(const char *filename
else if(*end == 'T')
return (unsigned long long int)(value * 1024.0 * 1024.0 * 1024.0 * 1024.0);
else if(unknown_units_error > 0) {
- error("bcache file '%s' provides value '%s' with unknown units '%s'", filename, buffer, end);
+ collector_error("bcache file '%s' provides value '%s' with unknown units '%s'", filename, buffer, end);
unknown_units_error--;
}
}
@@ -269,7 +269,7 @@ void bcache_read_priority_stats(struct disk *d, const char *family, int update_e
for(l = 0; l < lines ;l++) {
size_t words = procfile_linewords(ff, l);
if(unlikely(words < 2)) {
- if(unlikely(words)) error("Cannot read '%s' line %zu. Expected 2 params, read %zu.", d->bcache_filename_priority_stats, l, words);
+ if(unlikely(words)) collector_error("Cannot read '%s' line %zu. Expected 2 params, read %zu.", d->bcache_filename_priority_stats, l, words);
continue;
}
@@ -344,7 +344,7 @@ static inline int is_major_enabled(int major) {
}
static inline int get_disk_name_from_path(const char *path, char *result, size_t result_size, unsigned long major, unsigned long minor, char *disk, char *prefix, int depth) {
- //info("DEVICE-MAPPER ('%s', %lu:%lu): examining directory '%s' (allowed depth %d).", disk, major, minor, path, depth);
+ //collector_info("DEVICE-MAPPER ('%s', %lu:%lu): examining directory '%s' (allowed depth %d).", disk, major, minor, path, depth);
int found = 0, preferred = 0;
@@ -352,7 +352,7 @@ static inline int get_disk_name_from_path(const char *path, char *result, size_t
DIR *dir = opendir(path);
if (!dir) {
- error("DEVICE-MAPPER ('%s', %lu:%lu): Cannot open directory '%s'.", disk, major, minor, path);
+ collector_error("DEVICE-MAPPER ('%s', %lu:%lu): Cannot open directory '%s'.", disk, major, minor, path);
goto failed;
}
@@ -363,7 +363,7 @@ static inline int get_disk_name_from_path(const char *path, char *result, size_t
continue;
if(depth <= 0) {
- error("DEVICE-MAPPER ('%s', %lu:%lu): Depth limit reached for path '%s/%s'. Ignoring path.", disk, major, minor, path, de->d_name);
+ collector_error("DEVICE-MAPPER ('%s', %lu:%lu): Depth limit reached for path '%s/%s'. Ignoring path.", disk, major, minor, path, de->d_name);
break;
}
else {
@@ -393,7 +393,7 @@ static inline int get_disk_name_from_path(const char *path, char *result, size_t
snprintfz(filename, FILENAME_MAX, "%s/%s", path, de->d_name);
ssize_t len = readlink(filename, result, result_size - 1);
if(len <= 0) {
- error("DEVICE-MAPPER ('%s', %lu:%lu): Cannot read link '%s'.", disk, major, minor, filename);
+ collector_error("DEVICE-MAPPER ('%s', %lu:%lu): Cannot read link '%s'.", disk, major, minor, filename);
continue;
}
@@ -409,21 +409,21 @@ static inline int get_disk_name_from_path(const char *path, char *result, size_t
struct stat sb;
if(stat(filename, &sb) == -1) {
- error("DEVICE-MAPPER ('%s', %lu:%lu): Cannot stat() file '%s'.", disk, major, minor, filename);
+ collector_error("DEVICE-MAPPER ('%s', %lu:%lu): Cannot stat() file '%s'.", disk, major, minor, filename);
continue;
}
if((sb.st_mode & S_IFMT) != S_IFBLK) {
- //info("DEVICE-MAPPER ('%s', %lu:%lu): file '%s' is not a block device.", disk, major, minor, filename);
+ //collector_info("DEVICE-MAPPER ('%s', %lu:%lu): file '%s' is not a block device.", disk, major, minor, filename);
continue;
}
if(major(sb.st_rdev) != major || minor(sb.st_rdev) != minor || strcmp(basename(filename), disk)) {
- //info("DEVICE-MAPPER ('%s', %lu:%lu): filename '%s' does not match %lu:%lu.", disk, major, minor, filename, (unsigned long)major(sb.st_rdev), (unsigned long)minor(sb.st_rdev));
+ //collector_info("DEVICE-MAPPER ('%s', %lu:%lu): filename '%s' does not match %lu:%lu.", disk, major, minor, filename, (unsigned long)major(sb.st_rdev), (unsigned long)minor(sb.st_rdev));
continue;
}
- //info("DEVICE-MAPPER ('%s', %lu:%lu): filename '%s' matches.", disk, major, minor, filename);
+ //collector_info("DEVICE-MAPPER ('%s', %lu:%lu): filename '%s' matches.", disk, major, minor, filename);
snprintfz(result, result_size - 1, "%s%s%s", (prefix)?prefix:"", (prefix)?"_":"", de->d_name);
@@ -672,7 +672,7 @@ static struct disk *get_disk(unsigned long major, unsigned long minor, char *dis
break;
}
if (unlikely(closedir(dirp) == -1))
- error("Unable to close dir %s", buffer);
+ collector_error("Unable to close dir %s", buffer);
}
}
}
@@ -721,15 +721,15 @@ static struct disk *get_disk(unsigned long major, unsigned long minor, char *dis
if(likely(tmp)) {
d->sector_size = str2i(tmp);
if(unlikely(d->sector_size <= 0)) {
- error("Invalid sector size %d for device %s in %s. Assuming 512.", d->sector_size, d->device, buffer);
+ collector_error("Invalid sector size %d for device %s in %s. Assuming 512.", d->sector_size, d->device, buffer);
d->sector_size = 512;
}
}
- else error("Cannot read data for sector size for device %s from %s. Assuming 512.", d->device, buffer);
+ else collector_error("Cannot read data for sector size for device %s from %s. Assuming 512.", d->device, buffer);
fclose(fpss);
}
- else error("Cannot read sector size for device %s from %s. Assuming 512.", d->device, buffer);
+ else collector_error("Cannot read sector size for device %s from %s. Assuming 512.", d->device, buffer);
}
*/
@@ -748,103 +748,103 @@ static struct disk *get_disk(unsigned long major, unsigned long minor, char *dis
if(access(buffer2, R_OK) == 0)
d->bcache_filename_cache_congested = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/readahead", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_stats_total_cache_readaheads = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/cache/cache0/priority_stats", buffer); // only one cache is supported by bcache
if(access(buffer2, R_OK) == 0)
d->bcache_filename_priority_stats = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/cache/internal/cache_read_races", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_cache_read_races = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/cache/cache0/io_errors", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_cache_io_errors = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/dirty_data", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_dirty_data = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/writeback_rate", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_writeback_rate = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/cache/cache_available_percent", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_cache_available_percent = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/stats_total/cache_hits", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_stats_total_cache_hits = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/stats_five_minute/cache_hit_ratio", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_stats_five_minute_cache_hit_ratio = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/stats_hour/cache_hit_ratio", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_stats_hour_cache_hit_ratio = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/stats_day/cache_hit_ratio", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_stats_day_cache_hit_ratio = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/stats_total/cache_hit_ratio", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_stats_total_cache_hit_ratio = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/stats_total/cache_misses", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_stats_total_cache_misses = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/stats_total/cache_bypass_hits", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_stats_total_cache_bypass_hits = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/stats_total/cache_bypass_misses", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_stats_total_cache_bypass_misses = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
snprintfz(buffer2, FILENAME_MAX, "%s/stats_total/cache_miss_collisions", buffer);
if(access(buffer2, R_OK) == 0)
d->bcache_filename_stats_total_cache_miss_collisions = strdupz(buffer2);
else
- error("bcache file '%s' cannot be read.", buffer2);
+ collector_error("bcache file '%s' cannot be read.", buffer2);
}
get_disk_config(d);
diff --git a/collectors/proc.plugin/proc_interrupts.c b/collectors/proc.plugin/proc_interrupts.c
index f8768475..04d8c73a 100644
--- a/collectors/proc.plugin/proc_interrupts.c
+++ b/collectors/proc.plugin/proc_interrupts.c
@@ -78,7 +78,7 @@ int do_proc_interrupts(int update_every, usec_t dt) {
size_t words = procfile_linewords(ff, 0);
if(unlikely(!lines)) {
- error("Cannot read /proc/interrupts, zero lines reported.");
+ collector_error("Cannot read /proc/interrupts, zero lines reported.");
return 1;
}
@@ -93,7 +93,7 @@ int do_proc_interrupts(int update_every, usec_t dt) {
}
if(unlikely(!cpus)) {
- error("PLUGIN: PROC_INTERRUPTS: Cannot find the number of CPUs in /proc/interrupts");
+ collector_error("PLUGIN: PROC_INTERRUPTS: Cannot find the number of CPUs in /proc/interrupts");
return 1;
}
diff --git a/collectors/proc.plugin/proc_loadavg.c b/collectors/proc.plugin/proc_loadavg.c
index d928c861..e833f69d 100644
--- a/collectors/proc.plugin/proc_loadavg.c
+++ b/collectors/proc.plugin/proc_loadavg.c
@@ -32,11 +32,11 @@ int do_proc_loadavg(int update_every, usec_t dt) {
}
if(unlikely(procfile_lines(ff) < 1)) {
- error("/proc/loadavg has no lines.");
+ collector_error("/proc/loadavg has no lines.");
return 1;
}
if(unlikely(procfile_linewords(ff, 0) < 6)) {
- error("/proc/loadavg has less than 6 words in it.");
+ collector_error("/proc/loadavg has less than 6 words in it.");
return 1;
}
diff --git a/collectors/proc.plugin/proc_mdstat.c b/collectors/proc.plugin/proc_mdstat.c
index 63e0c68e..d6e87fd2 100644
--- a/collectors/proc.plugin/proc_mdstat.c
+++ b/collectors/proc.plugin/proc_mdstat.c
@@ -135,7 +135,7 @@ int do_proc_mdstat(int update_every, usec_t dt)
size_t words = 0;
if (unlikely(lines < 2)) {
- error("Cannot read /proc/mdstat. Expected 2 or more lines, read %zu.", lines);
+ collector_error("Cannot read /proc/mdstat. Expected 2 or more lines, read %zu.", lines);
return 1;
}
@@ -212,7 +212,7 @@ int do_proc_mdstat(int update_every, usec_t dt)
s = procfile_lineword(ff, l, words - 2);
if (unlikely(s[0] != '[')) {
- error("Cannot read /proc/mdstat raid health status. Unexpected format: missing opening bracket.");
+ collector_error("Cannot read /proc/mdstat raid health status. Unexpected format: missing opening bracket.");
continue;
}
str_total = ++s;
@@ -227,7 +227,7 @@ int do_proc_mdstat(int update_every, usec_t dt)
s++;
}
if (unlikely(str_total[0] == '\0' || !str_inuse || str_inuse[0] == '\0')) {
- error("Cannot read /proc/mdstat raid health status. Unexpected format.");
+ collector_error("Cannot read /proc/mdstat raid health status. Unexpected format.");
continue;
}
@@ -260,7 +260,7 @@ int do_proc_mdstat(int update_every, usec_t dt)
continue;
if (unlikely(words < 7)) {
- error("Cannot read /proc/mdstat line. Expected 7 params, read %zu.", words);
+ collector_error("Cannot read /proc/mdstat line. Expected 7 params, read %zu.", words);
continue;
}
@@ -326,9 +326,9 @@ int do_proc_mdstat(int update_every, usec_t dt)
raid->mismatch_cnt_filename = strdupz(filename);
}
if (unlikely(read_single_number_file(raid->mismatch_cnt_filename, &raid->mismatch_cnt))) {
- error("Cannot read file '%s'", raid->mismatch_cnt_filename);
+ collector_error("Cannot read file '%s'", raid->mismatch_cnt_filename);
do_mismatch = CONFIG_BOOLEAN_NO;
- error("Monitoring for mismatch count has been disabled");
+ collector_error("Monitoring for mismatch count has been disabled");
break;
}
}
diff --git a/collectors/proc.plugin/proc_meminfo.c b/collectors/proc.plugin/proc_meminfo.c
index 2f390c65..6988c70e 100644
--- a/collectors/proc.plugin/proc_meminfo.c
+++ b/collectors/proc.plugin/proc_meminfo.c
@@ -158,9 +158,11 @@ int do_proc_meminfo(int update_every, usec_t dt) {
unsigned long long MemCached = Cached + SReclaimable - Shmem;
unsigned long long MemUsed = MemTotal - MemFree - MemCached - Buffers;
// The Linux kernel doesn't report ZFS ARC usage as cache memory (the ARC is included in the total used system memory)
- MemCached += (zfs_arcstats_shrinkable_cache_size_bytes / 1024);
- MemUsed -= (zfs_arcstats_shrinkable_cache_size_bytes / 1024);
- MemAvailable += (zfs_arcstats_shrinkable_cache_size_bytes / 1024);
+ if (!inside_lxc_container) {
+ MemCached += (zfs_arcstats_shrinkable_cache_size_bytes / 1024);
+ MemUsed -= (zfs_arcstats_shrinkable_cache_size_bytes / 1024);
+ MemAvailable += (zfs_arcstats_shrinkable_cache_size_bytes / 1024);
+ }
if(do_ram) {
{
diff --git a/collectors/proc.plugin/proc_net_dev.c b/collectors/proc.plugin/proc_net_dev.c
index e124f631..3ec8783b 100644
--- a/collectors/proc.plugin/proc_net_dev.c
+++ b/collectors/proc.plugin/proc_net_dev.c
@@ -391,7 +391,7 @@ void netdev_rename_device_add(
r->processed = 0;
netdev_rename_root = r;
netdev_pending_renames++;
- info("CGROUP: registered network interface rename for '%s' as '%s' under '%s'", r->host_device, r->container_device, r->container_name);
+ collector_info("CGROUP: registered network interface rename for '%s' as '%s' under '%s'", r->host_device, r->container_device, r->container_name);
}
else {
if(strcmp(r->container_device, container_device) != 0 || strcmp(r->container_name, container_name) != 0) {
@@ -405,7 +405,7 @@ void netdev_rename_device_add(
r->processed = 0;
netdev_pending_renames++;
- info("CGROUP: altered network interface rename for '%s' as '%s' under '%s'", r->host_device, r->container_device, r->container_name);
+ collector_info("CGROUP: altered network interface rename for '%s' as '%s' under '%s'", r->host_device, r->container_device, r->container_name);
}
}
@@ -429,7 +429,7 @@ void netdev_rename_device_del(const char *host_device) {
if(!r->processed)
netdev_pending_renames--;
- info("CGROUP: unregistered network interface rename for '%s' as '%s' under '%s'", r->host_device, r->container_device, r->container_name);
+ collector_info("CGROUP: unregistered network interface rename for '%s' as '%s' under '%s'", r->host_device, r->container_device, r->container_name);
freez((void *) r->host_device);
freez((void *) r->container_name);
@@ -445,7 +445,7 @@ void netdev_rename_device_del(const char *host_device) {
}
static inline void netdev_rename_cgroup(struct netdev *d, struct netdev_rename *r) {
- info("CGROUP: renaming network interface '%s' as '%s' under '%s'", r->host_device, r->container_device, r->container_name);
+ collector_info("CGROUP: renaming network interface '%s' as '%s' under '%s'", r->host_device, r->container_device, r->container_name);
netdev_charts_release(d);
netdev_free_chart_strings(d);
@@ -516,8 +516,7 @@ static inline void netdev_rename_cgroup(struct netdev *d, struct netdev_rename *
snprintfz(buffer, RRD_ID_LENGTH_MAX, "%scgroup.net_mtu", r->ctx_prefix);
d->chart_ctx_net_mtu = strdupz(buffer);
- snprintfz(buffer, RRD_ID_LENGTH_MAX, "net %s", r->container_device);
- d->chart_family = strdupz(buffer);
+ d->chart_family = strdupz("net");
rrdlabels_copy(d->chart_labels, r->chart_labels);
@@ -561,7 +560,7 @@ static void netdev_cleanup() {
struct netdev *d = netdev_root, *last = NULL;
while(d) {
if(unlikely(!d->updated)) {
- // info("Removing network device '%s', linked after '%s'", d->name, last?last->name:"ROOT");
+ // collector_info("Removing network device '%s', linked after '%s'", d->name, last?last->name:"ROOT");
if(netdev_last_used == d)
netdev_last_used = last;
@@ -875,7 +874,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
now_monotonic_sec() - d->carrier_file_lost_time > READ_RETRY_PERIOD)) {
if (read_single_number_file(d->filename_carrier, &d->carrier)) {
if (d->carrier_file_exists)
- error(
+ collector_error(
"Cannot refresh interface %s carrier state by reading '%s'. Next update is in %d seconds.",
d->name,
d->filename_carrier,
@@ -897,7 +896,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
if (read_file(d->filename_duplex, buffer, STATE_LENGTH_MAX)) {
if (d->duplex_file_exists)
- error("Cannot refresh interface %s duplex state by reading '%s'.", d->name, d->filename_duplex);
+ collector_error("Cannot refresh interface %s duplex state by reading '%s'.", d->name, d->filename_duplex);
d->duplex_file_exists = 0;
d->duplex_file_lost_time = now_monotonic_sec();
d->duplex = NETDEV_DUPLEX_UNKNOWN;
@@ -920,7 +919,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
char buffer[STATE_LENGTH_MAX + 1], *trimmed_buffer;
if (read_file(d->filename_operstate, buffer, STATE_LENGTH_MAX)) {
- error(
+ collector_error(
"Cannot refresh %s operstate by reading '%s'. Will not update its status anymore.",
d->name, d->filename_operstate);
freez(d->filename_operstate);
@@ -933,14 +932,14 @@ int do_proc_net_dev(int update_every, usec_t dt) {
if (d->do_mtu != CONFIG_BOOLEAN_NO && d->filename_mtu) {
if (read_single_number_file(d->filename_mtu, &d->mtu)) {
- error(
+ collector_error(
"Cannot refresh mtu for interface %s by reading '%s'. Stop updating it.", d->name, d->filename_mtu);
freez(d->filename_mtu);
d->filename_mtu = NULL;
}
}
- //info("PROC_NET_DEV: %s speed %zu, bytes %zu/%zu, packets %zu/%zu/%zu, errors %zu/%zu, drops %zu/%zu, fifo %zu/%zu, compressed %zu/%zu, rframe %zu, tcollisions %zu, tcarrier %zu"
+ //collector_info("PROC_NET_DEV: %s speed %zu, bytes %zu/%zu, packets %zu/%zu/%zu, errors %zu/%zu, drops %zu/%zu, fifo %zu/%zu, compressed %zu/%zu, rframe %zu, tcollisions %zu, tcarrier %zu"
// , d->name, d->speed
// , d->rbytes, d->tbytes
// , d->rpackets, d->tpackets, d->rmulticast
@@ -997,7 +996,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
d->chart_var_speed =
rrdsetvar_custom_chart_variable_add_and_acquire(d->st_bandwidth, "nic_speed_max");
if(!d->chart_var_speed) {
- error(
+ collector_error(
"Cannot create interface %s chart variable 'nic_speed_max'. Will not update its speed anymore.",
d->name);
freez(d->filename_speed);
@@ -1017,7 +1016,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
if(ret) {
if (d->speed_file_exists)
- error("Cannot refresh interface %s speed by reading '%s'.", d->name, d->filename_speed);
+ collector_error("Cannot refresh interface %s speed by reading '%s'.", d->name, d->filename_speed);
d->speed_file_exists = 0;
d->speed_file_lost_time = now_monotonic_sec();
}
@@ -1489,7 +1488,7 @@ static void netdev_main_cleanup(void *ptr)
{
UNUSED(ptr);
- info("cleaning up...");
+ collector_info("cleaning up...");
worker_unregister();
}
@@ -1505,11 +1504,11 @@ void *netdev_main(void *ptr)
heartbeat_t hb;
heartbeat_init(&hb);
- while (!netdata_exit) {
+ while (service_running(SERVICE_COLLECTORS)) {
worker_is_idle();
usec_t hb_dt = heartbeat_next(&hb, step);
- if (unlikely(netdata_exit))
+ if (unlikely(!service_running(SERVICE_COLLECTORS)))
break;
worker_is_busy(0);
diff --git a/collectors/proc.plugin/proc_net_netstat.c b/collectors/proc.plugin/proc_net_netstat.c
index f7635e3d..ce3068c0 100644
--- a/collectors/proc.plugin/proc_net_netstat.c
+++ b/collectors/proc.plugin/proc_net_netstat.c
@@ -97,7 +97,7 @@ static void parse_line_pair(procfile *ff_netstat, ARL_BASE *base, size_t header_
size_t w;
if(unlikely(vwords > hwords)) {
- error("File /proc/net/netstat on header line %zu has %zu words, but on value line %zu has %zu words.", header_line, hwords, values_line, vwords);
+ collector_error("File /proc/net/netstat on header line %zu has %zu words, but on value line %zu has %zu words.", header_line, hwords, values_line, vwords);
vwords = hwords;
}
@@ -107,16 +107,12 @@ static void parse_line_pair(procfile *ff_netstat, ARL_BASE *base, size_t header_
}
}
-int do_proc_net_netstat(int update_every, usec_t dt) {
- (void)dt;
-
- static int do_bandwidth = -1, do_inerrors = -1, do_mcast = -1, do_bcast = -1, do_mcast_p = -1, do_bcast_p = -1, do_ecn = -1, \
- do_tcpext_reorder = -1, do_tcpext_syscookies = -1, do_tcpext_ofo = -1, do_tcpext_connaborts = -1, do_tcpext_memory = -1,
- do_tcpext_syn_queue = -1, do_tcpext_accept_queue = -1;
+static void do_proc_net_snmp6(int update_every) {
+ static bool do_snmp6 = true;
- static int do_ip_packets = -1, do_ip_fragsout = -1, do_ip_fragsin = -1, do_ip_errors = -1,
- do_tcp_sockets = -1, do_tcp_packets = -1, do_tcp_errors = -1, do_tcp_handshake = -1, do_tcp_opens = -1,
- do_udp_packets = -1, do_udp_errors = -1, do_icmp_packets = -1, do_icmpmsg = -1, do_udplite_packets = -1;
+ if (!do_snmp6) {
+ return;
+ }
static int do_ip6_packets = -1, do_ip6_fragsout = -1, do_ip6_fragsin = -1, do_ip6_errors = -1,
do_ip6_udplite_packets = -1, do_ip6_udplite_errors = -1, do_ip6_udp_packets = -1, do_ip6_udp_errors = -1,
@@ -125,104 +121,10 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
do_ip6_icmp_router = -1, do_ip6_icmp_neighbor = -1, do_ip6_icmp_mldv2 = -1, do_ip6_icmp_types = -1,
do_ip6_ect = -1;
- static uint32_t hash_ipext = 0, hash_tcpext = 0;
- static uint32_t hash_ip = 0, hash_icmp = 0, hash_tcp = 0, hash_udp = 0, hash_icmpmsg = 0, hash_udplite = 0;
-
- static procfile *ff_netstat = NULL;
- static procfile *ff_snmp = NULL;
static procfile *ff_snmp6 = NULL;
- static ARL_BASE *arl_tcpext = NULL;
- static ARL_BASE *arl_ipext = NULL;
-
- static ARL_BASE *arl_ip = NULL;
- static ARL_BASE *arl_icmp = NULL;
- static ARL_BASE *arl_icmpmsg = NULL;
- static ARL_BASE *arl_tcp = NULL;
- static ARL_BASE *arl_udp = NULL;
- static ARL_BASE *arl_udplite = NULL;
-
static ARL_BASE *arl_ipv6 = NULL;
- static const RRDVAR_ACQUIRED *tcp_max_connections_var = NULL;
-
- // --------------------------------------------------------------------
- // IP
-
- // IP bandwidth
- static unsigned long long ipext_InOctets = 0;
- static unsigned long long ipext_OutOctets = 0;
-
- // IP input errors
- static unsigned long long ipext_InNoRoutes = 0;
- static unsigned long long ipext_InTruncatedPkts = 0;
- static unsigned long long ipext_InCsumErrors = 0;
-
- // IP multicast bandwidth
- static unsigned long long ipext_InMcastOctets = 0;
- static unsigned long long ipext_OutMcastOctets = 0;
-
- // IP multicast packets
- static unsigned long long ipext_InMcastPkts = 0;
- static unsigned long long ipext_OutMcastPkts = 0;
-
- // IP broadcast bandwidth
- static unsigned long long ipext_InBcastOctets = 0;
- static unsigned long long ipext_OutBcastOctets = 0;
-
- // IP broadcast packets
- static unsigned long long ipext_InBcastPkts = 0;
- static unsigned long long ipext_OutBcastPkts = 0;
-
- // IP ECN
- static unsigned long long ipext_InNoECTPkts = 0;
- static unsigned long long ipext_InECT1Pkts = 0;
- static unsigned long long ipext_InECT0Pkts = 0;
- static unsigned long long ipext_InCEPkts = 0;
-
- // --------------------------------------------------------------------
- // IP TCP
-
- // IP TCP Reordering
- static unsigned long long tcpext_TCPRenoReorder = 0;
- static unsigned long long tcpext_TCPFACKReorder = 0;
- static unsigned long long tcpext_TCPSACKReorder = 0;
- static unsigned long long tcpext_TCPTSReorder = 0;
-
- // IP TCP SYN Cookies
- static unsigned long long tcpext_SyncookiesSent = 0;
- static unsigned long long tcpext_SyncookiesRecv = 0;
- static unsigned long long tcpext_SyncookiesFailed = 0;
-
- // IP TCP Out Of Order Queue
- // http://www.spinics.net/lists/netdev/msg204696.html
- static unsigned long long tcpext_TCPOFOQueue = 0; // Number of packets queued in OFO queue
- static unsigned long long tcpext_TCPOFODrop = 0; // Number of packets meant to be queued in OFO but dropped because socket rcvbuf limit hit.
- static unsigned long long tcpext_TCPOFOMerge = 0; // Number of packets in OFO that were merged with other packets.
- static unsigned long long tcpext_OfoPruned = 0; // packets dropped from out-of-order queue because of socket buffer overrun
-
- // IP TCP connection resets
- // https://github.com/ecki/net-tools/blob/bd8bceaed2311651710331a7f8990c3e31be9840/statistics.c
- static unsigned long long tcpext_TCPAbortOnData = 0; // connections reset due to unexpected data
- static unsigned long long tcpext_TCPAbortOnClose = 0; // connections reset due to early user close
- static unsigned long long tcpext_TCPAbortOnMemory = 0; // connections aborted due to memory pressure
- static unsigned long long tcpext_TCPAbortOnTimeout = 0; // connections aborted due to timeout
- static unsigned long long tcpext_TCPAbortOnLinger = 0; // connections aborted after user close in linger timeout
- static unsigned long long tcpext_TCPAbortFailed = 0; // times unable to send RST due to no memory
-
- // https://perfchron.com/2015/12/26/investigating-linux-network-issues-with-netstat-and-nstat/
- static unsigned long long tcpext_ListenOverflows = 0; // times the listen queue of a socket overflowed
- static unsigned long long tcpext_ListenDrops = 0; // SYNs to LISTEN sockets ignored
-
- // IP TCP memory pressures
- static unsigned long long tcpext_TCPMemoryPressures = 0;
-
- static unsigned long long tcpext_TCPReqQFullDrop = 0;
- static unsigned long long tcpext_TCPReqQFullDoCookies = 0;
-
- static unsigned long long tcpext_TCPSynRetrans = 0;
-
- // IPv6
static unsigned long long Ip6InReceives = 0ULL;
static unsigned long long Ip6InHdrErrors = 0ULL;
static unsigned long long Ip6InTooBigErrors = 0ULL;
@@ -316,6 +218,1207 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
static unsigned long long UdpLite6SndbufErrors = 0ULL;
static unsigned long long UdpLite6InCsumErrors = 0ULL;
+ // prepare for /proc/net/snmp6 parsing
+
+ if(unlikely(!arl_ipv6)) {
+ do_ip6_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 packets", CONFIG_BOOLEAN_AUTO);
+ do_ip6_fragsout = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments sent", CONFIG_BOOLEAN_AUTO);
+ do_ip6_fragsin = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments assembly", CONFIG_BOOLEAN_AUTO);
+ do_ip6_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 errors", CONFIG_BOOLEAN_AUTO);
+ do_ip6_udp_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP packets", CONFIG_BOOLEAN_AUTO);
+ do_ip6_udp_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP errors", CONFIG_BOOLEAN_AUTO);
+ do_ip6_udplite_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite packets", CONFIG_BOOLEAN_AUTO);
+ do_ip6_udplite_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite errors", CONFIG_BOOLEAN_AUTO);
+ do_ip6_bandwidth = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "bandwidth", CONFIG_BOOLEAN_AUTO);
+ do_ip6_mcast = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast bandwidth", CONFIG_BOOLEAN_AUTO);
+ do_ip6_bcast = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "broadcast bandwidth", CONFIG_BOOLEAN_AUTO);
+ do_ip6_mcast_p = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast packets", CONFIG_BOOLEAN_AUTO);
+ do_ip6_icmp = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp", CONFIG_BOOLEAN_AUTO);
+ do_ip6_icmp_redir = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp redirects", CONFIG_BOOLEAN_AUTO);
+ do_ip6_icmp_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp errors", CONFIG_BOOLEAN_AUTO);
+ do_ip6_icmp_echos = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp echos", CONFIG_BOOLEAN_AUTO);
+ do_ip6_icmp_groupmemb = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp group membership", CONFIG_BOOLEAN_AUTO);
+ do_ip6_icmp_router = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp router", CONFIG_BOOLEAN_AUTO);
+ do_ip6_icmp_neighbor = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp neighbor", CONFIG_BOOLEAN_AUTO);
+ do_ip6_icmp_mldv2 = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp mldv2", CONFIG_BOOLEAN_AUTO);
+ do_ip6_icmp_types = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp types", CONFIG_BOOLEAN_AUTO);
+ do_ip6_ect = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ect", CONFIG_BOOLEAN_AUTO);
+
+ arl_ipv6 = arl_create("snmp6", NULL, 60);
+ arl_expect(arl_ipv6, "Ip6InReceives", &Ip6InReceives);
+ arl_expect(arl_ipv6, "Ip6InHdrErrors", &Ip6InHdrErrors);
+ arl_expect(arl_ipv6, "Ip6InTooBigErrors", &Ip6InTooBigErrors);
+ arl_expect(arl_ipv6, "Ip6InNoRoutes", &Ip6InNoRoutes);
+ arl_expect(arl_ipv6, "Ip6InAddrErrors", &Ip6InAddrErrors);
+ arl_expect(arl_ipv6, "Ip6InUnknownProtos", &Ip6InUnknownProtos);
+ arl_expect(arl_ipv6, "Ip6InTruncatedPkts", &Ip6InTruncatedPkts);
+ arl_expect(arl_ipv6, "Ip6InDiscards", &Ip6InDiscards);
+ arl_expect(arl_ipv6, "Ip6InDelivers", &Ip6InDelivers);
+ arl_expect(arl_ipv6, "Ip6OutForwDatagrams", &Ip6OutForwDatagrams);
+ arl_expect(arl_ipv6, "Ip6OutRequests", &Ip6OutRequests);
+ arl_expect(arl_ipv6, "Ip6OutDiscards", &Ip6OutDiscards);
+ arl_expect(arl_ipv6, "Ip6OutNoRoutes", &Ip6OutNoRoutes);
+ arl_expect(arl_ipv6, "Ip6ReasmTimeout", &Ip6ReasmTimeout);
+ arl_expect(arl_ipv6, "Ip6ReasmReqds", &Ip6ReasmReqds);
+ arl_expect(arl_ipv6, "Ip6ReasmOKs", &Ip6ReasmOKs);
+ arl_expect(arl_ipv6, "Ip6ReasmFails", &Ip6ReasmFails);
+ arl_expect(arl_ipv6, "Ip6FragOKs", &Ip6FragOKs);
+ arl_expect(arl_ipv6, "Ip6FragFails", &Ip6FragFails);
+ arl_expect(arl_ipv6, "Ip6FragCreates", &Ip6FragCreates);
+ arl_expect(arl_ipv6, "Ip6InMcastPkts", &Ip6InMcastPkts);
+ arl_expect(arl_ipv6, "Ip6OutMcastPkts", &Ip6OutMcastPkts);
+ arl_expect(arl_ipv6, "Ip6InOctets", &Ip6InOctets);
+ arl_expect(arl_ipv6, "Ip6OutOctets", &Ip6OutOctets);
+ arl_expect(arl_ipv6, "Ip6InMcastOctets", &Ip6InMcastOctets);
+ arl_expect(arl_ipv6, "Ip6OutMcastOctets", &Ip6OutMcastOctets);
+ arl_expect(arl_ipv6, "Ip6InBcastOctets", &Ip6InBcastOctets);
+ arl_expect(arl_ipv6, "Ip6OutBcastOctets", &Ip6OutBcastOctets);
+ arl_expect(arl_ipv6, "Ip6InNoECTPkts", &Ip6InNoECTPkts);
+ arl_expect(arl_ipv6, "Ip6InECT1Pkts", &Ip6InECT1Pkts);
+ arl_expect(arl_ipv6, "Ip6InECT0Pkts", &Ip6InECT0Pkts);
+ arl_expect(arl_ipv6, "Ip6InCEPkts", &Ip6InCEPkts);
+ arl_expect(arl_ipv6, "Icmp6InMsgs", &Icmp6InMsgs);
+ arl_expect(arl_ipv6, "Icmp6InErrors", &Icmp6InErrors);
+ arl_expect(arl_ipv6, "Icmp6OutMsgs", &Icmp6OutMsgs);
+ arl_expect(arl_ipv6, "Icmp6OutErrors", &Icmp6OutErrors);
+ arl_expect(arl_ipv6, "Icmp6InCsumErrors", &Icmp6InCsumErrors);
+ arl_expect(arl_ipv6, "Icmp6InDestUnreachs", &Icmp6InDestUnreachs);
+ arl_expect(arl_ipv6, "Icmp6InPktTooBigs", &Icmp6InPktTooBigs);
+ arl_expect(arl_ipv6, "Icmp6InTimeExcds", &Icmp6InTimeExcds);
+ arl_expect(arl_ipv6, "Icmp6InParmProblems", &Icmp6InParmProblems);
+ arl_expect(arl_ipv6, "Icmp6InEchos", &Icmp6InEchos);
+ arl_expect(arl_ipv6, "Icmp6InEchoReplies", &Icmp6InEchoReplies);
+ arl_expect(arl_ipv6, "Icmp6InGroupMembQueries", &Icmp6InGroupMembQueries);
+ arl_expect(arl_ipv6, "Icmp6InGroupMembResponses", &Icmp6InGroupMembResponses);
+ arl_expect(arl_ipv6, "Icmp6InGroupMembReductions", &Icmp6InGroupMembReductions);
+ arl_expect(arl_ipv6, "Icmp6InRouterSolicits", &Icmp6InRouterSolicits);
+ arl_expect(arl_ipv6, "Icmp6InRouterAdvertisements", &Icmp6InRouterAdvertisements);
+ arl_expect(arl_ipv6, "Icmp6InNeighborSolicits", &Icmp6InNeighborSolicits);
+ arl_expect(arl_ipv6, "Icmp6InNeighborAdvertisements", &Icmp6InNeighborAdvertisements);
+ arl_expect(arl_ipv6, "Icmp6InRedirects", &Icmp6InRedirects);
+ arl_expect(arl_ipv6, "Icmp6InMLDv2Reports", &Icmp6InMLDv2Reports);
+ arl_expect(arl_ipv6, "Icmp6OutDestUnreachs", &Icmp6OutDestUnreachs);
+ arl_expect(arl_ipv6, "Icmp6OutPktTooBigs", &Icmp6OutPktTooBigs);
+ arl_expect(arl_ipv6, "Icmp6OutTimeExcds", &Icmp6OutTimeExcds);
+ arl_expect(arl_ipv6, "Icmp6OutParmProblems", &Icmp6OutParmProblems);
+ arl_expect(arl_ipv6, "Icmp6OutEchos", &Icmp6OutEchos);
+ arl_expect(arl_ipv6, "Icmp6OutEchoReplies", &Icmp6OutEchoReplies);
+ arl_expect(arl_ipv6, "Icmp6OutGroupMembQueries", &Icmp6OutGroupMembQueries);
+ arl_expect(arl_ipv6, "Icmp6OutGroupMembResponses", &Icmp6OutGroupMembResponses);
+ arl_expect(arl_ipv6, "Icmp6OutGroupMembReductions", &Icmp6OutGroupMembReductions);
+ arl_expect(arl_ipv6, "Icmp6OutRouterSolicits", &Icmp6OutRouterSolicits);
+ arl_expect(arl_ipv6, "Icmp6OutRouterAdvertisements", &Icmp6OutRouterAdvertisements);
+ arl_expect(arl_ipv6, "Icmp6OutNeighborSolicits", &Icmp6OutNeighborSolicits);
+ arl_expect(arl_ipv6, "Icmp6OutNeighborAdvertisements", &Icmp6OutNeighborAdvertisements);
+ arl_expect(arl_ipv6, "Icmp6OutRedirects", &Icmp6OutRedirects);
+ arl_expect(arl_ipv6, "Icmp6OutMLDv2Reports", &Icmp6OutMLDv2Reports);
+ arl_expect(arl_ipv6, "Icmp6InType1", &Icmp6InType1);
+ arl_expect(arl_ipv6, "Icmp6InType128", &Icmp6InType128);
+ arl_expect(arl_ipv6, "Icmp6InType129", &Icmp6InType129);
+ arl_expect(arl_ipv6, "Icmp6InType136", &Icmp6InType136);
+ arl_expect(arl_ipv6, "Icmp6OutType1", &Icmp6OutType1);
+ arl_expect(arl_ipv6, "Icmp6OutType128", &Icmp6OutType128);
+ arl_expect(arl_ipv6, "Icmp6OutType129", &Icmp6OutType129);
+ arl_expect(arl_ipv6, "Icmp6OutType133", &Icmp6OutType133);
+ arl_expect(arl_ipv6, "Icmp6OutType135", &Icmp6OutType135);
+ arl_expect(arl_ipv6, "Icmp6OutType143", &Icmp6OutType143);
+ arl_expect(arl_ipv6, "Udp6InDatagrams", &Udp6InDatagrams);
+ arl_expect(arl_ipv6, "Udp6NoPorts", &Udp6NoPorts);
+ arl_expect(arl_ipv6, "Udp6InErrors", &Udp6InErrors);
+ arl_expect(arl_ipv6, "Udp6OutDatagrams", &Udp6OutDatagrams);
+ arl_expect(arl_ipv6, "Udp6RcvbufErrors", &Udp6RcvbufErrors);
+ arl_expect(arl_ipv6, "Udp6SndbufErrors", &Udp6SndbufErrors);
+ arl_expect(arl_ipv6, "Udp6InCsumErrors", &Udp6InCsumErrors);
+ arl_expect(arl_ipv6, "Udp6IgnoredMulti", &Udp6IgnoredMulti);
+ arl_expect(arl_ipv6, "UdpLite6InDatagrams", &UdpLite6InDatagrams);
+ arl_expect(arl_ipv6, "UdpLite6NoPorts", &UdpLite6NoPorts);
+ arl_expect(arl_ipv6, "UdpLite6InErrors", &UdpLite6InErrors);
+ arl_expect(arl_ipv6, "UdpLite6OutDatagrams", &UdpLite6OutDatagrams);
+ arl_expect(arl_ipv6, "UdpLite6RcvbufErrors", &UdpLite6RcvbufErrors);
+ arl_expect(arl_ipv6, "UdpLite6SndbufErrors", &UdpLite6SndbufErrors);
+ arl_expect(arl_ipv6, "UdpLite6InCsumErrors", &UdpLite6InCsumErrors);
+ }
+
+ // parse /proc/net/snmp
+
+ if (unlikely(!ff_snmp6)) {
+ char filename[FILENAME_MAX + 1];
+ snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/net/snmp6");
+ ff_snmp6 = procfile_open(
+ config_get("plugin:proc:/proc/net/snmp6", "filename to monitor", filename), " \t:", PROCFILE_FLAG_DEFAULT);
+ if (unlikely(!ff_snmp6)) {
+ do_snmp6 = false;
+ return;
+ }
+ }
+
+ ff_snmp6 = procfile_readall(ff_snmp6);
+ if (unlikely(!ff_snmp6))
+ return;
+
+ size_t lines, l;
+
+ lines = procfile_lines(ff_snmp6);
+
+ arl_begin(arl_ipv6);
+
+ for (l = 0; l < lines; l++) {
+ size_t words = procfile_linewords(ff_snmp6, l);
+ if (unlikely(words < 2)) {
+ if (unlikely(words)) {
+ collector_error("Cannot read /proc/net/snmp6 line %zu. Expected 2 params, read %zu.", l, words);
+ continue;
+ }
+ }
+
+ if (unlikely(arl_check(arl_ipv6, procfile_lineword(ff_snmp6, l, 0), procfile_lineword(ff_snmp6, l, 1))))
+ break;
+ }
+
+ if(do_ip6_bandwidth == CONFIG_BOOLEAN_YES || (do_ip6_bandwidth == CONFIG_BOOLEAN_AUTO &&
+ (Ip6InOctets ||
+ Ip6OutOctets ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_bandwidth = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_received = NULL,
+ *rd_sent = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ "system"
+ , "ipv6"
+ , NULL
+ , "network"
+ , NULL
+ , "IPv6 Bandwidth"
+ , "kilobits/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_SYSTEM_IPV6
+ , update_every
+ , RRDSET_TYPE_AREA
+ );
+
+ rd_received = rrddim_add(st, "InOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
+ rd_sent = rrddim_add(st, "OutOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_received, Ip6InOctets);
+ rrddim_set_by_pointer(st, rd_sent, Ip6OutOctets);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_packets == CONFIG_BOOLEAN_YES || (do_ip6_packets == CONFIG_BOOLEAN_AUTO &&
+ (Ip6InReceives ||
+ Ip6OutRequests ||
+ Ip6InDelivers ||
+ Ip6OutForwDatagrams ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_packets = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_received = NULL,
+ *rd_sent = NULL,
+ *rd_forwarded = NULL,
+ *rd_delivers = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "packets"
+ , NULL
+ , "packets"
+ , NULL
+ , "IPv6 Packets"
+ , "packets/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_PACKETS
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ rd_received = rrddim_add(st, "InReceives", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_sent = rrddim_add(st, "OutRequests", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_forwarded = rrddim_add(st, "OutForwDatagrams", "forwarded", -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_delivers = rrddim_add(st, "InDelivers", "delivers", 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_received, Ip6InReceives);
+ rrddim_set_by_pointer(st, rd_sent, Ip6OutRequests);
+ rrddim_set_by_pointer(st, rd_forwarded, Ip6OutForwDatagrams);
+ rrddim_set_by_pointer(st, rd_delivers, Ip6InDelivers);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_fragsout == CONFIG_BOOLEAN_YES || (do_ip6_fragsout == CONFIG_BOOLEAN_AUTO &&
+ (Ip6FragOKs ||
+ Ip6FragFails ||
+ Ip6FragCreates ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_fragsout = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_ok = NULL,
+ *rd_failed = NULL,
+ *rd_all = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "fragsout"
+ , NULL
+ , "fragments6"
+ , NULL
+ , "IPv6 Fragments Sent"
+ , "packets/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_FRAGSOUT
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+ rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
+
+ rd_ok = rrddim_add(st, "FragOKs", "ok", 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_failed = rrddim_add(st, "FragFails", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_all = rrddim_add(st, "FragCreates", "all", 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_ok, Ip6FragOKs);
+ rrddim_set_by_pointer(st, rd_failed, Ip6FragFails);
+ rrddim_set_by_pointer(st, rd_all, Ip6FragCreates);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_fragsin == CONFIG_BOOLEAN_YES || (do_ip6_fragsin == CONFIG_BOOLEAN_AUTO &&
+ (Ip6ReasmOKs ||
+ Ip6ReasmFails ||
+ Ip6ReasmTimeout ||
+ Ip6ReasmReqds ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_fragsin = CONFIG_BOOLEAN_YES;
+
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_ok = NULL,
+ *rd_failed = NULL,
+ *rd_timeout = NULL,
+ *rd_all = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "fragsin"
+ , NULL
+ , "fragments6"
+ , NULL
+ , "IPv6 Fragments Reassembly"
+ , "packets/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_FRAGSIN
+ , update_every
+ , RRDSET_TYPE_LINE);
+ rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
+
+ rd_ok = rrddim_add(st, "ReasmOKs", "ok", 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_failed = rrddim_add(st, "ReasmFails", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_timeout = rrddim_add(st, "ReasmTimeout", "timeout", -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_all = rrddim_add(st, "ReasmReqds", "all", 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_ok, Ip6ReasmOKs);
+ rrddim_set_by_pointer(st, rd_failed, Ip6ReasmFails);
+ rrddim_set_by_pointer(st, rd_timeout, Ip6ReasmTimeout);
+ rrddim_set_by_pointer(st, rd_all, Ip6ReasmReqds);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_errors == CONFIG_BOOLEAN_YES || (do_ip6_errors == CONFIG_BOOLEAN_AUTO &&
+ (Ip6InDiscards ||
+ Ip6OutDiscards ||
+ Ip6InHdrErrors ||
+ Ip6InAddrErrors ||
+ Ip6InUnknownProtos ||
+ Ip6InTooBigErrors ||
+ Ip6InTruncatedPkts ||
+ Ip6InNoRoutes ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_errors = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_InDiscards = NULL,
+ *rd_OutDiscards = NULL,
+ *rd_InHdrErrors = NULL,
+ *rd_InAddrErrors = NULL,
+ *rd_InUnknownProtos = NULL,
+ *rd_InTooBigErrors = NULL,
+ *rd_InTruncatedPkts = NULL,
+ *rd_InNoRoutes = NULL,
+ *rd_OutNoRoutes = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "errors"
+ , NULL
+ , "errors"
+ , NULL
+ , "IPv6 Errors"
+ , "packets/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_ERRORS
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+ rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
+
+ rd_InDiscards = rrddim_add(st, "InDiscards", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutDiscards = rrddim_add(st, "OutDiscards", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InHdrErrors = rrddim_add(st, "InHdrErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InAddrErrors = rrddim_add(st, "InAddrErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InUnknownProtos = rrddim_add(st, "InUnknownProtos", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InTooBigErrors = rrddim_add(st, "InTooBigErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InTruncatedPkts = rrddim_add(st, "InTruncatedPkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InNoRoutes = rrddim_add(st, "InNoRoutes", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutNoRoutes = rrddim_add(st, "OutNoRoutes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_InDiscards, Ip6InDiscards);
+ rrddim_set_by_pointer(st, rd_OutDiscards, Ip6OutDiscards);
+ rrddim_set_by_pointer(st, rd_InHdrErrors, Ip6InHdrErrors);
+ rrddim_set_by_pointer(st, rd_InAddrErrors, Ip6InAddrErrors);
+ rrddim_set_by_pointer(st, rd_InUnknownProtos, Ip6InUnknownProtos);
+ rrddim_set_by_pointer(st, rd_InTooBigErrors, Ip6InTooBigErrors);
+ rrddim_set_by_pointer(st, rd_InTruncatedPkts, Ip6InTruncatedPkts);
+ rrddim_set_by_pointer(st, rd_InNoRoutes, Ip6InNoRoutes);
+ rrddim_set_by_pointer(st, rd_OutNoRoutes, Ip6OutNoRoutes);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_udp_packets == CONFIG_BOOLEAN_YES || (do_ip6_udp_packets == CONFIG_BOOLEAN_AUTO &&
+ (Udp6InDatagrams ||
+ Udp6OutDatagrams ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_received = NULL,
+ *rd_sent = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "udppackets"
+ , NULL
+ , "udp6"
+ , NULL
+ , "IPv6 UDP Packets"
+ , "packets/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_UDP_PACKETS
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ rd_received = rrddim_add(st, "InDatagrams", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_sent = rrddim_add(st, "OutDatagrams", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_received, Udp6InDatagrams);
+ rrddim_set_by_pointer(st, rd_sent, Udp6OutDatagrams);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_udp_errors == CONFIG_BOOLEAN_YES || (do_ip6_udp_errors == CONFIG_BOOLEAN_AUTO &&
+ (Udp6InErrors ||
+ Udp6NoPorts ||
+ Udp6RcvbufErrors ||
+ Udp6SndbufErrors ||
+ Udp6InCsumErrors ||
+ Udp6IgnoredMulti ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_udp_errors = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_RcvbufErrors = NULL,
+ *rd_SndbufErrors = NULL,
+ *rd_InErrors = NULL,
+ *rd_NoPorts = NULL,
+ *rd_InCsumErrors = NULL,
+ *rd_IgnoredMulti = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "udperrors"
+ , NULL
+ , "udp6"
+ , NULL
+ , "IPv6 UDP Errors"
+ , "events/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_UDP_ERRORS
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+ rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
+
+ rd_RcvbufErrors = rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_SndbufErrors = rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_NoPorts = rrddim_add(st, "NoPorts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_IgnoredMulti = rrddim_add(st, "IgnoredMulti", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_RcvbufErrors, Udp6RcvbufErrors);
+ rrddim_set_by_pointer(st, rd_SndbufErrors, Udp6SndbufErrors);
+ rrddim_set_by_pointer(st, rd_InErrors, Udp6InErrors);
+ rrddim_set_by_pointer(st, rd_NoPorts, Udp6NoPorts);
+ rrddim_set_by_pointer(st, rd_InCsumErrors, Udp6InCsumErrors);
+ rrddim_set_by_pointer(st, rd_IgnoredMulti, Udp6IgnoredMulti);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_udplite_packets == CONFIG_BOOLEAN_YES || (do_ip6_udplite_packets == CONFIG_BOOLEAN_AUTO &&
+ (UdpLite6InDatagrams ||
+ UdpLite6OutDatagrams ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_received = NULL,
+ *rd_sent = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "udplitepackets"
+ , NULL
+ , "udplite6"
+ , NULL
+ , "IPv6 UDPlite Packets"
+ , "packets/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_UDPLITE_PACKETS
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ rd_received = rrddim_add(st, "InDatagrams", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_sent = rrddim_add(st, "OutDatagrams", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_received, UdpLite6InDatagrams);
+ rrddim_set_by_pointer(st, rd_sent, UdpLite6OutDatagrams);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_udplite_errors == CONFIG_BOOLEAN_YES || (do_ip6_udplite_errors == CONFIG_BOOLEAN_AUTO &&
+ (UdpLite6InErrors ||
+ UdpLite6NoPorts ||
+ UdpLite6RcvbufErrors ||
+ UdpLite6SndbufErrors ||
+ Udp6InCsumErrors ||
+ UdpLite6InCsumErrors ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_udplite_errors = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_RcvbufErrors = NULL,
+ *rd_SndbufErrors = NULL,
+ *rd_InErrors = NULL,
+ *rd_NoPorts = NULL,
+ *rd_InCsumErrors = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "udpliteerrors"
+ , NULL
+ , "udplite6"
+ , NULL
+ , "IPv6 UDP Lite Errors"
+ , "events/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_UDPLITE_ERRORS
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+ rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
+
+ rd_RcvbufErrors = rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_SndbufErrors = rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_NoPorts = rrddim_add(st, "NoPorts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_InErrors, UdpLite6InErrors);
+ rrddim_set_by_pointer(st, rd_NoPorts, UdpLite6NoPorts);
+ rrddim_set_by_pointer(st, rd_RcvbufErrors, UdpLite6RcvbufErrors);
+ rrddim_set_by_pointer(st, rd_SndbufErrors, UdpLite6SndbufErrors);
+ rrddim_set_by_pointer(st, rd_InCsumErrors, UdpLite6InCsumErrors);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_mcast == CONFIG_BOOLEAN_YES || (do_ip6_mcast == CONFIG_BOOLEAN_AUTO &&
+ (Ip6OutMcastOctets ||
+ Ip6InMcastOctets ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_mcast = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_Ip6InMcastOctets = NULL,
+ *rd_Ip6OutMcastOctets = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "mcast"
+ , NULL
+ , "multicast6"
+ , NULL
+ , "IPv6 Multicast Bandwidth"
+ , "kilobits/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_MCAST
+ , update_every
+ , RRDSET_TYPE_AREA
+ );
+ rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
+
+ rd_Ip6InMcastOctets = rrddim_add(st, "InMcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
+ rd_Ip6OutMcastOctets = rrddim_add(st, "OutMcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_Ip6InMcastOctets, Ip6InMcastOctets);
+ rrddim_set_by_pointer(st, rd_Ip6OutMcastOctets, Ip6OutMcastOctets);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_bcast == CONFIG_BOOLEAN_YES || (do_ip6_bcast == CONFIG_BOOLEAN_AUTO &&
+ (Ip6OutBcastOctets ||
+ Ip6InBcastOctets ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_bcast = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_Ip6InBcastOctets = NULL,
+ *rd_Ip6OutBcastOctets = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "bcast"
+ , NULL
+ , "broadcast6"
+ , NULL
+ , "IPv6 Broadcast Bandwidth"
+ , "kilobits/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_BCAST
+ , update_every
+ , RRDSET_TYPE_AREA
+ );
+ rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
+
+ rd_Ip6InBcastOctets = rrddim_add(st, "InBcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
+ rd_Ip6OutBcastOctets = rrddim_add(st, "OutBcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_Ip6InBcastOctets, Ip6InBcastOctets);
+ rrddim_set_by_pointer(st, rd_Ip6OutBcastOctets, Ip6OutBcastOctets);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_mcast_p == CONFIG_BOOLEAN_YES || (do_ip6_mcast_p == CONFIG_BOOLEAN_AUTO &&
+ (Ip6OutMcastPkts ||
+ Ip6InMcastPkts ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_mcast_p = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_Ip6InMcastPkts = NULL,
+ *rd_Ip6OutMcastPkts = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "mcastpkts"
+ , NULL
+ , "multicast6"
+ , NULL
+ , "IPv6 Multicast Packets"
+ , "packets/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_MCAST_PACKETS
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+ rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
+
+ rd_Ip6InMcastPkts = rrddim_add(st, "InMcastPkts", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_Ip6OutMcastPkts = rrddim_add(st, "OutMcastPkts", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_Ip6InMcastPkts, Ip6InMcastPkts);
+ rrddim_set_by_pointer(st, rd_Ip6OutMcastPkts, Ip6OutMcastPkts);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_icmp == CONFIG_BOOLEAN_YES || (do_ip6_icmp == CONFIG_BOOLEAN_AUTO &&
+ (Icmp6InMsgs ||
+ Icmp6OutMsgs ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_icmp = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_Icmp6InMsgs = NULL,
+ *rd_Icmp6OutMsgs = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "icmp"
+ , NULL
+ , "icmp6"
+ , NULL
+ , "IPv6 ICMP Messages"
+ , "messages/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_ICMP
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ rd_Icmp6InMsgs = rrddim_add(st, "InMsgs", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_Icmp6OutMsgs = rrddim_add(st, "OutMsgs", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_Icmp6InMsgs, Icmp6InMsgs);
+ rrddim_set_by_pointer(st, rd_Icmp6OutMsgs, Icmp6OutMsgs);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_icmp_redir == CONFIG_BOOLEAN_YES || (do_ip6_icmp_redir == CONFIG_BOOLEAN_AUTO &&
+ (Icmp6InRedirects ||
+ Icmp6OutRedirects ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_icmp_redir = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_Icmp6InRedirects = NULL,
+ *rd_Icmp6OutRedirects = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "icmpredir"
+ , NULL
+ , "icmp6"
+ , NULL
+ , "IPv6 ICMP Redirects"
+ , "redirects/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_ICMP_REDIR
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ rd_Icmp6InRedirects = rrddim_add(st, "InRedirects", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_Icmp6OutRedirects = rrddim_add(st, "OutRedirects", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_Icmp6InRedirects, Icmp6InRedirects);
+ rrddim_set_by_pointer(st, rd_Icmp6OutRedirects, Icmp6OutRedirects);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_icmp_errors == CONFIG_BOOLEAN_YES || (do_ip6_icmp_errors == CONFIG_BOOLEAN_AUTO &&
+ (Icmp6InErrors ||
+ Icmp6OutErrors ||
+ Icmp6InCsumErrors ||
+ Icmp6InDestUnreachs ||
+ Icmp6InPktTooBigs ||
+ Icmp6InTimeExcds ||
+ Icmp6InParmProblems ||
+ Icmp6OutDestUnreachs ||
+ Icmp6OutPktTooBigs ||
+ Icmp6OutTimeExcds ||
+ Icmp6OutParmProblems ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_icmp_errors = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_InErrors = NULL,
+ *rd_OutErrors = NULL,
+ *rd_InCsumErrors = NULL,
+ *rd_InDestUnreachs = NULL,
+ *rd_InPktTooBigs = NULL,
+ *rd_InTimeExcds = NULL,
+ *rd_InParmProblems = NULL,
+ *rd_OutDestUnreachs = NULL,
+ *rd_OutPktTooBigs = NULL,
+ *rd_OutTimeExcds = NULL,
+ *rd_OutParmProblems = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "icmperrors"
+ , NULL
+ , "icmp6"
+ , NULL
+ , "IPv6 ICMP Errors"
+ , "errors/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_ICMP_ERRORS
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutErrors = rrddim_add(st, "OutErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InDestUnreachs = rrddim_add(st, "InDestUnreachs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InPktTooBigs = rrddim_add(st, "InPktTooBigs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InTimeExcds = rrddim_add(st, "InTimeExcds", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InParmProblems = rrddim_add(st, "InParmProblems", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutDestUnreachs = rrddim_add(st, "OutDestUnreachs", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutPktTooBigs = rrddim_add(st, "OutPktTooBigs", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutTimeExcds = rrddim_add(st, "OutTimeExcds", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutParmProblems = rrddim_add(st, "OutParmProblems", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_InErrors, Icmp6InErrors);
+ rrddim_set_by_pointer(st, rd_OutErrors, Icmp6OutErrors);
+ rrddim_set_by_pointer(st, rd_InCsumErrors, Icmp6InCsumErrors);
+ rrddim_set_by_pointer(st, rd_InDestUnreachs, Icmp6InDestUnreachs);
+ rrddim_set_by_pointer(st, rd_InPktTooBigs, Icmp6InPktTooBigs);
+ rrddim_set_by_pointer(st, rd_InTimeExcds, Icmp6InTimeExcds);
+ rrddim_set_by_pointer(st, rd_InParmProblems, Icmp6InParmProblems);
+ rrddim_set_by_pointer(st, rd_OutDestUnreachs, Icmp6OutDestUnreachs);
+ rrddim_set_by_pointer(st, rd_OutPktTooBigs, Icmp6OutPktTooBigs);
+ rrddim_set_by_pointer(st, rd_OutTimeExcds, Icmp6OutTimeExcds);
+ rrddim_set_by_pointer(st, rd_OutParmProblems, Icmp6OutParmProblems);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_icmp_echos == CONFIG_BOOLEAN_YES || (do_ip6_icmp_echos == CONFIG_BOOLEAN_AUTO &&
+ (Icmp6InEchos ||
+ Icmp6OutEchos ||
+ Icmp6InEchoReplies ||
+ Icmp6OutEchoReplies ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_icmp_echos = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_InEchos = NULL,
+ *rd_OutEchos = NULL,
+ *rd_InEchoReplies = NULL,
+ *rd_OutEchoReplies = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "icmpechos"
+ , NULL
+ , "icmp6"
+ , NULL
+ , "IPv6 ICMP Echo"
+ , "messages/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_ICMP_ECHOS
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ rd_InEchos = rrddim_add(st, "InEchos", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutEchos = rrddim_add(st, "OutEchos", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InEchoReplies = rrddim_add(st, "InEchoReplies", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutEchoReplies = rrddim_add(st, "OutEchoReplies", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_InEchos, Icmp6InEchos);
+ rrddim_set_by_pointer(st, rd_OutEchos, Icmp6OutEchos);
+ rrddim_set_by_pointer(st, rd_InEchoReplies, Icmp6InEchoReplies);
+ rrddim_set_by_pointer(st, rd_OutEchoReplies, Icmp6OutEchoReplies);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_icmp_groupmemb == CONFIG_BOOLEAN_YES || (do_ip6_icmp_groupmemb == CONFIG_BOOLEAN_AUTO &&
+ (Icmp6InGroupMembQueries ||
+ Icmp6OutGroupMembQueries ||
+ Icmp6InGroupMembResponses ||
+ Icmp6OutGroupMembResponses ||
+ Icmp6InGroupMembReductions ||
+ Icmp6OutGroupMembReductions ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_icmp_groupmemb = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_InQueries = NULL,
+ *rd_OutQueries = NULL,
+ *rd_InResponses = NULL,
+ *rd_OutResponses = NULL,
+ *rd_InReductions = NULL,
+ *rd_OutReductions = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "groupmemb"
+ , NULL
+ , "icmp6"
+ , NULL
+ , "IPv6 ICMP Group Membership"
+ , "messages/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_ICMP_GROUPMEMB
+ , update_every
+ , RRDSET_TYPE_LINE);
+
+ rd_InQueries = rrddim_add(st, "InQueries", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutQueries = rrddim_add(st, "OutQueries", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InResponses = rrddim_add(st, "InResponses", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutResponses = rrddim_add(st, "OutResponses", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InReductions = rrddim_add(st, "InReductions", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutReductions = rrddim_add(st, "OutReductions", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_InQueries, Icmp6InGroupMembQueries);
+ rrddim_set_by_pointer(st, rd_OutQueries, Icmp6OutGroupMembQueries);
+ rrddim_set_by_pointer(st, rd_InResponses, Icmp6InGroupMembResponses);
+ rrddim_set_by_pointer(st, rd_OutResponses, Icmp6OutGroupMembResponses);
+ rrddim_set_by_pointer(st, rd_InReductions, Icmp6InGroupMembReductions);
+ rrddim_set_by_pointer(st, rd_OutReductions, Icmp6OutGroupMembReductions);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_icmp_router == CONFIG_BOOLEAN_YES || (do_ip6_icmp_router == CONFIG_BOOLEAN_AUTO &&
+ (Icmp6InRouterSolicits ||
+ Icmp6OutRouterSolicits ||
+ Icmp6InRouterAdvertisements ||
+ Icmp6OutRouterAdvertisements ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_icmp_router = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_InSolicits = NULL,
+ *rd_OutSolicits = NULL,
+ *rd_InAdvertisements = NULL,
+ *rd_OutAdvertisements = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "icmprouter"
+ , NULL
+ , "icmp6"
+ , NULL
+ , "IPv6 Router Messages"
+ , "messages/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_ICMP_ROUTER
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ rd_InSolicits = rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutSolicits = rrddim_add(st, "OutSolicits", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InAdvertisements = rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutAdvertisements = rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_InSolicits, Icmp6InRouterSolicits);
+ rrddim_set_by_pointer(st, rd_OutSolicits, Icmp6OutRouterSolicits);
+ rrddim_set_by_pointer(st, rd_InAdvertisements, Icmp6InRouterAdvertisements);
+ rrddim_set_by_pointer(st, rd_OutAdvertisements, Icmp6OutRouterAdvertisements);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_icmp_neighbor == CONFIG_BOOLEAN_YES || (do_ip6_icmp_neighbor == CONFIG_BOOLEAN_AUTO &&
+ (Icmp6InNeighborSolicits ||
+ Icmp6OutNeighborSolicits ||
+ Icmp6InNeighborAdvertisements ||
+ Icmp6OutNeighborAdvertisements ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_icmp_neighbor = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_InSolicits = NULL,
+ *rd_OutSolicits = NULL,
+ *rd_InAdvertisements = NULL,
+ *rd_OutAdvertisements = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "icmpneighbor"
+ , NULL
+ , "icmp6"
+ , NULL
+ , "IPv6 Neighbor Messages"
+ , "messages/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_ICMP_NEIGHBOR
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ rd_InSolicits = rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutSolicits = rrddim_add(st, "OutSolicits", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InAdvertisements = rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutAdvertisements = rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_InSolicits, Icmp6InNeighborSolicits);
+ rrddim_set_by_pointer(st, rd_OutSolicits, Icmp6OutNeighborSolicits);
+ rrddim_set_by_pointer(st, rd_InAdvertisements, Icmp6InNeighborAdvertisements);
+ rrddim_set_by_pointer(st, rd_OutAdvertisements, Icmp6OutNeighborAdvertisements);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_icmp_mldv2 == CONFIG_BOOLEAN_YES || (do_ip6_icmp_mldv2 == CONFIG_BOOLEAN_AUTO &&
+ (Icmp6InMLDv2Reports ||
+ Icmp6OutMLDv2Reports ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_icmp_mldv2 = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_InMLDv2Reports = NULL,
+ *rd_OutMLDv2Reports = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "icmpmldv2"
+ , NULL
+ , "icmp6"
+ , NULL
+ , "IPv6 ICMP MLDv2 Reports"
+ , "reports/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_ICMP_LDV2
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ rd_InMLDv2Reports = rrddim_add(st, "InMLDv2Reports", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutMLDv2Reports = rrddim_add(st, "OutMLDv2Reports", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_InMLDv2Reports, Icmp6InMLDv2Reports);
+ rrddim_set_by_pointer(st, rd_OutMLDv2Reports, Icmp6OutMLDv2Reports);
+ rrdset_done(st);
+ }
+
+ if(do_ip6_icmp_types == CONFIG_BOOLEAN_YES || (do_ip6_icmp_types == CONFIG_BOOLEAN_AUTO &&
+ (Icmp6InType1 ||
+ Icmp6InType128 ||
+ Icmp6InType129 ||
+ Icmp6InType136 ||
+ Icmp6OutType1 ||
+ Icmp6OutType128 ||
+ Icmp6OutType129 ||
+ Icmp6OutType133 ||
+ Icmp6OutType135 ||
+ Icmp6OutType143 ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_icmp_types = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_InType1 = NULL,
+ *rd_InType128 = NULL,
+ *rd_InType129 = NULL,
+ *rd_InType136 = NULL,
+ *rd_OutType1 = NULL,
+ *rd_OutType128 = NULL,
+ *rd_OutType129 = NULL,
+ *rd_OutType133 = NULL,
+ *rd_OutType135 = NULL,
+ *rd_OutType143 = NULL;
+
+ if(unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6
+ , "icmptypes"
+ , NULL
+ , "icmp6"
+ , NULL
+ , "IPv6 ICMP Types"
+ , "messages/s"
+ , PLUGIN_PROC_NAME
+ , PLUGIN_PROC_MODULE_NETSTAT_NAME
+ , NETDATA_CHART_PRIO_IPV6_ICMP_TYPES
+ , update_every
+ , RRDSET_TYPE_LINE
+ );
+
+ rd_InType1 = rrddim_add(st, "InType1", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InType128 = rrddim_add(st, "InType128", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InType129 = rrddim_add(st, "InType129", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InType136 = rrddim_add(st, "InType136", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutType1 = rrddim_add(st, "OutType1", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutType128 = rrddim_add(st, "OutType128", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutType129 = rrddim_add(st, "OutType129", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutType133 = rrddim_add(st, "OutType133", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutType135 = rrddim_add(st, "OutType135", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_OutType143 = rrddim_add(st, "OutType143", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_InType1, Icmp6InType1);
+ rrddim_set_by_pointer(st, rd_InType128, Icmp6InType128);
+ rrddim_set_by_pointer(st, rd_InType129, Icmp6InType129);
+ rrddim_set_by_pointer(st, rd_InType136, Icmp6InType136);
+ rrddim_set_by_pointer(st, rd_OutType1, Icmp6OutType1);
+ rrddim_set_by_pointer(st, rd_OutType128, Icmp6OutType128);
+ rrddim_set_by_pointer(st, rd_OutType129, Icmp6OutType129);
+ rrddim_set_by_pointer(st, rd_OutType133, Icmp6OutType133);
+ rrddim_set_by_pointer(st, rd_OutType135, Icmp6OutType135);
+ rrddim_set_by_pointer(st, rd_OutType143, Icmp6OutType143);
+ rrdset_done(st);
+ }
+
+ if (do_ip6_ect == CONFIG_BOOLEAN_YES ||
+ (do_ip6_ect == CONFIG_BOOLEAN_AUTO && (Ip6InNoECTPkts || Ip6InECT1Pkts || Ip6InECT0Pkts || Ip6InCEPkts ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
+ do_ip6_ect = CONFIG_BOOLEAN_YES;
+ static RRDSET *st = NULL;
+ static RRDDIM *rd_InNoECTPkts = NULL, *rd_InECT1Pkts = NULL, *rd_InECT0Pkts = NULL, *rd_InCEPkts = NULL;
+
+ if (unlikely(!st)) {
+ st = rrdset_create_localhost(
+ RRD_TYPE_NET_SNMP6,
+ "ect",
+ NULL,
+ "packets",
+ NULL,
+ "IPv6 ECT Packets",
+ "packets/s",
+ PLUGIN_PROC_NAME,
+ PLUGIN_PROC_MODULE_NETSTAT_NAME,
+ NETDATA_CHART_PRIO_IPV6_ECT,
+ update_every,
+ RRDSET_TYPE_LINE);
+
+ rd_InNoECTPkts = rrddim_add(st, "InNoECTPkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InECT1Pkts = rrddim_add(st, "InECT1Pkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InECT0Pkts = rrddim_add(st, "InECT0Pkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ rd_InCEPkts = rrddim_add(st, "InCEPkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+ }
+
+ rrddim_set_by_pointer(st, rd_InNoECTPkts, Ip6InNoECTPkts);
+ rrddim_set_by_pointer(st, rd_InECT1Pkts, Ip6InECT1Pkts);
+ rrddim_set_by_pointer(st, rd_InECT0Pkts, Ip6InECT0Pkts);
+ rrddim_set_by_pointer(st, rd_InCEPkts, Ip6InCEPkts);
+ rrdset_done(st);
+ }
+}
+
+int do_proc_net_netstat(int update_every, usec_t dt) {
+ (void)dt;
+
+ static int do_bandwidth = -1, do_inerrors = -1, do_mcast = -1, do_bcast = -1, do_mcast_p = -1, do_bcast_p = -1, do_ecn = -1, \
+ do_tcpext_reorder = -1, do_tcpext_syscookies = -1, do_tcpext_ofo = -1, do_tcpext_connaborts = -1, do_tcpext_memory = -1,
+ do_tcpext_syn_queue = -1, do_tcpext_accept_queue = -1;
+
+ static int do_ip_packets = -1, do_ip_fragsout = -1, do_ip_fragsin = -1, do_ip_errors = -1,
+ do_tcp_sockets = -1, do_tcp_packets = -1, do_tcp_errors = -1, do_tcp_handshake = -1, do_tcp_opens = -1,
+ do_udp_packets = -1, do_udp_errors = -1, do_icmp_packets = -1, do_icmpmsg = -1, do_udplite_packets = -1;
+
+ static uint32_t hash_ipext = 0, hash_tcpext = 0;
+ static uint32_t hash_ip = 0, hash_icmp = 0, hash_tcp = 0, hash_udp = 0, hash_icmpmsg = 0, hash_udplite = 0;
+
+ static procfile *ff_netstat = NULL;
+ static procfile *ff_snmp = NULL;
+
+ static ARL_BASE *arl_tcpext = NULL;
+ static ARL_BASE *arl_ipext = NULL;
+
+ static ARL_BASE *arl_ip = NULL;
+ static ARL_BASE *arl_icmp = NULL;
+ static ARL_BASE *arl_icmpmsg = NULL;
+ static ARL_BASE *arl_tcp = NULL;
+ static ARL_BASE *arl_udp = NULL;
+ static ARL_BASE *arl_udplite = NULL;
+
+ static const RRDVAR_ACQUIRED *tcp_max_connections_var = NULL;
+
+ // --------------------------------------------------------------------
+ // IP
+
+ // IP bandwidth
+ static unsigned long long ipext_InOctets = 0;
+ static unsigned long long ipext_OutOctets = 0;
+
+ // IP input errors
+ static unsigned long long ipext_InNoRoutes = 0;
+ static unsigned long long ipext_InTruncatedPkts = 0;
+ static unsigned long long ipext_InCsumErrors = 0;
+
+ // IP multicast bandwidth
+ static unsigned long long ipext_InMcastOctets = 0;
+ static unsigned long long ipext_OutMcastOctets = 0;
+
+ // IP multicast packets
+ static unsigned long long ipext_InMcastPkts = 0;
+ static unsigned long long ipext_OutMcastPkts = 0;
+
+ // IP broadcast bandwidth
+ static unsigned long long ipext_InBcastOctets = 0;
+ static unsigned long long ipext_OutBcastOctets = 0;
+
+ // IP broadcast packets
+ static unsigned long long ipext_InBcastPkts = 0;
+ static unsigned long long ipext_OutBcastPkts = 0;
+
+ // IP ECN
+ static unsigned long long ipext_InNoECTPkts = 0;
+ static unsigned long long ipext_InECT1Pkts = 0;
+ static unsigned long long ipext_InECT0Pkts = 0;
+ static unsigned long long ipext_InCEPkts = 0;
+
+ // --------------------------------------------------------------------
+ // IP TCP
+
+ // IP TCP Reordering
+ static unsigned long long tcpext_TCPRenoReorder = 0;
+ static unsigned long long tcpext_TCPFACKReorder = 0;
+ static unsigned long long tcpext_TCPSACKReorder = 0;
+ static unsigned long long tcpext_TCPTSReorder = 0;
+
+ // IP TCP SYN Cookies
+ static unsigned long long tcpext_SyncookiesSent = 0;
+ static unsigned long long tcpext_SyncookiesRecv = 0;
+ static unsigned long long tcpext_SyncookiesFailed = 0;
+
+ // IP TCP Out Of Order Queue
+ // http://www.spinics.net/lists/netdev/msg204696.html
+ static unsigned long long tcpext_TCPOFOQueue = 0; // Number of packets queued in OFO queue
+ static unsigned long long tcpext_TCPOFODrop = 0; // Number of packets meant to be queued in OFO but dropped because socket rcvbuf limit hit.
+ static unsigned long long tcpext_TCPOFOMerge = 0; // Number of packets in OFO that were merged with other packets.
+ static unsigned long long tcpext_OfoPruned = 0; // packets dropped from out-of-order queue because of socket buffer overrun
+
+ // IP TCP connection resets
+ // https://github.com/ecki/net-tools/blob/bd8bceaed2311651710331a7f8990c3e31be9840/statistics.c
+ static unsigned long long tcpext_TCPAbortOnData = 0; // connections reset due to unexpected data
+ static unsigned long long tcpext_TCPAbortOnClose = 0; // connections reset due to early user close
+ static unsigned long long tcpext_TCPAbortOnMemory = 0; // connections aborted due to memory pressure
+ static unsigned long long tcpext_TCPAbortOnTimeout = 0; // connections aborted due to timeout
+ static unsigned long long tcpext_TCPAbortOnLinger = 0; // connections aborted after user close in linger timeout
+ static unsigned long long tcpext_TCPAbortFailed = 0; // times unable to send RST due to no memory
+
+ // https://perfchron.com/2015/12/26/investigating-linux-network-issues-with-netstat-and-nstat/
+ static unsigned long long tcpext_ListenOverflows = 0; // times the listen queue of a socket overflowed
+ static unsigned long long tcpext_ListenDrops = 0; // SYNs to LISTEN sockets ignored
+
+ // IP TCP memory pressures
+ static unsigned long long tcpext_TCPMemoryPressures = 0;
+
+ static unsigned long long tcpext_TCPReqQFullDrop = 0;
+ static unsigned long long tcpext_TCPReqQFullDoCookies = 0;
+
+ static unsigned long long tcpext_TCPSynRetrans = 0;
+
// prepare for /proc/net/netstat parsing
if(unlikely(!arl_ipext)) {
@@ -547,127 +1650,6 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
tcp_max_connections_var = rrdvar_custom_host_variable_add_and_acquire(localhost, "tcp_max_connections");
}
- // prepare for /proc/net/snmp6 parsing
-
- if(unlikely(!arl_ipv6)) {
- do_ip6_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 packets", CONFIG_BOOLEAN_AUTO);
- do_ip6_fragsout = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments sent", CONFIG_BOOLEAN_AUTO);
- do_ip6_fragsin = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments assembly", CONFIG_BOOLEAN_AUTO);
- do_ip6_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 errors", CONFIG_BOOLEAN_AUTO);
- do_ip6_udp_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP packets", CONFIG_BOOLEAN_AUTO);
- do_ip6_udp_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP errors", CONFIG_BOOLEAN_AUTO);
- do_ip6_udplite_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite packets", CONFIG_BOOLEAN_AUTO);
- do_ip6_udplite_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite errors", CONFIG_BOOLEAN_AUTO);
- do_ip6_bandwidth = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "bandwidth", CONFIG_BOOLEAN_AUTO);
- do_ip6_mcast = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast bandwidth", CONFIG_BOOLEAN_AUTO);
- do_ip6_bcast = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "broadcast bandwidth", CONFIG_BOOLEAN_AUTO);
- do_ip6_mcast_p = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast packets", CONFIG_BOOLEAN_AUTO);
- do_ip6_icmp = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp", CONFIG_BOOLEAN_AUTO);
- do_ip6_icmp_redir = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp redirects", CONFIG_BOOLEAN_AUTO);
- do_ip6_icmp_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp errors", CONFIG_BOOLEAN_AUTO);
- do_ip6_icmp_echos = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp echos", CONFIG_BOOLEAN_AUTO);
- do_ip6_icmp_groupmemb = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp group membership", CONFIG_BOOLEAN_AUTO);
- do_ip6_icmp_router = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp router", CONFIG_BOOLEAN_AUTO);
- do_ip6_icmp_neighbor = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp neighbor", CONFIG_BOOLEAN_AUTO);
- do_ip6_icmp_mldv2 = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp mldv2", CONFIG_BOOLEAN_AUTO);
- do_ip6_icmp_types = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp types", CONFIG_BOOLEAN_AUTO);
- do_ip6_ect = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ect", CONFIG_BOOLEAN_AUTO);
-
- arl_ipv6 = arl_create("snmp6", NULL, 60);
- arl_expect(arl_ipv6, "Ip6InReceives", &Ip6InReceives);
- arl_expect(arl_ipv6, "Ip6InHdrErrors", &Ip6InHdrErrors);
- arl_expect(arl_ipv6, "Ip6InTooBigErrors", &Ip6InTooBigErrors);
- arl_expect(arl_ipv6, "Ip6InNoRoutes", &Ip6InNoRoutes);
- arl_expect(arl_ipv6, "Ip6InAddrErrors", &Ip6InAddrErrors);
- arl_expect(arl_ipv6, "Ip6InUnknownProtos", &Ip6InUnknownProtos);
- arl_expect(arl_ipv6, "Ip6InTruncatedPkts", &Ip6InTruncatedPkts);
- arl_expect(arl_ipv6, "Ip6InDiscards", &Ip6InDiscards);
- arl_expect(arl_ipv6, "Ip6InDelivers", &Ip6InDelivers);
- arl_expect(arl_ipv6, "Ip6OutForwDatagrams", &Ip6OutForwDatagrams);
- arl_expect(arl_ipv6, "Ip6OutRequests", &Ip6OutRequests);
- arl_expect(arl_ipv6, "Ip6OutDiscards", &Ip6OutDiscards);
- arl_expect(arl_ipv6, "Ip6OutNoRoutes", &Ip6OutNoRoutes);
- arl_expect(arl_ipv6, "Ip6ReasmTimeout", &Ip6ReasmTimeout);
- arl_expect(arl_ipv6, "Ip6ReasmReqds", &Ip6ReasmReqds);
- arl_expect(arl_ipv6, "Ip6ReasmOKs", &Ip6ReasmOKs);
- arl_expect(arl_ipv6, "Ip6ReasmFails", &Ip6ReasmFails);
- arl_expect(arl_ipv6, "Ip6FragOKs", &Ip6FragOKs);
- arl_expect(arl_ipv6, "Ip6FragFails", &Ip6FragFails);
- arl_expect(arl_ipv6, "Ip6FragCreates", &Ip6FragCreates);
- arl_expect(arl_ipv6, "Ip6InMcastPkts", &Ip6InMcastPkts);
- arl_expect(arl_ipv6, "Ip6OutMcastPkts", &Ip6OutMcastPkts);
- arl_expect(arl_ipv6, "Ip6InOctets", &Ip6InOctets);
- arl_expect(arl_ipv6, "Ip6OutOctets", &Ip6OutOctets);
- arl_expect(arl_ipv6, "Ip6InMcastOctets", &Ip6InMcastOctets);
- arl_expect(arl_ipv6, "Ip6OutMcastOctets", &Ip6OutMcastOctets);
- arl_expect(arl_ipv6, "Ip6InBcastOctets", &Ip6InBcastOctets);
- arl_expect(arl_ipv6, "Ip6OutBcastOctets", &Ip6OutBcastOctets);
- arl_expect(arl_ipv6, "Ip6InNoECTPkts", &Ip6InNoECTPkts);
- arl_expect(arl_ipv6, "Ip6InECT1Pkts", &Ip6InECT1Pkts);
- arl_expect(arl_ipv6, "Ip6InECT0Pkts", &Ip6InECT0Pkts);
- arl_expect(arl_ipv6, "Ip6InCEPkts", &Ip6InCEPkts);
- arl_expect(arl_ipv6, "Icmp6InMsgs", &Icmp6InMsgs);
- arl_expect(arl_ipv6, "Icmp6InErrors", &Icmp6InErrors);
- arl_expect(arl_ipv6, "Icmp6OutMsgs", &Icmp6OutMsgs);
- arl_expect(arl_ipv6, "Icmp6OutErrors", &Icmp6OutErrors);
- arl_expect(arl_ipv6, "Icmp6InCsumErrors", &Icmp6InCsumErrors);
- arl_expect(arl_ipv6, "Icmp6InDestUnreachs", &Icmp6InDestUnreachs);
- arl_expect(arl_ipv6, "Icmp6InPktTooBigs", &Icmp6InPktTooBigs);
- arl_expect(arl_ipv6, "Icmp6InTimeExcds", &Icmp6InTimeExcds);
- arl_expect(arl_ipv6, "Icmp6InParmProblems", &Icmp6InParmProblems);
- arl_expect(arl_ipv6, "Icmp6InEchos", &Icmp6InEchos);
- arl_expect(arl_ipv6, "Icmp6InEchoReplies", &Icmp6InEchoReplies);
- arl_expect(arl_ipv6, "Icmp6InGroupMembQueries", &Icmp6InGroupMembQueries);
- arl_expect(arl_ipv6, "Icmp6InGroupMembResponses", &Icmp6InGroupMembResponses);
- arl_expect(arl_ipv6, "Icmp6InGroupMembReductions", &Icmp6InGroupMembReductions);
- arl_expect(arl_ipv6, "Icmp6InRouterSolicits", &Icmp6InRouterSolicits);
- arl_expect(arl_ipv6, "Icmp6InRouterAdvertisements", &Icmp6InRouterAdvertisements);
- arl_expect(arl_ipv6, "Icmp6InNeighborSolicits", &Icmp6InNeighborSolicits);
- arl_expect(arl_ipv6, "Icmp6InNeighborAdvertisements", &Icmp6InNeighborAdvertisements);
- arl_expect(arl_ipv6, "Icmp6InRedirects", &Icmp6InRedirects);
- arl_expect(arl_ipv6, "Icmp6InMLDv2Reports", &Icmp6InMLDv2Reports);
- arl_expect(arl_ipv6, "Icmp6OutDestUnreachs", &Icmp6OutDestUnreachs);
- arl_expect(arl_ipv6, "Icmp6OutPktTooBigs", &Icmp6OutPktTooBigs);
- arl_expect(arl_ipv6, "Icmp6OutTimeExcds", &Icmp6OutTimeExcds);
- arl_expect(arl_ipv6, "Icmp6OutParmProblems", &Icmp6OutParmProblems);
- arl_expect(arl_ipv6, "Icmp6OutEchos", &Icmp6OutEchos);
- arl_expect(arl_ipv6, "Icmp6OutEchoReplies", &Icmp6OutEchoReplies);
- arl_expect(arl_ipv6, "Icmp6OutGroupMembQueries", &Icmp6OutGroupMembQueries);
- arl_expect(arl_ipv6, "Icmp6OutGroupMembResponses", &Icmp6OutGroupMembResponses);
- arl_expect(arl_ipv6, "Icmp6OutGroupMembReductions", &Icmp6OutGroupMembReductions);
- arl_expect(arl_ipv6, "Icmp6OutRouterSolicits", &Icmp6OutRouterSolicits);
- arl_expect(arl_ipv6, "Icmp6OutRouterAdvertisements", &Icmp6OutRouterAdvertisements);
- arl_expect(arl_ipv6, "Icmp6OutNeighborSolicits", &Icmp6OutNeighborSolicits);
- arl_expect(arl_ipv6, "Icmp6OutNeighborAdvertisements", &Icmp6OutNeighborAdvertisements);
- arl_expect(arl_ipv6, "Icmp6OutRedirects", &Icmp6OutRedirects);
- arl_expect(arl_ipv6, "Icmp6OutMLDv2Reports", &Icmp6OutMLDv2Reports);
- arl_expect(arl_ipv6, "Icmp6InType1", &Icmp6InType1);
- arl_expect(arl_ipv6, "Icmp6InType128", &Icmp6InType128);
- arl_expect(arl_ipv6, "Icmp6InType129", &Icmp6InType129);
- arl_expect(arl_ipv6, "Icmp6InType136", &Icmp6InType136);
- arl_expect(arl_ipv6, "Icmp6OutType1", &Icmp6OutType1);
- arl_expect(arl_ipv6, "Icmp6OutType128", &Icmp6OutType128);
- arl_expect(arl_ipv6, "Icmp6OutType129", &Icmp6OutType129);
- arl_expect(arl_ipv6, "Icmp6OutType133", &Icmp6OutType133);
- arl_expect(arl_ipv6, "Icmp6OutType135", &Icmp6OutType135);
- arl_expect(arl_ipv6, "Icmp6OutType143", &Icmp6OutType143);
- arl_expect(arl_ipv6, "Udp6InDatagrams", &Udp6InDatagrams);
- arl_expect(arl_ipv6, "Udp6NoPorts", &Udp6NoPorts);
- arl_expect(arl_ipv6, "Udp6InErrors", &Udp6InErrors);
- arl_expect(arl_ipv6, "Udp6OutDatagrams", &Udp6OutDatagrams);
- arl_expect(arl_ipv6, "Udp6RcvbufErrors", &Udp6RcvbufErrors);
- arl_expect(arl_ipv6, "Udp6SndbufErrors", &Udp6SndbufErrors);
- arl_expect(arl_ipv6, "Udp6InCsumErrors", &Udp6InCsumErrors);
- arl_expect(arl_ipv6, "Udp6IgnoredMulti", &Udp6IgnoredMulti);
- arl_expect(arl_ipv6, "UdpLite6InDatagrams", &UdpLite6InDatagrams);
- arl_expect(arl_ipv6, "UdpLite6NoPorts", &UdpLite6NoPorts);
- arl_expect(arl_ipv6, "UdpLite6InErrors", &UdpLite6InErrors);
- arl_expect(arl_ipv6, "UdpLite6OutDatagrams", &UdpLite6OutDatagrams);
- arl_expect(arl_ipv6, "UdpLite6RcvbufErrors", &UdpLite6RcvbufErrors);
- arl_expect(arl_ipv6, "UdpLite6SndbufErrors", &UdpLite6SndbufErrors);
- arl_expect(arl_ipv6, "UdpLite6InCsumErrors", &UdpLite6InCsumErrors);
- }
-
size_t lines, l, words;
// parse /proc/net/netstat
@@ -696,7 +1678,7 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
words = procfile_linewords(ff_netstat, l);
if(unlikely(words < 2)) {
- error("Cannot read /proc/net/netstat IpExt line. Expected 2+ params, read %zu.", words);
+ collector_error("Cannot read /proc/net/netstat IpExt line. Expected 2+ params, read %zu.", words);
continue;
}
@@ -708,7 +1690,7 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
words = procfile_linewords(ff_netstat, l);
if(unlikely(words < 2)) {
- error("Cannot read /proc/net/netstat TcpExt line. Expected 2+ params, read %zu.", words);
+ collector_error("Cannot read /proc/net/netstat TcpExt line. Expected 2+ params, read %zu.", words);
continue;
}
@@ -739,13 +1721,13 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
size_t h = l++;
if(strcmp(procfile_lineword(ff_snmp, l, 0), "Ip") != 0) {
- error("Cannot read Ip line from /proc/net/snmp.");
+ collector_error("Cannot read Ip line from /proc/net/snmp.");
break;
}
words = procfile_linewords(ff_snmp, l);
if(words < 3) {
- error("Cannot read /proc/net/snmp Ip line. Expected 3+ params, read %zu.", words);
+ collector_error("Cannot read /proc/net/snmp Ip line. Expected 3+ params, read %zu.", words);
continue;
}
@@ -759,13 +1741,13 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
size_t h = l++;
if(strcmp(procfile_lineword(ff_snmp, l, 0), "Icmp") != 0) {
- error("Cannot read Icmp line from /proc/net/snmp.");
+ collector_error("Cannot read Icmp line from /proc/net/snmp.");
break;
}
words = procfile_linewords(ff_snmp, l);
if(words < 3) {
- error("Cannot read /proc/net/snmp Icmp line. Expected 3+ params, read %zu.", words);
+ collector_error("Cannot read /proc/net/snmp Icmp line. Expected 3+ params, read %zu.", words);
continue;
}
@@ -779,13 +1761,13 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
size_t h = l++;
if(strcmp(procfile_lineword(ff_snmp, l, 0), "IcmpMsg") != 0) {
- error("Cannot read IcmpMsg line from /proc/net/snmp.");
+ collector_error("Cannot read IcmpMsg line from /proc/net/snmp.");
break;
}
words = procfile_linewords(ff_snmp, l);
if(words < 2) {
- error("Cannot read /proc/net/snmp IcmpMsg line. Expected 2+ params, read %zu.", words);
+ collector_error("Cannot read /proc/net/snmp IcmpMsg line. Expected 2+ params, read %zu.", words);
continue;
}
@@ -799,13 +1781,13 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
size_t h = l++;
if(strcmp(procfile_lineword(ff_snmp, l, 0), "Tcp") != 0) {
- error("Cannot read Tcp line from /proc/net/snmp.");
+ collector_error("Cannot read Tcp line from /proc/net/snmp.");
break;
}
words = procfile_linewords(ff_snmp, l);
if(words < 3) {
- error("Cannot read /proc/net/snmp Tcp line. Expected 3+ params, read %zu.", words);
+ collector_error("Cannot read /proc/net/snmp Tcp line. Expected 3+ params, read %zu.", words);
continue;
}
@@ -819,13 +1801,13 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
size_t h = l++;
if(strcmp(procfile_lineword(ff_snmp, l, 0), "Udp") != 0) {
- error("Cannot read Udp line from /proc/net/snmp.");
+ collector_error("Cannot read Udp line from /proc/net/snmp.");
break;
}
words = procfile_linewords(ff_snmp, l);
if(words < 3) {
- error("Cannot read /proc/net/snmp Udp line. Expected 3+ params, read %zu.", words);
+ collector_error("Cannot read /proc/net/snmp Udp line. Expected 3+ params, read %zu.", words);
continue;
}
@@ -839,13 +1821,13 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
size_t h = l++;
if(strcmp(procfile_lineword(ff_snmp, l, 0), "UdpLite") != 0) {
- error("Cannot read UdpLite line from /proc/net/snmp.");
+ collector_error("Cannot read UdpLite line from /proc/net/snmp.");
break;
}
words = procfile_linewords(ff_snmp, l);
if(words < 3) {
- error("Cannot read /proc/net/snmp UdpLite line. Expected 3+ params, read %zu.", words);
+ collector_error("Cannot read /proc/net/snmp UdpLite line. Expected 3+ params, read %zu.", words);
continue;
}
@@ -857,36 +1839,6 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
}
}
- // parse /proc/net/snmp
-
- if(unlikely(!ff_snmp6)) {
- char filename[FILENAME_MAX + 1];
- snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/net/snmp6");
- ff_snmp6 = procfile_open(config_get("plugin:proc:/proc/net/snmp6", "filename to monitor", filename), " \t:", PROCFILE_FLAG_DEFAULT);
- if(unlikely(!ff_snmp6))
- return 1;
- }
-
- ff_snmp6 = procfile_readall(ff_snmp6);
- if(unlikely(!ff_snmp6))
- return 0; // we return 0, so that we will retry to open it next time
-
- lines = procfile_lines(ff_snmp6);
-
- arl_begin(arl_ipv6);
-
- for(l = 0; l < lines ;l++) {
- size_t words = procfile_linewords(ff_snmp6, l);
- if(unlikely(words < 2)) {
- if(unlikely(words)) error("Cannot read /proc/net/snmp6 line %zu. Expected 2 params, read %zu.", l, words);
- continue;
- }
-
- if(unlikely(arl_check(arl_ipv6,
- procfile_lineword(ff_snmp6, l, 0),
- procfile_lineword(ff_snmp6, l, 1)))) break;
- }
-
// netstat IpExt charts
if(do_bandwidth == CONFIG_BOOLEAN_YES || (do_bandwidth == CONFIG_BOOLEAN_AUTO &&
@@ -2157,954 +3109,7 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
}
}
- // snmp6 charts
-
- if(do_ip6_bandwidth == CONFIG_BOOLEAN_YES || (do_ip6_bandwidth == CONFIG_BOOLEAN_AUTO &&
- (Ip6InOctets ||
- Ip6OutOctets ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_bandwidth = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_received = NULL,
- *rd_sent = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- "system"
- , "ipv6"
- , NULL
- , "network"
- , NULL
- , "IPv6 Bandwidth"
- , "kilobits/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_SYSTEM_IPV6
- , update_every
- , RRDSET_TYPE_AREA
- );
-
- rd_received = rrddim_add(st, "InOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
- rd_sent = rrddim_add(st, "OutOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_received, Ip6InOctets);
- rrddim_set_by_pointer(st, rd_sent, Ip6OutOctets);
- rrdset_done(st);
- }
-
- if(do_ip6_packets == CONFIG_BOOLEAN_YES || (do_ip6_packets == CONFIG_BOOLEAN_AUTO &&
- (Ip6InReceives ||
- Ip6OutRequests ||
- Ip6InDelivers ||
- Ip6OutForwDatagrams ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_packets = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_received = NULL,
- *rd_sent = NULL,
- *rd_forwarded = NULL,
- *rd_delivers = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "packets"
- , NULL
- , "packets"
- , NULL
- , "IPv6 Packets"
- , "packets/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_PACKETS
- , update_every
- , RRDSET_TYPE_LINE
- );
-
- rd_received = rrddim_add(st, "InReceives", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_sent = rrddim_add(st, "OutRequests", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_forwarded = rrddim_add(st, "OutForwDatagrams", "forwarded", -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_delivers = rrddim_add(st, "InDelivers", "delivers", 1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_received, Ip6InReceives);
- rrddim_set_by_pointer(st, rd_sent, Ip6OutRequests);
- rrddim_set_by_pointer(st, rd_forwarded, Ip6OutForwDatagrams);
- rrddim_set_by_pointer(st, rd_delivers, Ip6InDelivers);
- rrdset_done(st);
- }
-
- if(do_ip6_fragsout == CONFIG_BOOLEAN_YES || (do_ip6_fragsout == CONFIG_BOOLEAN_AUTO &&
- (Ip6FragOKs ||
- Ip6FragFails ||
- Ip6FragCreates ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_fragsout = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_ok = NULL,
- *rd_failed = NULL,
- *rd_all = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "fragsout"
- , NULL
- , "fragments6"
- , NULL
- , "IPv6 Fragments Sent"
- , "packets/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_FRAGSOUT
- , update_every
- , RRDSET_TYPE_LINE
- );
- rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
-
- rd_ok = rrddim_add(st, "FragOKs", "ok", 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_failed = rrddim_add(st, "FragFails", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_all = rrddim_add(st, "FragCreates", "all", 1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_ok, Ip6FragOKs);
- rrddim_set_by_pointer(st, rd_failed, Ip6FragFails);
- rrddim_set_by_pointer(st, rd_all, Ip6FragCreates);
- rrdset_done(st);
- }
-
- if(do_ip6_fragsin == CONFIG_BOOLEAN_YES || (do_ip6_fragsin == CONFIG_BOOLEAN_AUTO &&
- (Ip6ReasmOKs ||
- Ip6ReasmFails ||
- Ip6ReasmTimeout ||
- Ip6ReasmReqds ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_fragsin = CONFIG_BOOLEAN_YES;
-
- static RRDSET *st = NULL;
- static RRDDIM *rd_ok = NULL,
- *rd_failed = NULL,
- *rd_timeout = NULL,
- *rd_all = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "fragsin"
- , NULL
- , "fragments6"
- , NULL
- , "IPv6 Fragments Reassembly"
- , "packets/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_FRAGSIN
- , update_every
- , RRDSET_TYPE_LINE);
- rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
-
- rd_ok = rrddim_add(st, "ReasmOKs", "ok", 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_failed = rrddim_add(st, "ReasmFails", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_timeout = rrddim_add(st, "ReasmTimeout", "timeout", -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_all = rrddim_add(st, "ReasmReqds", "all", 1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_ok, Ip6ReasmOKs);
- rrddim_set_by_pointer(st, rd_failed, Ip6ReasmFails);
- rrddim_set_by_pointer(st, rd_timeout, Ip6ReasmTimeout);
- rrddim_set_by_pointer(st, rd_all, Ip6ReasmReqds);
- rrdset_done(st);
- }
-
- if(do_ip6_errors == CONFIG_BOOLEAN_YES || (do_ip6_errors == CONFIG_BOOLEAN_AUTO &&
- (Ip6InDiscards ||
- Ip6OutDiscards ||
- Ip6InHdrErrors ||
- Ip6InAddrErrors ||
- Ip6InUnknownProtos ||
- Ip6InTooBigErrors ||
- Ip6InTruncatedPkts ||
- Ip6InNoRoutes ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_errors = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_InDiscards = NULL,
- *rd_OutDiscards = NULL,
- *rd_InHdrErrors = NULL,
- *rd_InAddrErrors = NULL,
- *rd_InUnknownProtos = NULL,
- *rd_InTooBigErrors = NULL,
- *rd_InTruncatedPkts = NULL,
- *rd_InNoRoutes = NULL,
- *rd_OutNoRoutes = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "errors"
- , NULL
- , "errors"
- , NULL
- , "IPv6 Errors"
- , "packets/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_ERRORS
- , update_every
- , RRDSET_TYPE_LINE
- );
- rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
-
- rd_InDiscards = rrddim_add(st, "InDiscards", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutDiscards = rrddim_add(st, "OutDiscards", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InHdrErrors = rrddim_add(st, "InHdrErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InAddrErrors = rrddim_add(st, "InAddrErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InUnknownProtos = rrddim_add(st, "InUnknownProtos", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InTooBigErrors = rrddim_add(st, "InTooBigErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InTruncatedPkts = rrddim_add(st, "InTruncatedPkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InNoRoutes = rrddim_add(st, "InNoRoutes", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutNoRoutes = rrddim_add(st, "OutNoRoutes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_InDiscards, Ip6InDiscards);
- rrddim_set_by_pointer(st, rd_OutDiscards, Ip6OutDiscards);
- rrddim_set_by_pointer(st, rd_InHdrErrors, Ip6InHdrErrors);
- rrddim_set_by_pointer(st, rd_InAddrErrors, Ip6InAddrErrors);
- rrddim_set_by_pointer(st, rd_InUnknownProtos, Ip6InUnknownProtos);
- rrddim_set_by_pointer(st, rd_InTooBigErrors, Ip6InTooBigErrors);
- rrddim_set_by_pointer(st, rd_InTruncatedPkts, Ip6InTruncatedPkts);
- rrddim_set_by_pointer(st, rd_InNoRoutes, Ip6InNoRoutes);
- rrddim_set_by_pointer(st, rd_OutNoRoutes, Ip6OutNoRoutes);
- rrdset_done(st);
- }
-
- if(do_ip6_udp_packets == CONFIG_BOOLEAN_YES || (do_ip6_udp_packets == CONFIG_BOOLEAN_AUTO &&
- (Udp6InDatagrams ||
- Udp6OutDatagrams ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_udp_packets = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_received = NULL,
- *rd_sent = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "udppackets"
- , NULL
- , "udp6"
- , NULL
- , "IPv6 UDP Packets"
- , "packets/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_UDP_PACKETS
- , update_every
- , RRDSET_TYPE_LINE
- );
-
- rd_received = rrddim_add(st, "InDatagrams", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_sent = rrddim_add(st, "OutDatagrams", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_received, Udp6InDatagrams);
- rrddim_set_by_pointer(st, rd_sent, Udp6OutDatagrams);
- rrdset_done(st);
- }
-
- if(do_ip6_udp_errors == CONFIG_BOOLEAN_YES || (do_ip6_udp_errors == CONFIG_BOOLEAN_AUTO &&
- (Udp6InErrors ||
- Udp6NoPorts ||
- Udp6RcvbufErrors ||
- Udp6SndbufErrors ||
- Udp6InCsumErrors ||
- Udp6IgnoredMulti ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_udp_errors = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_RcvbufErrors = NULL,
- *rd_SndbufErrors = NULL,
- *rd_InErrors = NULL,
- *rd_NoPorts = NULL,
- *rd_InCsumErrors = NULL,
- *rd_IgnoredMulti = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "udperrors"
- , NULL
- , "udp6"
- , NULL
- , "IPv6 UDP Errors"
- , "events/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_UDP_ERRORS
- , update_every
- , RRDSET_TYPE_LINE
- );
- rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
-
- rd_RcvbufErrors = rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_SndbufErrors = rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_NoPorts = rrddim_add(st, "NoPorts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_IgnoredMulti = rrddim_add(st, "IgnoredMulti", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_RcvbufErrors, Udp6RcvbufErrors);
- rrddim_set_by_pointer(st, rd_SndbufErrors, Udp6SndbufErrors);
- rrddim_set_by_pointer(st, rd_InErrors, Udp6InErrors);
- rrddim_set_by_pointer(st, rd_NoPorts, Udp6NoPorts);
- rrddim_set_by_pointer(st, rd_InCsumErrors, Udp6InCsumErrors);
- rrddim_set_by_pointer(st, rd_IgnoredMulti, Udp6IgnoredMulti);
- rrdset_done(st);
- }
-
- if(do_ip6_udplite_packets == CONFIG_BOOLEAN_YES || (do_ip6_udplite_packets == CONFIG_BOOLEAN_AUTO &&
- (UdpLite6InDatagrams ||
- UdpLite6OutDatagrams ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_udplite_packets = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_received = NULL,
- *rd_sent = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "udplitepackets"
- , NULL
- , "udplite6"
- , NULL
- , "IPv6 UDPlite Packets"
- , "packets/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_UDPLITE_PACKETS
- , update_every
- , RRDSET_TYPE_LINE
- );
-
- rd_received = rrddim_add(st, "InDatagrams", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_sent = rrddim_add(st, "OutDatagrams", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_received, UdpLite6InDatagrams);
- rrddim_set_by_pointer(st, rd_sent, UdpLite6OutDatagrams);
- rrdset_done(st);
- }
-
- if(do_ip6_udplite_errors == CONFIG_BOOLEAN_YES || (do_ip6_udplite_errors == CONFIG_BOOLEAN_AUTO &&
- (UdpLite6InErrors ||
- UdpLite6NoPorts ||
- UdpLite6RcvbufErrors ||
- UdpLite6SndbufErrors ||
- Udp6InCsumErrors ||
- UdpLite6InCsumErrors ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_udplite_errors = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_RcvbufErrors = NULL,
- *rd_SndbufErrors = NULL,
- *rd_InErrors = NULL,
- *rd_NoPorts = NULL,
- *rd_InCsumErrors = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "udpliteerrors"
- , NULL
- , "udplite6"
- , NULL
- , "IPv6 UDP Lite Errors"
- , "events/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_UDPLITE_ERRORS
- , update_every
- , RRDSET_TYPE_LINE
- );
- rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
-
- rd_RcvbufErrors = rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_SndbufErrors = rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_NoPorts = rrddim_add(st, "NoPorts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_InErrors, UdpLite6InErrors);
- rrddim_set_by_pointer(st, rd_NoPorts, UdpLite6NoPorts);
- rrddim_set_by_pointer(st, rd_RcvbufErrors, UdpLite6RcvbufErrors);
- rrddim_set_by_pointer(st, rd_SndbufErrors, UdpLite6SndbufErrors);
- rrddim_set_by_pointer(st, rd_InCsumErrors, UdpLite6InCsumErrors);
- rrdset_done(st);
- }
-
- if(do_ip6_mcast == CONFIG_BOOLEAN_YES || (do_ip6_mcast == CONFIG_BOOLEAN_AUTO &&
- (Ip6OutMcastOctets ||
- Ip6InMcastOctets ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_mcast = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_Ip6InMcastOctets = NULL,
- *rd_Ip6OutMcastOctets = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "mcast"
- , NULL
- , "multicast6"
- , NULL
- , "IPv6 Multicast Bandwidth"
- , "kilobits/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_MCAST
- , update_every
- , RRDSET_TYPE_AREA
- );
- rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
-
- rd_Ip6InMcastOctets = rrddim_add(st, "InMcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
- rd_Ip6OutMcastOctets = rrddim_add(st, "OutMcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_Ip6InMcastOctets, Ip6InMcastOctets);
- rrddim_set_by_pointer(st, rd_Ip6OutMcastOctets, Ip6OutMcastOctets);
- rrdset_done(st);
- }
-
- if(do_ip6_bcast == CONFIG_BOOLEAN_YES || (do_ip6_bcast == CONFIG_BOOLEAN_AUTO &&
- (Ip6OutBcastOctets ||
- Ip6InBcastOctets ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_bcast = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_Ip6InBcastOctets = NULL,
- *rd_Ip6OutBcastOctets = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "bcast"
- , NULL
- , "broadcast6"
- , NULL
- , "IPv6 Broadcast Bandwidth"
- , "kilobits/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_BCAST
- , update_every
- , RRDSET_TYPE_AREA
- );
- rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
-
- rd_Ip6InBcastOctets = rrddim_add(st, "InBcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
- rd_Ip6OutBcastOctets = rrddim_add(st, "OutBcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_Ip6InBcastOctets, Ip6InBcastOctets);
- rrddim_set_by_pointer(st, rd_Ip6OutBcastOctets, Ip6OutBcastOctets);
- rrdset_done(st);
- }
-
- if(do_ip6_mcast_p == CONFIG_BOOLEAN_YES || (do_ip6_mcast_p == CONFIG_BOOLEAN_AUTO &&
- (Ip6OutMcastPkts ||
- Ip6InMcastPkts ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_mcast_p = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_Ip6InMcastPkts = NULL,
- *rd_Ip6OutMcastPkts = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "mcastpkts"
- , NULL
- , "multicast6"
- , NULL
- , "IPv6 Multicast Packets"
- , "packets/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_MCAST_PACKETS
- , update_every
- , RRDSET_TYPE_LINE
- );
- rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
-
- rd_Ip6InMcastPkts = rrddim_add(st, "InMcastPkts", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_Ip6OutMcastPkts = rrddim_add(st, "OutMcastPkts", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_Ip6InMcastPkts, Ip6InMcastPkts);
- rrddim_set_by_pointer(st, rd_Ip6OutMcastPkts, Ip6OutMcastPkts);
- rrdset_done(st);
- }
-
- if(do_ip6_icmp == CONFIG_BOOLEAN_YES || (do_ip6_icmp == CONFIG_BOOLEAN_AUTO &&
- (Icmp6InMsgs ||
- Icmp6OutMsgs ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_icmp = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_Icmp6InMsgs = NULL,
- *rd_Icmp6OutMsgs = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "icmp"
- , NULL
- , "icmp6"
- , NULL
- , "IPv6 ICMP Messages"
- , "messages/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_ICMP
- , update_every
- , RRDSET_TYPE_LINE
- );
-
- rd_Icmp6InMsgs = rrddim_add(st, "InMsgs", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_Icmp6OutMsgs = rrddim_add(st, "OutMsgs", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_Icmp6InMsgs, Icmp6InMsgs);
- rrddim_set_by_pointer(st, rd_Icmp6OutMsgs, Icmp6OutMsgs);
- rrdset_done(st);
- }
-
- if(do_ip6_icmp_redir == CONFIG_BOOLEAN_YES || (do_ip6_icmp_redir == CONFIG_BOOLEAN_AUTO &&
- (Icmp6InRedirects ||
- Icmp6OutRedirects ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_icmp_redir = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_Icmp6InRedirects = NULL,
- *rd_Icmp6OutRedirects = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "icmpredir"
- , NULL
- , "icmp6"
- , NULL
- , "IPv6 ICMP Redirects"
- , "redirects/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_ICMP_REDIR
- , update_every
- , RRDSET_TYPE_LINE
- );
-
- rd_Icmp6InRedirects = rrddim_add(st, "InRedirects", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_Icmp6OutRedirects = rrddim_add(st, "OutRedirects", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_Icmp6InRedirects, Icmp6InRedirects);
- rrddim_set_by_pointer(st, rd_Icmp6OutRedirects, Icmp6OutRedirects);
- rrdset_done(st);
- }
-
- if(do_ip6_icmp_errors == CONFIG_BOOLEAN_YES || (do_ip6_icmp_errors == CONFIG_BOOLEAN_AUTO &&
- (Icmp6InErrors ||
- Icmp6OutErrors ||
- Icmp6InCsumErrors ||
- Icmp6InDestUnreachs ||
- Icmp6InPktTooBigs ||
- Icmp6InTimeExcds ||
- Icmp6InParmProblems ||
- Icmp6OutDestUnreachs ||
- Icmp6OutPktTooBigs ||
- Icmp6OutTimeExcds ||
- Icmp6OutParmProblems ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_icmp_errors = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_InErrors = NULL,
- *rd_OutErrors = NULL,
- *rd_InCsumErrors = NULL,
- *rd_InDestUnreachs = NULL,
- *rd_InPktTooBigs = NULL,
- *rd_InTimeExcds = NULL,
- *rd_InParmProblems = NULL,
- *rd_OutDestUnreachs = NULL,
- *rd_OutPktTooBigs = NULL,
- *rd_OutTimeExcds = NULL,
- *rd_OutParmProblems = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "icmperrors"
- , NULL
- , "icmp6"
- , NULL
- , "IPv6 ICMP Errors"
- , "errors/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_ICMP_ERRORS
- , update_every
- , RRDSET_TYPE_LINE
- );
-
- rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutErrors = rrddim_add(st, "OutErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InDestUnreachs = rrddim_add(st, "InDestUnreachs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InPktTooBigs = rrddim_add(st, "InPktTooBigs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InTimeExcds = rrddim_add(st, "InTimeExcds", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InParmProblems = rrddim_add(st, "InParmProblems", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutDestUnreachs = rrddim_add(st, "OutDestUnreachs", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutPktTooBigs = rrddim_add(st, "OutPktTooBigs", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutTimeExcds = rrddim_add(st, "OutTimeExcds", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutParmProblems = rrddim_add(st, "OutParmProblems", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_InErrors, Icmp6InErrors);
- rrddim_set_by_pointer(st, rd_OutErrors, Icmp6OutErrors);
- rrddim_set_by_pointer(st, rd_InCsumErrors, Icmp6InCsumErrors);
- rrddim_set_by_pointer(st, rd_InDestUnreachs, Icmp6InDestUnreachs);
- rrddim_set_by_pointer(st, rd_InPktTooBigs, Icmp6InPktTooBigs);
- rrddim_set_by_pointer(st, rd_InTimeExcds, Icmp6InTimeExcds);
- rrddim_set_by_pointer(st, rd_InParmProblems, Icmp6InParmProblems);
- rrddim_set_by_pointer(st, rd_OutDestUnreachs, Icmp6OutDestUnreachs);
- rrddim_set_by_pointer(st, rd_OutPktTooBigs, Icmp6OutPktTooBigs);
- rrddim_set_by_pointer(st, rd_OutTimeExcds, Icmp6OutTimeExcds);
- rrddim_set_by_pointer(st, rd_OutParmProblems, Icmp6OutParmProblems);
- rrdset_done(st);
- }
-
- if(do_ip6_icmp_echos == CONFIG_BOOLEAN_YES || (do_ip6_icmp_echos == CONFIG_BOOLEAN_AUTO &&
- (Icmp6InEchos ||
- Icmp6OutEchos ||
- Icmp6InEchoReplies ||
- Icmp6OutEchoReplies ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_icmp_echos = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_InEchos = NULL,
- *rd_OutEchos = NULL,
- *rd_InEchoReplies = NULL,
- *rd_OutEchoReplies = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "icmpechos"
- , NULL
- , "icmp6"
- , NULL
- , "IPv6 ICMP Echo"
- , "messages/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_ICMP_ECHOS
- , update_every
- , RRDSET_TYPE_LINE
- );
-
- rd_InEchos = rrddim_add(st, "InEchos", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutEchos = rrddim_add(st, "OutEchos", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InEchoReplies = rrddim_add(st, "InEchoReplies", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutEchoReplies = rrddim_add(st, "OutEchoReplies", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_InEchos, Icmp6InEchos);
- rrddim_set_by_pointer(st, rd_OutEchos, Icmp6OutEchos);
- rrddim_set_by_pointer(st, rd_InEchoReplies, Icmp6InEchoReplies);
- rrddim_set_by_pointer(st, rd_OutEchoReplies, Icmp6OutEchoReplies);
- rrdset_done(st);
- }
-
- if(do_ip6_icmp_groupmemb == CONFIG_BOOLEAN_YES || (do_ip6_icmp_groupmemb == CONFIG_BOOLEAN_AUTO &&
- (Icmp6InGroupMembQueries ||
- Icmp6OutGroupMembQueries ||
- Icmp6InGroupMembResponses ||
- Icmp6OutGroupMembResponses ||
- Icmp6InGroupMembReductions ||
- Icmp6OutGroupMembReductions ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_icmp_groupmemb = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_InQueries = NULL,
- *rd_OutQueries = NULL,
- *rd_InResponses = NULL,
- *rd_OutResponses = NULL,
- *rd_InReductions = NULL,
- *rd_OutReductions = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "groupmemb"
- , NULL
- , "icmp6"
- , NULL
- , "IPv6 ICMP Group Membership"
- , "messages/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_ICMP_GROUPMEMB
- , update_every
- , RRDSET_TYPE_LINE);
-
- rd_InQueries = rrddim_add(st, "InQueries", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutQueries = rrddim_add(st, "OutQueries", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InResponses = rrddim_add(st, "InResponses", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutResponses = rrddim_add(st, "OutResponses", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InReductions = rrddim_add(st, "InReductions", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutReductions = rrddim_add(st, "OutReductions", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_InQueries, Icmp6InGroupMembQueries);
- rrddim_set_by_pointer(st, rd_OutQueries, Icmp6OutGroupMembQueries);
- rrddim_set_by_pointer(st, rd_InResponses, Icmp6InGroupMembResponses);
- rrddim_set_by_pointer(st, rd_OutResponses, Icmp6OutGroupMembResponses);
- rrddim_set_by_pointer(st, rd_InReductions, Icmp6InGroupMembReductions);
- rrddim_set_by_pointer(st, rd_OutReductions, Icmp6OutGroupMembReductions);
- rrdset_done(st);
- }
-
- if(do_ip6_icmp_router == CONFIG_BOOLEAN_YES || (do_ip6_icmp_router == CONFIG_BOOLEAN_AUTO &&
- (Icmp6InRouterSolicits ||
- Icmp6OutRouterSolicits ||
- Icmp6InRouterAdvertisements ||
- Icmp6OutRouterAdvertisements ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_icmp_router = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_InSolicits = NULL,
- *rd_OutSolicits = NULL,
- *rd_InAdvertisements = NULL,
- *rd_OutAdvertisements = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "icmprouter"
- , NULL
- , "icmp6"
- , NULL
- , "IPv6 Router Messages"
- , "messages/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_ICMP_ROUTER
- , update_every
- , RRDSET_TYPE_LINE
- );
-
- rd_InSolicits = rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutSolicits = rrddim_add(st, "OutSolicits", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InAdvertisements = rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutAdvertisements = rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_InSolicits, Icmp6InRouterSolicits);
- rrddim_set_by_pointer(st, rd_OutSolicits, Icmp6OutRouterSolicits);
- rrddim_set_by_pointer(st, rd_InAdvertisements, Icmp6InRouterAdvertisements);
- rrddim_set_by_pointer(st, rd_OutAdvertisements, Icmp6OutRouterAdvertisements);
- rrdset_done(st);
- }
-
- if(do_ip6_icmp_neighbor == CONFIG_BOOLEAN_YES || (do_ip6_icmp_neighbor == CONFIG_BOOLEAN_AUTO &&
- (Icmp6InNeighborSolicits ||
- Icmp6OutNeighborSolicits ||
- Icmp6InNeighborAdvertisements ||
- Icmp6OutNeighborAdvertisements ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_icmp_neighbor = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_InSolicits = NULL,
- *rd_OutSolicits = NULL,
- *rd_InAdvertisements = NULL,
- *rd_OutAdvertisements = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "icmpneighbor"
- , NULL
- , "icmp6"
- , NULL
- , "IPv6 Neighbor Messages"
- , "messages/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_ICMP_NEIGHBOR
- , update_every
- , RRDSET_TYPE_LINE
- );
-
- rd_InSolicits = rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutSolicits = rrddim_add(st, "OutSolicits", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InAdvertisements = rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutAdvertisements = rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_InSolicits, Icmp6InNeighborSolicits);
- rrddim_set_by_pointer(st, rd_OutSolicits, Icmp6OutNeighborSolicits);
- rrddim_set_by_pointer(st, rd_InAdvertisements, Icmp6InNeighborAdvertisements);
- rrddim_set_by_pointer(st, rd_OutAdvertisements, Icmp6OutNeighborAdvertisements);
- rrdset_done(st);
- }
-
- if(do_ip6_icmp_mldv2 == CONFIG_BOOLEAN_YES || (do_ip6_icmp_mldv2 == CONFIG_BOOLEAN_AUTO &&
- (Icmp6InMLDv2Reports ||
- Icmp6OutMLDv2Reports ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_icmp_mldv2 = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_InMLDv2Reports = NULL,
- *rd_OutMLDv2Reports = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "icmpmldv2"
- , NULL
- , "icmp6"
- , NULL
- , "IPv6 ICMP MLDv2 Reports"
- , "reports/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_ICMP_LDV2
- , update_every
- , RRDSET_TYPE_LINE
- );
-
- rd_InMLDv2Reports = rrddim_add(st, "InMLDv2Reports", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutMLDv2Reports = rrddim_add(st, "OutMLDv2Reports", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_InMLDv2Reports, Icmp6InMLDv2Reports);
- rrddim_set_by_pointer(st, rd_OutMLDv2Reports, Icmp6OutMLDv2Reports);
- rrdset_done(st);
- }
-
- if(do_ip6_icmp_types == CONFIG_BOOLEAN_YES || (do_ip6_icmp_types == CONFIG_BOOLEAN_AUTO &&
- (Icmp6InType1 ||
- Icmp6InType128 ||
- Icmp6InType129 ||
- Icmp6InType136 ||
- Icmp6OutType1 ||
- Icmp6OutType128 ||
- Icmp6OutType129 ||
- Icmp6OutType133 ||
- Icmp6OutType135 ||
- Icmp6OutType143 ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_icmp_types = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_InType1 = NULL,
- *rd_InType128 = NULL,
- *rd_InType129 = NULL,
- *rd_InType136 = NULL,
- *rd_OutType1 = NULL,
- *rd_OutType128 = NULL,
- *rd_OutType129 = NULL,
- *rd_OutType133 = NULL,
- *rd_OutType135 = NULL,
- *rd_OutType143 = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "icmptypes"
- , NULL
- , "icmp6"
- , NULL
- , "IPv6 ICMP Types"
- , "messages/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_ICMP_TYPES
- , update_every
- , RRDSET_TYPE_LINE
- );
-
- rd_InType1 = rrddim_add(st, "InType1", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InType128 = rrddim_add(st, "InType128", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InType129 = rrddim_add(st, "InType129", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InType136 = rrddim_add(st, "InType136", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutType1 = rrddim_add(st, "OutType1", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutType128 = rrddim_add(st, "OutType128", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutType129 = rrddim_add(st, "OutType129", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutType133 = rrddim_add(st, "OutType133", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutType135 = rrddim_add(st, "OutType135", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_OutType143 = rrddim_add(st, "OutType143", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_InType1, Icmp6InType1);
- rrddim_set_by_pointer(st, rd_InType128, Icmp6InType128);
- rrddim_set_by_pointer(st, rd_InType129, Icmp6InType129);
- rrddim_set_by_pointer(st, rd_InType136, Icmp6InType136);
- rrddim_set_by_pointer(st, rd_OutType1, Icmp6OutType1);
- rrddim_set_by_pointer(st, rd_OutType128, Icmp6OutType128);
- rrddim_set_by_pointer(st, rd_OutType129, Icmp6OutType129);
- rrddim_set_by_pointer(st, rd_OutType133, Icmp6OutType133);
- rrddim_set_by_pointer(st, rd_OutType135, Icmp6OutType135);
- rrddim_set_by_pointer(st, rd_OutType143, Icmp6OutType143);
- rrdset_done(st);
- }
-
- if(do_ip6_ect == CONFIG_BOOLEAN_YES || (do_ip6_ect == CONFIG_BOOLEAN_AUTO &&
- (Ip6InNoECTPkts ||
- Ip6InECT1Pkts ||
- Ip6InECT0Pkts ||
- Ip6InCEPkts ||
- netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
- do_ip6_ect = CONFIG_BOOLEAN_YES;
- static RRDSET *st = NULL;
- static RRDDIM *rd_InNoECTPkts = NULL,
- *rd_InECT1Pkts = NULL,
- *rd_InECT0Pkts = NULL,
- *rd_InCEPkts = NULL;
-
- if(unlikely(!st)) {
- st = rrdset_create_localhost(
- RRD_TYPE_NET_SNMP6
- , "ect"
- , NULL
- , "packets"
- , NULL
- , "IPv6 ECT Packets"
- , "packets/s"
- , PLUGIN_PROC_NAME
- , PLUGIN_PROC_MODULE_NETSTAT_NAME
- , NETDATA_CHART_PRIO_IPV6_ECT
- , update_every
- , RRDSET_TYPE_LINE
- );
-
- rd_InNoECTPkts = rrddim_add(st, "InNoECTPkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InECT1Pkts = rrddim_add(st, "InECT1Pkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InECT0Pkts = rrddim_add(st, "InECT0Pkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rd_InCEPkts = rrddim_add(st, "InCEPkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- }
-
- rrddim_set_by_pointer(st, rd_InNoECTPkts, Ip6InNoECTPkts);
- rrddim_set_by_pointer(st, rd_InECT1Pkts, Ip6InECT1Pkts);
- rrddim_set_by_pointer(st, rd_InECT0Pkts, Ip6InECT0Pkts);
- rrddim_set_by_pointer(st, rd_InCEPkts, Ip6InCEPkts);
- rrdset_done(st);
- }
-
+ do_proc_net_snmp6(update_every);
+
return 0;
}
diff --git a/collectors/proc.plugin/proc_net_rpc_nfs.c b/collectors/proc.plugin/proc_net_rpc_nfs.c
index b1ff4e05..0ab9d28b 100644
--- a/collectors/proc.plugin/proc_net_rpc_nfs.c
+++ b/collectors/proc.plugin/proc_net_rpc_nfs.c
@@ -183,7 +183,7 @@ int do_proc_net_rpc_nfs(int update_every, usec_t dt) {
if(do_net == 1 && strcmp(type, "net") == 0) {
if(words < 5) {
- error("%s line of /proc/net/rpc/nfs has %zu words, expected %d", type, words, 5);
+ collector_error("%s line of /proc/net/rpc/nfs has %zu words, expected %d", type, words, 5);
continue;
}
@@ -198,7 +198,7 @@ int do_proc_net_rpc_nfs(int update_every, usec_t dt) {
}
else if(do_rpc == 1 && strcmp(type, "rpc") == 0) {
if(words < 4) {
- error("%s line of /proc/net/rpc/nfs has %zu words, expected %d", type, words, 6);
+ collector_error("%s line of /proc/net/rpc/nfs has %zu words, expected %d", type, words, 6);
continue;
}
@@ -224,7 +224,7 @@ int do_proc_net_rpc_nfs(int update_every, usec_t dt) {
if(sum == 0ULL) {
if(!proc2_warning) {
- error("Disabling /proc/net/rpc/nfs v2 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
+ collector_error("Disabling /proc/net/rpc/nfs v2 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
proc2_warning = 1;
}
do_proc2 = 0;
@@ -245,7 +245,7 @@ int do_proc_net_rpc_nfs(int update_every, usec_t dt) {
if(sum == 0ULL) {
if(!proc3_warning) {
- info("Disabling /proc/net/rpc/nfs v3 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
+ collector_info("Disabling /proc/net/rpc/nfs v3 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
proc3_warning = 1;
}
do_proc3 = 0;
@@ -266,7 +266,7 @@ int do_proc_net_rpc_nfs(int update_every, usec_t dt) {
if(sum == 0ULL) {
if(!proc4_warning) {
- info("Disabling /proc/net/rpc/nfs v4 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
+ collector_info("Disabling /proc/net/rpc/nfs v4 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
proc4_warning = 1;
}
do_proc4 = 0;
diff --git a/collectors/proc.plugin/proc_net_rpc_nfsd.c b/collectors/proc.plugin/proc_net_rpc_nfsd.c
index bd1da888..faa6b5c4 100644
--- a/collectors/proc.plugin/proc_net_rpc_nfsd.c
+++ b/collectors/proc.plugin/proc_net_rpc_nfsd.c
@@ -282,7 +282,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
if(do_rc == 1 && strcmp(type, "rc") == 0) {
if(unlikely(words < 4)) {
- error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 4);
+ collector_error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 4);
continue;
}
@@ -296,7 +296,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
}
else if(do_fh == 1 && strcmp(type, "fh") == 0) {
if(unlikely(words < 6)) {
- error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 6);
+ collector_error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 6);
continue;
}
@@ -309,7 +309,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
}
else if(do_io == 1 && strcmp(type, "io") == 0) {
if(unlikely(words < 3)) {
- error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 3);
+ collector_error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 3);
continue;
}
@@ -322,7 +322,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
}
else if(do_th == 1 && strcmp(type, "th") == 0) {
if(unlikely(words < 13)) {
- error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 13);
+ collector_error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 13);
continue;
}
@@ -335,7 +335,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
}
else if(do_net == 1 && strcmp(type, "net") == 0) {
if(unlikely(words < 5)) {
- error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 5);
+ collector_error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 5);
continue;
}
@@ -350,7 +350,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
}
else if(do_rpc == 1 && strcmp(type, "rpc") == 0) {
if(unlikely(words < 6)) {
- error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 6);
+ collector_error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 6);
continue;
}
@@ -377,7 +377,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
if(sum == 0ULL) {
if(!proc2_warning) {
- error("Disabling /proc/net/rpc/nfsd v2 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
+ collector_error("Disabling /proc/net/rpc/nfsd v2 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
proc2_warning = 1;
}
do_proc2 = 0;
@@ -398,7 +398,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
if(sum == 0ULL) {
if(!proc3_warning) {
- info("Disabling /proc/net/rpc/nfsd v3 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
+ collector_info("Disabling /proc/net/rpc/nfsd v3 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
proc3_warning = 1;
}
do_proc3 = 0;
@@ -419,7 +419,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
if(sum == 0ULL) {
if(!proc4_warning) {
- info("Disabling /proc/net/rpc/nfsd v4 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
+ collector_info("Disabling /proc/net/rpc/nfsd v4 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
proc4_warning = 1;
}
do_proc4 = 0;
@@ -440,7 +440,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
if(sum == 0ULL) {
if(!proc4ops_warning) {
- info("Disabling /proc/net/rpc/nfsd v4 operations chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
+ collector_info("Disabling /proc/net/rpc/nfsd v4 operations chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
proc4ops_warning = 1;
}
do_proc4ops = 0;
diff --git a/collectors/proc.plugin/proc_net_sctp_snmp.c b/collectors/proc.plugin/proc_net_sctp_snmp.c
index 292449a7..e67143e6 100644
--- a/collectors/proc.plugin/proc_net_sctp_snmp.c
+++ b/collectors/proc.plugin/proc_net_sctp_snmp.c
@@ -113,7 +113,7 @@ int do_proc_net_sctp_snmp(int update_every, usec_t dt) {
for(l = 0; l < lines ;l++) {
size_t words = procfile_linewords(ff, l);
if(unlikely(words < 2)) {
- if(unlikely(words)) error("Cannot read /proc/net/sctp/snmp line %zu. Expected 2 params, read %zu.", l, words);
+ if(unlikely(words)) collector_error("Cannot read /proc/net/sctp/snmp line %zu. Expected 2 params, read %zu.", l, words);
continue;
}
diff --git a/collectors/proc.plugin/proc_net_softnet_stat.c b/collectors/proc.plugin/proc_net_softnet_stat.c
index 65239246..dfd372b2 100644
--- a/collectors/proc.plugin/proc_net_softnet_stat.c
+++ b/collectors/proc.plugin/proc_net_softnet_stat.c
@@ -40,7 +40,7 @@ int do_proc_net_softnet_stat(int update_every, usec_t dt) {
size_t words = procfile_linewords(ff, 0), w;
if(unlikely(!lines || !words)) {
- error("Cannot read /proc/net/softnet_stat, %zu lines and %zu columns reported.", lines, words);
+ collector_error("Cannot read /proc/net/softnet_stat, %zu lines and %zu columns reported.", lines, words);
return 1;
}
diff --git a/collectors/proc.plugin/proc_net_stat_conntrack.c b/collectors/proc.plugin/proc_net_stat_conntrack.c
index f9dbdf47..e8fbdbb6 100644
--- a/collectors/proc.plugin/proc_net_stat_conntrack.c
+++ b/collectors/proc.plugin/proc_net_stat_conntrack.c
@@ -69,7 +69,7 @@ int do_proc_net_stat_conntrack(int update_every, usec_t dt) {
for(l = 1; l < lines ;l++) {
size_t words = procfile_linewords(ff, l);
if(unlikely(words < 17)) {
- if(unlikely(words)) error("Cannot read /proc/net/stat/nf_conntrack line. Expected 17 params, read %zu.", words);
+ if(unlikely(words)) collector_error("Cannot read /proc/net/stat/nf_conntrack line. Expected 17 params, read %zu.", words);
continue;
}
diff --git a/collectors/proc.plugin/proc_net_stat_synproxy.c b/collectors/proc.plugin/proc_net_stat_synproxy.c
index 0a74b357..e23a0ab7 100644
--- a/collectors/proc.plugin/proc_net_stat_synproxy.c
+++ b/collectors/proc.plugin/proc_net_stat_synproxy.c
@@ -34,7 +34,7 @@ int do_proc_net_stat_synproxy(int update_every, usec_t dt) {
// make sure we have 3 lines
size_t lines = procfile_lines(ff), l;
if(unlikely(lines < 2)) {
- error("/proc/net/stat/synproxy has %zu lines, expected no less than 2. Disabling it.", lines);
+ collector_error("/proc/net/stat/synproxy has %zu lines, expected no less than 2. Disabling it.", lines);
return 1;
}
diff --git a/collectors/proc.plugin/proc_pagetypeinfo.c b/collectors/proc.plugin/proc_pagetypeinfo.c
index dc006aa5..e12c5bff 100644
--- a/collectors/proc.plugin/proc_pagetypeinfo.c
+++ b/collectors/proc.plugin/proc_pagetypeinfo.c
@@ -112,7 +112,7 @@ int do_proc_pagetypeinfo(int update_every, usec_t dt) {
ff_lines = procfile_lines(ff);
if(unlikely(!ff_lines)) {
- error("PLUGIN: PROC_PAGETYPEINFO: Cannot read %s, zero lines reported.", ff_path);
+ collector_error("PLUGIN: PROC_PAGETYPEINFO: Cannot read %s, zero lines reported.", ff_path);
return 1;
}
@@ -135,21 +135,21 @@ int do_proc_pagetypeinfo(int update_every, usec_t dt) {
pagelines_cnt++;
}
if (pagelines_cnt == 0) {
- error("PLUGIN: PROC_PAGETYPEINFO: Unable to parse any valid line in %s", ff_path);
+ collector_error("PLUGIN: PROC_PAGETYPEINFO: Unable to parse any valid line in %s", ff_path);
return 1;
}
// 4th line is the "Free pages count per migrate type at order". Just subtract these 8 words.
pageorders_cnt = procfile_linewords(ff, 3);
if (pageorders_cnt < 9) {
- error("PLUGIN: PROC_PAGETYPEINFO: Unable to parse Line 4 of %s", ff_path);
+ collector_error("PLUGIN: PROC_PAGETYPEINFO: Unable to parse Line 4 of %s", ff_path);
return 1;
}
pageorders_cnt -= 9;
if (pageorders_cnt > MAX_PAGETYPE_ORDER) {
- error("PLUGIN: PROC_PAGETYPEINFO: pageorder found (%lu) is higher than max %d",
+ collector_error("PLUGIN: PROC_PAGETYPEINFO: pageorder found (%lu) is higher than max %d",
(long unsigned int) pageorders_cnt, MAX_PAGETYPE_ORDER);
return 1;
}
@@ -158,7 +158,7 @@ int do_proc_pagetypeinfo(int update_every, usec_t dt) {
if (!pagelines) {
pagelines = callocz(pagelines_cnt, sizeof(struct pageline));
if (!pagelines) {
- error("PLUGIN: PROC_PAGETYPEINFO: Cannot allocate %lu pagelines of %lu B",
+ collector_error("PLUGIN: PROC_PAGETYPEINFO: Cannot allocate %lu pagelines of %lu B",
(long unsigned int) pagelines_cnt, (long unsigned int) sizeof(struct pageline));
return 1;
}
@@ -291,8 +291,8 @@ int do_proc_pagetypeinfo(int update_every, usec_t dt) {
size_t words = procfile_linewords(ff, l);
if (words != 7+pageorders_cnt) {
- error("PLUGIN: PROC_PAGETYPEINFO: Unable to read line %lu, %lu words found instead of %lu",
- l+1, (long unsigned int) words, (long unsigned int) 7+pageorders_cnt);
+ collector_error("PLUGIN: PROC_PAGETYPEINFO: Unable to read line %lu, %lu words found instead of %lu",
+ l+1, (long unsigned int) words, (long unsigned int) 7+pageorders_cnt);
break;
}
diff --git a/collectors/proc.plugin/proc_pressure.c b/collectors/proc.plugin/proc_pressure.c
index 6649aa63..80b08d9a 100644
--- a/collectors/proc.plugin/proc_pressure.c
+++ b/collectors/proc.plugin/proc_pressure.c
@@ -171,7 +171,7 @@ int do_proc_pressure(int update_every, usec_t dt) {
ff = procfile_open(filename, " =", PROCFILE_FLAG_DEFAULT);
if (unlikely(!ff)) {
- error("Cannot read pressure information from %s.", filename);
+ collector_error("Cannot read pressure information from %s.", filename);
fail_count++;
continue;
}
@@ -186,7 +186,7 @@ int do_proc_pressure(int update_every, usec_t dt) {
size_t lines = procfile_lines(ff);
if (unlikely(lines < 1)) {
- error("%s has no lines.", procfile_filename(ff));
+ collector_error("%s has no lines.", procfile_filename(ff));
fail_count++;
continue;
}
diff --git a/collectors/proc.plugin/proc_self_mountinfo.c b/collectors/proc.plugin/proc_self_mountinfo.c
index 9310f2ff..0483749c 100644
--- a/collectors/proc.plugin/proc_self_mountinfo.c
+++ b/collectors/proc.plugin/proc_self_mountinfo.c
@@ -227,8 +227,9 @@ struct mountinfo *mountinfo_read(int do_statvfs) {
struct mountinfo *root = NULL, *last = NULL, *mi = NULL;
// create a dictionary to track uniqueness
- DICTIONARY *dict = dictionary_create(
- DICT_OPTION_SINGLE_THREADED | DICT_OPTION_DONT_OVERWRITE_VALUE | DICT_OPTION_NAME_LINK_DONT_CLONE);
+ DICTIONARY *dict = dictionary_create_advanced(
+ DICT_OPTION_SINGLE_THREADED | DICT_OPTION_DONT_OVERWRITE_VALUE | DICT_OPTION_NAME_LINK_DONT_CLONE,
+ &dictionary_stats_category_collectors, 0);
unsigned long l, lines = procfile_lines(ff);
for(l = 0; l < lines ;l++) {
@@ -252,7 +253,7 @@ struct mountinfo *mountinfo_read(int do_statvfs) {
for(minor = major; *minor && *minor != ':' ;minor++) ;
if(unlikely(!*minor)) {
- error("Cannot parse major:minor on '%s' at line %lu of '%s'", major, l + 1, filename);
+ collector_error("Cannot parse major:minor on '%s' at line %lu of '%s'", major, l + 1, filename);
freez(mi);
continue;
}
@@ -442,7 +443,7 @@ struct mountinfo *mountinfo_read(int do_statvfs) {
#ifdef NETDATA_INTERNAL_CHECKS
if(unlikely(!mi)) {
- error("Mount point '%s' not found in /proc/self/mountinfo", mnt->mnt_dir);
+ collector_error("Mount point '%s' not found in /proc/self/mountinfo", mnt->mnt_dir);
}
#endif
}
diff --git a/collectors/proc.plugin/proc_softirqs.c b/collectors/proc.plugin/proc_softirqs.c
index 4c4df766..0d5d8ef9 100644
--- a/collectors/proc.plugin/proc_softirqs.c
+++ b/collectors/proc.plugin/proc_softirqs.c
@@ -75,7 +75,7 @@ int do_proc_softirqs(int update_every, usec_t dt) {
size_t words = procfile_linewords(ff, 0);
if(unlikely(!lines)) {
- error("Cannot read /proc/softirqs, zero lines reported.");
+ collector_error("Cannot read /proc/softirqs, zero lines reported.");
return 1;
}
@@ -90,7 +90,7 @@ int do_proc_softirqs(int update_every, usec_t dt) {
}
if(unlikely(!cpus)) {
- error("PLUGIN: PROC_SOFTIRQS: Cannot find the number of CPUs in /proc/softirqs");
+ collector_error("PLUGIN: PROC_SOFTIRQS: Cannot find the number of CPUs in /proc/softirqs");
return 1;
}
diff --git a/collectors/proc.plugin/proc_spl_kstat_zfs.c b/collectors/proc.plugin/proc_spl_kstat_zfs.c
index 8938d643..0db9970c 100644
--- a/collectors/proc.plugin/proc_spl_kstat_zfs.c
+++ b/collectors/proc.plugin/proc_spl_kstat_zfs.c
@@ -140,7 +140,7 @@ int do_proc_spl_kstat_zfs_arcstats(int update_every, usec_t dt) {
if(likely(!do_zfs_stats)) {
DIR *dir = opendir(dirname);
if(unlikely(!dir)) {
- error("Cannot read directory '%s'", dirname);
+ collector_error("Cannot read directory '%s'", dirname);
return 1;
}
@@ -177,7 +177,7 @@ int do_proc_spl_kstat_zfs_arcstats(int update_every, usec_t dt) {
for(l = 0; l < lines ;l++) {
size_t words = procfile_linewords(ff, l);
if(unlikely(words < 3)) {
- if(unlikely(words)) error("Cannot read " ZFS_PROC_ARCSTATS " line %zu. Expected 3 params, read %zu.", l, words);
+ if(unlikely(words)) collector_error("Cannot read " ZFS_PROC_ARCSTATS " line %zu. Expected 3 params, read %zu.", l, words);
continue;
}
@@ -285,6 +285,8 @@ int update_zfs_pool_state_chart(const DICTIONARY_ITEM *item, void *pool_p, void
pool->rd_offline = rrddim_add(pool->st, "offline", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
pool->rd_removed = rrddim_add(pool->st, "removed", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
pool->rd_unavail = rrddim_add(pool->st, "unavail", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
+
+ rrdlabels_add(pool->st->rrdlabels, "pool", name, RRDLABEL_SRC_AUTO);
}
rrddim_set_by_pointer(pool->st, pool->rd_online, pool->online);
@@ -320,7 +322,7 @@ int do_proc_spl_kstat_zfs_pool_state(int update_every, usec_t dt)
snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/spl/kstat/zfs");
dirname = config_get("plugin:proc:" ZFS_PROC_POOLS, "directory to monitor", filename);
- zfs_pools = dictionary_create(DICT_OPTION_SINGLE_THREADED);
+ zfs_pools = dictionary_create_advanced(DICT_OPTION_SINGLE_THREADED, &dictionary_stats_category_collectors, 0);
do_zfs_pool_state = 1;
}
@@ -328,7 +330,7 @@ int do_proc_spl_kstat_zfs_pool_state(int update_every, usec_t dt)
if (likely(do_zfs_pool_state)) {
DIR *dir = opendir(dirname);
if (unlikely(!dir)) {
- error("Cannot read directory '%s'", dirname);
+ collector_error("Cannot read directory '%s'", dirname);
return 1;
}
@@ -392,7 +394,7 @@ int do_proc_spl_kstat_zfs_pool_state(int update_every, usec_t dt)
char *c = strchr(state, '\n');
if (c)
*c = '\0';
- error("ZFS POOLS: Undefined state %s for zpool %s, disabling the chart", state, de->d_name);
+ collector_error("ZFS POOLS: Undefined state %s for zpool %s, disabling the chart", state, de->d_name);
}
}
}
@@ -402,7 +404,7 @@ int do_proc_spl_kstat_zfs_pool_state(int update_every, usec_t dt)
}
if (do_zfs_pool_state && pool_found && !state_file_found) {
- info("ZFS POOLS: State files not found. Disabling the module.");
+ collector_info("ZFS POOLS: State files not found. Disabling the module.");
do_zfs_pool_state = 0;
}
diff --git a/collectors/proc.plugin/proc_stat.c b/collectors/proc.plugin/proc_stat.c
index 33fe9323..2ca7c42e 100644
--- a/collectors/proc.plugin/proc_stat.c
+++ b/collectors/proc.plugin/proc_stat.c
@@ -69,7 +69,7 @@ static int read_per_core_files(struct cpu_chart *all_cpu_charts, size_t len, siz
if(unlikely(f->fd == -1)) {
f->fd = open(f->filename, O_RDONLY);
if (unlikely(f->fd == -1)) {
- error("Cannot open file '%s'", f->filename);
+ collector_error("Cannot open file '%s'", f->filename);
continue;
}
}
@@ -78,7 +78,7 @@ static int read_per_core_files(struct cpu_chart *all_cpu_charts, size_t len, siz
if(unlikely(ret < 0)) {
// cannot read that file
- error("Cannot read file '%s'", f->filename);
+ collector_error("Cannot read file '%s'", f->filename);
close(f->fd);
f->fd = -1;
continue;
@@ -94,7 +94,7 @@ static int read_per_core_files(struct cpu_chart *all_cpu_charts, size_t len, siz
f->fd = -1;
}
else if(lseek(f->fd, 0, SEEK_SET) == -1) {
- error("Cannot seek in file '%s'", f->filename);
+ collector_error("Cannot seek in file '%s'", f->filename);
close(f->fd);
f->fd = -1;
}
@@ -133,14 +133,14 @@ static int read_per_core_time_in_state_files(struct cpu_chart *all_cpu_charts, s
tsf->ff = procfile_open(tsf->filename, " \t:", PROCFILE_FLAG_DEFAULT);
if(unlikely(!tsf->ff))
{
- error("Cannot open file '%s'", tsf->filename);
+ collector_error("Cannot open file '%s'", tsf->filename);
continue;
}
}
tsf->ff = procfile_readall(tsf->ff);
if(unlikely(!tsf->ff)) {
- error("Cannot read file '%s'", tsf->filename);
+ collector_error("Cannot read file '%s'", tsf->filename);
procfile_close(tsf->ff);
tsf->ff = NULL;
continue;
@@ -179,7 +179,7 @@ static int read_per_core_time_in_state_files(struct cpu_chart *all_cpu_charts, s
words = procfile_linewords(tsf->ff, l);
if(unlikely(words < 2)) {
- error("Cannot read time_in_state line. Expected 2 params, read %zu.", words);
+ collector_error("Cannot read time_in_state line. Expected 2 params, read %zu.", words);
continue;
}
frequency = str2ull(procfile_lineword(tsf->ff, l, 0));
@@ -273,11 +273,11 @@ static void* wake_cpu_thread(void* core) {
thread = pthread_self();
if(unlikely(pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpu_set))) {
if(unlikely(errors < 8)) {
- error("Cannot set CPU affinity for core %d", *(int*)core);
+ collector_error("Cannot set CPU affinity for core %d", *(int*)core);
errors++;
}
else if(unlikely(errors < 9)) {
- error("CPU affinity errors are disabled");
+ collector_error("CPU affinity errors are disabled");
errors++;
}
}
@@ -312,14 +312,14 @@ static int read_schedstat(char *schedstat_filename, struct per_core_cpuidle_char
if(likely(row_key[0] == 'c' && row_key[1] == 'p' && row_key[2] == 'u')) {
words = procfile_linewords(ff, l);
if(unlikely(words < 10)) {
- error("Cannot read /proc/schedstat cpu line. Expected 9 params, read %zu.", words);
+ collector_error("Cannot read /proc/schedstat cpu line. Expected 9 params, read %zu.", words);
return 1;
}
cores_found++;
size_t core = str2ul(&row_key[3]);
if(unlikely(core >= cores_found)) {
- error("Core %zu found but no more than %zu cores were expected.", core, cores_found);
+ collector_error("Core %zu found but no more than %zu cores were expected.", core, cores_found);
return 1;
}
@@ -343,7 +343,7 @@ static int read_one_state(char *buf, const char *filename, int *fd) {
if(unlikely(ret <= 0)) {
// cannot read that file
- error("Cannot read file '%s'", filename);
+ collector_error("Cannot read file '%s'", filename);
close(*fd);
*fd = -1;
return 0;
@@ -359,7 +359,7 @@ static int read_one_state(char *buf, const char *filename, int *fd) {
*fd = -1;
}
else if(lseek(*fd, 0, SEEK_SET) == -1) {
- error("Cannot seek in file '%s'", filename);
+ collector_error("Cannot seek in file '%s'", filename);
close(*fd);
*fd = -1;
}
@@ -413,14 +413,14 @@ static int read_cpuidle_states(char *cpuidle_name_filename , char *cpuidle_time_
int fd = open(filename, O_RDONLY, 0666);
if(unlikely(fd == -1)) {
- error("Cannot open file '%s'", filename);
+ collector_error("Cannot open file '%s'", filename);
cc->rescan_cpu_states = 1;
return 1;
}
ssize_t r = read(fd, name_buf, 50);
if(unlikely(r < 1)) {
- error("Cannot read file '%s'", filename);
+ collector_error("Cannot read file '%s'", filename);
close(fd);
cc->rescan_cpu_states = 1;
return 1;
@@ -445,7 +445,7 @@ static int read_cpuidle_states(char *cpuidle_name_filename , char *cpuidle_time_
if(unlikely(cs->time_fd == -1)) {
cs->time_fd = open(cs->time_filename, O_RDONLY);
if (unlikely(cs->time_fd == -1)) {
- error("Cannot open file '%s'", cs->time_filename);
+ collector_error("Cannot open file '%s'", cs->time_filename);
cc->rescan_cpu_states = 1;
return 1;
}
@@ -483,7 +483,7 @@ int do_proc_stat(int update_every, usec_t dt) {
*time_in_state_filename = NULL, *schedstat_filename = NULL, *cpuidle_name_filename = NULL, *cpuidle_time_filename = NULL;
static const RRDVAR_ACQUIRED *cpus_var = NULL;
static int accurate_freq_avail = 0, accurate_freq_is_used = 0;
- size_t cores_found = (size_t)processors;
+ size_t cores_found = (size_t)get_system_cpus();
if(unlikely(do_cpu == -1)) {
do_cpu = config_get_boolean("plugin:proc:/proc/stat", "cpu utilization", CONFIG_BOOLEAN_YES);
@@ -494,7 +494,7 @@ int do_proc_stat(int update_every, usec_t dt) {
do_processes = config_get_boolean("plugin:proc:/proc/stat", "processes running", CONFIG_BOOLEAN_YES);
// give sane defaults based on the number of processors
- if(unlikely(processors > 50)) {
+ if(unlikely(get_system_cpus() > 50)) {
// the system has too many processors
keep_per_core_fds_open = CONFIG_BOOLEAN_NO;
do_core_throttle_count = CONFIG_BOOLEAN_NO;
@@ -510,7 +510,7 @@ int do_proc_stat(int update_every, usec_t dt) {
do_cpu_freq = CONFIG_BOOLEAN_YES;
do_cpuidle = CONFIG_BOOLEAN_YES;
}
- if(unlikely(processors > 24)) {
+ if(unlikely(get_system_cpus() > 24)) {
// the system has too many processors
keep_cpuidle_fds_open = CONFIG_BOOLEAN_NO;
}
@@ -585,7 +585,7 @@ int do_proc_stat(int update_every, usec_t dt) {
if(likely(row_key[0] == 'c' && row_key[1] == 'p' && row_key[2] == 'u')) {
words = procfile_linewords(ff, l);
if(unlikely(words < 9)) {
- error("Cannot read /proc/stat cpu line. Expected 9 params, read %zu.", words);
+ collector_error("Cannot read /proc/stat cpu line. Expected 9 params, read %zu.", words);
continue;
}
@@ -712,6 +712,12 @@ int do_proc_stat(int update_every, usec_t dt) {
cpu_chart->rd_idle = rrddim_add(cpu_chart->st, "idle", NULL, multiplier, divisor, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
rrddim_hide(cpu_chart->st, "idle");
+ if (core > 0) {
+ char cpu_core[50 + 1];
+ snprintfz(cpu_core, 50, "cpu%lu", core - 1);
+ rrdlabels_add(cpu_chart->st->rrdlabels, "cpu", cpu_core, RRDLABEL_SRC_AUTO);
+ }
+
if(unlikely(core == 0 && cpus_var == NULL))
cpus_var = rrdvar_custom_host_variable_add_and_acquire(localhost, "active_processors");
}
@@ -930,7 +936,7 @@ int do_proc_stat(int update_every, usec_t dt) {
if(r > 0 && !accurate_freq_is_used) {
accurate_freq_is_used = 1;
snprintfz(filename, FILENAME_MAX, time_in_state_filename, "cpu*");
- info("cpufreq is using %s", filename);
+ collector_info("cpufreq is using %s", filename);
}
}
if (r < 1) {
@@ -938,7 +944,7 @@ int do_proc_stat(int update_every, usec_t dt) {
if(accurate_freq_is_used) {
accurate_freq_is_used = 0;
snprintfz(filename, FILENAME_MAX, scaling_cur_freq_filename, "cpu*");
- info("cpufreq fell back to %s", filename);
+ collector_info("cpufreq fell back to %s", filename);
}
}
@@ -993,13 +999,13 @@ int do_proc_stat(int update_every, usec_t dt) {
}
}
else
- error("Cannot read current process affinity");
+ collector_error("Cannot read current process affinity");
// These threads are very ephemeral and don't need to have a specific name
if(unlikely(pthread_create(&thread, NULL, wake_cpu_thread, (void *)&core)))
- error("Cannot create wake_cpu_thread");
+ collector_error("Cannot create wake_cpu_thread");
else if(unlikely(pthread_join(thread, NULL)))
- error("Cannot join wake_cpu_thread");
+ collector_error("Cannot join wake_cpu_thread");
cpu_states_updated = 1;
}
}
diff --git a/collectors/proc.plugin/proc_vmstat.c b/collectors/proc.plugin/proc_vmstat.c
index b8defc45..638d1690 100644
--- a/collectors/proc.plugin/proc_vmstat.c
+++ b/collectors/proc.plugin/proc_vmstat.c
@@ -100,7 +100,7 @@ int do_proc_vmstat(int update_every, usec_t dt) {
for(l = 0; l < lines ;l++) {
size_t words = procfile_linewords(ff, l);
if(unlikely(words < 2)) {
- if(unlikely(words)) error("Cannot read /proc/vmstat line %zu. Expected 2 params, read %zu.", l, words);
+ if(unlikely(words)) collector_error("Cannot read /proc/vmstat line %zu. Expected 2 params, read %zu.", l, words);
continue;
}
diff --git a/collectors/proc.plugin/sys_block_zram.c b/collectors/proc.plugin/sys_block_zram.c
index 6bae5424..1be725b1 100644
--- a/collectors/proc.plugin/sys_block_zram.c
+++ b/collectors/proc.plugin/sys_block_zram.c
@@ -144,17 +144,17 @@ static int init_devices(DICTIONARY *devices, unsigned int zram_id, int update_ev
snprintfz(filename, FILENAME_MAX, "/dev/%s", de->d_name);
if (unlikely(stat(filename, &st) != 0))
{
- error("ZRAM : Unable to stat %s: %s", filename, strerror(errno));
+ collector_error("ZRAM : Unable to stat %s: %s", filename, strerror(errno));
continue;
}
if (major(st.st_rdev) == zram_id)
{
- info("ZRAM : Found device %s", filename);
+ collector_info("ZRAM : Found device %s", filename);
snprintfz(filename, FILENAME_MAX, "/sys/block/%s/mm_stat", de->d_name);
ff = procfile_open(filename, " \t:", PROCFILE_FLAG_DEFAULT);
if (ff == NULL)
{
- error("ZRAM : Failed to open %s: %s", filename, strerror(errno));
+ collector_error("ZRAM : Failed to open %s: %s", filename, strerror(errno));
continue;
}
device.file = ff;
@@ -170,7 +170,7 @@ static int init_devices(DICTIONARY *devices, unsigned int zram_id, int update_ev
static void free_device(DICTIONARY *dict, const char *name)
{
ZRAM_DEVICE *d = (ZRAM_DEVICE*)dictionary_get(dict, name);
- info("ZRAM : Disabling monitoring of device %s", name);
+ collector_info("ZRAM : Disabling monitoring of device %s", name);
rrdset_obsolete_and_pointer_null(d->st_usage);
rrdset_obsolete_and_pointer_null(d->st_savings);
rrdset_obsolete_and_pointer_null(d->st_alloc_efficiency);
@@ -252,7 +252,7 @@ int do_sys_block_zram(int update_every, usec_t dt) {
ff = procfile_open("/proc/devices", " \t:", PROCFILE_FLAG_DEFAULT);
if (ff == NULL)
{
- error("Cannot read /proc/devices");
+ collector_error("Cannot read /proc/devices");
return 1;
}
ff = procfile_readall(ff);
@@ -267,7 +267,7 @@ int do_sys_block_zram(int update_every, usec_t dt) {
}
procfile_close(ff);
- devices = dictionary_create(DICT_OPTION_SINGLE_THREADED);
+ devices = dictionary_create_advanced(DICT_OPTION_SINGLE_THREADED, &dictionary_stats_category_collectors, 0);
device_count = init_devices(devices, (unsigned int)zram_id, update_every);
}
diff --git a/collectors/proc.plugin/sys_class_infiniband.c b/collectors/proc.plugin/sys_class_infiniband.c
index fca0cb8a..5f5e5323 100644
--- a/collectors/proc.plugin/sys_class_infiniband.c
+++ b/collectors/proc.plugin/sys_class_infiniband.c
@@ -200,7 +200,7 @@ static struct ibport {
#define GEN_DO_HWCOUNTER_READ(NAME, GRP, DESC, DIR, PORT, HW, ...) \
if (HW->file_##NAME) { \
if (read_single_number_file(HW->file_##NAME, (unsigned long long *)&HW->NAME)) { \
- error("cannot read iface '%s' hwcounter '" #HW "'", PORT->name); \
+ collector_error("cannot read iface '%s' hwcounter '" #HW "'", PORT->name); \
HW->file_##NAME = NULL; \
} \
}
@@ -469,7 +469,7 @@ int do_sys_class_infiniband(int update_every, usec_t dt)
snprintfz(buffer, FILENAME_MAX, "%s/%s/%s", ports_dirname, port_dent->d_name, "rate");
char buffer_rate[65];
if (read_file(buffer, buffer_rate, 64)) {
- error("Unable to read '%s'", buffer);
+ collector_error("Unable to read '%s'", buffer);
p->width = 1;
} else {
char *buffer_width = strstr(buffer_rate, "(");
@@ -480,12 +480,11 @@ int do_sys_class_infiniband(int update_every, usec_t dt)
}
if (!p->discovered)
- info(
- "Infiniband card %s port %s at speed %" PRIu64 " width %" PRIu64 "",
- dev_dent->d_name,
- port_dent->d_name,
- p->speed,
- p->width);
+ collector_info("Infiniband card %s port %s at speed %" PRIu64 " width %" PRIu64 "",
+ dev_dent->d_name,
+ port_dent->d_name,
+ p->speed,
+ p->width);
p->discovered = 1;
}
@@ -511,7 +510,7 @@ int do_sys_class_infiniband(int update_every, usec_t dt)
#define GEN_DO_COUNTER_READ(NAME, GRP, DESC, DIR, PORT, ...) \
if (PORT->file_##NAME) { \
if (read_single_number_file(PORT->file_##NAME, (unsigned long long *)&PORT->NAME)) { \
- error("cannot read iface '%s' counter '" #NAME "'", PORT->name); \
+ collector_error("cannot read iface '%s' counter '" #NAME "'", PORT->name); \
PORT->file_##NAME = NULL; \
} \
}
@@ -650,7 +649,7 @@ int do_sys_class_infiniband(int update_every, usec_t dt)
// Unknown vendor, should not happen
else {
- error(
+ collector_error(
"Unmanaged vendor for '%s', do_hwerrors should have been set to no. Please report this bug",
port->name);
port->do_hwerrors = CONFIG_BOOLEAN_NO;
@@ -686,7 +685,7 @@ int do_sys_class_infiniband(int update_every, usec_t dt)
// Unknown vendor, should not happen
else {
- error(
+ collector_error(
"Unmanaged vendor for '%s', do_hwpackets should have been set to no. Please report this bug",
port->name);
port->do_hwpackets = CONFIG_BOOLEAN_NO;
diff --git a/collectors/proc.plugin/sys_class_power_supply.c b/collectors/proc.plugin/sys_class_power_supply.c
index dde42150..ec36a295 100644
--- a/collectors/proc.plugin/sys_class_power_supply.c
+++ b/collectors/proc.plugin/sys_class_power_supply.c
@@ -137,7 +137,7 @@ int do_sys_class_power_supply(int update_every, usec_t dt) {
DIR *dir = opendir(dirname);
if(unlikely(!dir)) {
- error("Cannot read directory '%s'", dirname);
+ collector_error("Cannot read directory '%s'", dirname);
return 1;
}
@@ -247,7 +247,7 @@ int do_sys_class_power_supply(int update_every, usec_t dt) {
if(unlikely(ps->capacity->fd == -1)) {
ps->capacity->fd = open(ps->capacity->filename, O_RDONLY, 0666);
if(unlikely(ps->capacity->fd == -1)) {
- error("Cannot open file '%s'", ps->capacity->filename);
+ collector_error("Cannot open file '%s'", ps->capacity->filename);
power_supply_free(ps);
ps = NULL;
}
@@ -257,7 +257,7 @@ int do_sys_class_power_supply(int update_every, usec_t dt) {
{
ssize_t r = read(ps->capacity->fd, buffer, 30);
if(unlikely(r < 1)) {
- error("Cannot read file '%s'", ps->capacity->filename);
+ collector_error("Cannot read file '%s'", ps->capacity->filename);
power_supply_free(ps);
ps = NULL;
}
@@ -270,7 +270,7 @@ int do_sys_class_power_supply(int update_every, usec_t dt) {
ps->capacity->fd = -1;
}
else if(unlikely(lseek(ps->capacity->fd, 0, SEEK_SET) == -1)) {
- error("Cannot seek in file '%s'", ps->capacity->filename);
+ collector_error("Cannot seek in file '%s'", ps->capacity->filename);
close(ps->capacity->fd);
ps->capacity->fd = -1;
}
@@ -292,7 +292,7 @@ int do_sys_class_power_supply(int update_every, usec_t dt) {
if(unlikely(pd->fd == -1)) {
pd->fd = open(pd->filename, O_RDONLY, 0666);
if(unlikely(pd->fd == -1)) {
- error("Cannot open file '%s'", pd->filename);
+ collector_error("Cannot open file '%s'", pd->filename);
read_error = 1;
power_supply_free(ps);
break;
@@ -301,7 +301,7 @@ int do_sys_class_power_supply(int update_every, usec_t dt) {
ssize_t r = read(pd->fd, buffer, 30);
if(unlikely(r < 1)) {
- error("Cannot read file '%s'", pd->filename);
+ collector_error("Cannot read file '%s'", pd->filename);
read_error = 1;
power_supply_free(ps);
break;
@@ -314,7 +314,7 @@ int do_sys_class_power_supply(int update_every, usec_t dt) {
pd->fd = -1;
}
else if(unlikely(lseek(pd->fd, 0, SEEK_SET) == -1)) {
- error("Cannot seek in file '%s'", pd->filename);
+ collector_error("Cannot seek in file '%s'", pd->filename);
close(pd->fd);
pd->fd = -1;
}
diff --git a/collectors/proc.plugin/sys_devices_system_edac_mc.c b/collectors/proc.plugin/sys_devices_system_edac_mc.c
index 13d20978..fe825096 100644
--- a/collectors/proc.plugin/sys_devices_system_edac_mc.c
+++ b/collectors/proc.plugin/sys_devices_system_edac_mc.c
@@ -30,7 +30,7 @@ static void find_all_mc() {
DIR *dir = opendir(dirname);
if(unlikely(!dir)) {
- error("Cannot read ECC memory errors directory '%s'", dirname);
+ collector_error("Cannot read ECC memory errors directory '%s'", dirname);
return;
}
diff --git a/collectors/proc.plugin/sys_devices_system_node.c b/collectors/proc.plugin/sys_devices_system_node.c
index 90aafd56..068d739d 100644
--- a/collectors/proc.plugin/sys_devices_system_node.c
+++ b/collectors/proc.plugin/sys_devices_system_node.c
@@ -19,7 +19,7 @@ static int find_all_nodes() {
DIR *dir = opendir(dirname);
if(!dir) {
- error("Cannot read NUMA node directory '%s'", dirname);
+ collector_error("Cannot read NUMA node directory '%s'", dirname);
return 0;
}
@@ -134,7 +134,7 @@ int do_proc_sys_devices_system_node(int update_every, usec_t dt) {
if(unlikely(words < 2)) {
if(unlikely(words))
- error("Cannot read %s numastat line %zu. Expected 2 params, read %zu.", m->name, l, words);
+ collector_error("Cannot read %s numastat line %zu. Expected 2 params, read %zu.", m->name, l, words);
continue;
}
diff --git a/collectors/proc.plugin/sys_fs_btrfs.c b/collectors/proc.plugin/sys_fs_btrfs.c
index 3b9841fe..6abfd785 100644
--- a/collectors/proc.plugin/sys_fs_btrfs.c
+++ b/collectors/proc.plugin/sys_fs_btrfs.c
@@ -90,7 +90,7 @@ static inline void btrfs_free_disk(BTRFS_DISK *d) {
}
static inline void btrfs_free_node(BTRFS_NODE *node) {
- // info("BTRFS: destroying '%s'", node->id);
+ // collector_info("BTRFS: destroying '%s'", node->id);
if(node->st_allocation_disks)
rrdset_is_obsolete(node->st_allocation_disks);
@@ -136,7 +136,7 @@ static inline int find_btrfs_disks(BTRFS_NODE *node, const char *path) {
DIR *dir = opendir(path);
if (!dir) {
if(!node->logged_error) {
- error("BTRFS: Cannot open directory '%s'.", path);
+ collector_error("BTRFS: Cannot open directory '%s'.", path);
node->logged_error = 1;
}
return 1;
@@ -149,7 +149,7 @@ static inline int find_btrfs_disks(BTRFS_NODE *node, const char *path) {
|| !strcmp(de->d_name, ".")
|| !strcmp(de->d_name, "..")
) {
- // info("BTRFS: ignoring '%s'", de->d_name);
+ // collector_info("BTRFS: ignoring '%s'", de->d_name);
continue;
}
@@ -200,13 +200,13 @@ static inline int find_btrfs_disks(BTRFS_NODE *node, const char *path) {
// update the values
if(read_single_number_file(d->size_filename, &d->size) != 0) {
- error("BTRFS: failed to read '%s'", d->size_filename);
+ collector_error("BTRFS: failed to read '%s'", d->size_filename);
d->exists = 0;
continue;
}
if(read_single_number_file(d->hw_sector_size_filename, &d->hw_sector_size) != 0) {
- error("BTRFS: failed to read '%s'", d->hw_sector_size_filename);
+ collector_error("BTRFS: failed to read '%s'", d->hw_sector_size_filename);
d->exists = 0;
continue;
}
@@ -257,7 +257,7 @@ static inline int find_all_btrfs_pools(const char *path) {
DIR *dir = opendir(path);
if (!dir) {
if(!logged_error) {
- error("BTRFS: Cannot open directory '%s'.", path);
+ collector_error("BTRFS: Cannot open directory '%s'.", path);
logged_error = 1;
}
return 1;
@@ -271,7 +271,7 @@ static inline int find_all_btrfs_pools(const char *path) {
|| !strcmp(de->d_name, "..")
|| !strcmp(de->d_name, "features")
) {
- // info("BTRFS: ignoring '%s'", de->d_name);
+ // collector_info("BTRFS: ignoring '%s'", de->d_name);
continue;
}
@@ -285,7 +285,7 @@ static inline int find_all_btrfs_pools(const char *path) {
// did we find it?
if(node) {
- // info("BTRFS: already exists '%s'", de->d_name);
+ // collector_info("BTRFS: already exists '%s'", de->d_name);
node->exists = 1;
// update the disk sizes
@@ -295,7 +295,7 @@ static inline int find_all_btrfs_pools(const char *path) {
continue;
}
- // info("BTRFS: adding '%s'", de->d_name);
+ // collector_info("BTRFS: adding '%s'", de->d_name);
// not found, create it
node = callocz(sizeof(BTRFS_NODE), 1);
@@ -309,7 +309,7 @@ static inline int find_all_btrfs_pools(const char *path) {
snprintfz(filename, FILENAME_MAX, "%s/%s/label", path, de->d_name);
if(read_file(filename, label, FILENAME_MAX) != 0) {
- error("BTRFS: failed to read '%s'", filename);
+ collector_error("BTRFS: failed to read '%s'", filename);
btrfs_free_node(node);
continue;
}
@@ -326,21 +326,21 @@ static inline int find_all_btrfs_pools(const char *path) {
//snprintfz(filename, FILENAME_MAX, "%s/%s/sectorsize", path, de->d_name);
//if(read_single_number_file(filename, &node->sectorsize) != 0) {
- // error("BTRFS: failed to read '%s'", filename);
+ // collector_error("BTRFS: failed to read '%s'", filename);
// btrfs_free_node(node);
// continue;
//}
//snprintfz(filename, FILENAME_MAX, "%s/%s/nodesize", path, de->d_name);
//if(read_single_number_file(filename, &node->nodesize) != 0) {
- // error("BTRFS: failed to read '%s'", filename);
+ // collector_error("BTRFS: failed to read '%s'", filename);
// btrfs_free_node(node);
// continue;
//}
//snprintfz(filename, FILENAME_MAX, "%s/%s/quota_override", path, de->d_name);
//if(read_single_number_file(filename, &node->quota_override) != 0) {
- // error("BTRFS: failed to read '%s'", filename);
+ // collector_error("BTRFS: failed to read '%s'", filename);
// btrfs_free_node(node);
// continue;
//}
@@ -351,7 +351,7 @@ static inline int find_all_btrfs_pools(const char *path) {
#define init_btrfs_allocation_field(FIELD) {\
snprintfz(filename, FILENAME_MAX, "%s/%s/allocation/" #FIELD, path, de->d_name); \
if(read_single_number_file(filename, &node->allocation_ ## FIELD) != 0) {\
- error("BTRFS: failed to read '%s'", filename);\
+ collector_error("BTRFS: failed to read '%s'", filename);\
btrfs_free_node(node);\
continue;\
}\
@@ -362,7 +362,7 @@ static inline int find_all_btrfs_pools(const char *path) {
#define init_btrfs_allocation_section_field(SECTION, FIELD) {\
snprintfz(filename, FILENAME_MAX, "%s/%s/allocation/" #SECTION "/" #FIELD, path, de->d_name); \
if(read_single_number_file(filename, &node->allocation_ ## SECTION ## _ ## FIELD) != 0) {\
- error("BTRFS: failed to read '%s'", filename);\
+ collector_error("BTRFS: failed to read '%s'", filename);\
btrfs_free_node(node);\
continue;\
}\
@@ -411,7 +411,7 @@ static inline int find_all_btrfs_pools(const char *path) {
// --------------------------------------------------------------------
// link it
- // info("BTRFS: linking '%s'", node->id);
+ // collector_info("BTRFS: linking '%s'", node->id);
node->next = nodes;
nodes = node;
}
@@ -505,7 +505,7 @@ int do_sys_fs_btrfs(int update_every, usec_t dt) {
|| collect_btrfs_allocation_section_field(metadata, disk_used) != 0
|| collect_btrfs_allocation_section_field(system, disk_total) != 0
|| collect_btrfs_allocation_section_field(system, disk_used) != 0) {
- error("BTRFS: failed to collect physical disks allocation for '%s'", node->id);
+ collector_error("BTRFS: failed to collect physical disks allocation for '%s'", node->id);
// make it refresh btrfs at the next iteration
refresh_delta = refresh_every;
continue;
@@ -515,7 +515,7 @@ int do_sys_fs_btrfs(int update_every, usec_t dt) {
if(do_allocation_data != CONFIG_BOOLEAN_NO) {
if (collect_btrfs_allocation_section_field(data, total_bytes) != 0
|| collect_btrfs_allocation_section_field(data, bytes_used) != 0) {
- error("BTRFS: failed to collect allocation/data for '%s'", node->id);
+ collector_error("BTRFS: failed to collect allocation/data for '%s'", node->id);
// make it refresh btrfs at the next iteration
refresh_delta = refresh_every;
continue;
@@ -527,7 +527,7 @@ int do_sys_fs_btrfs(int update_every, usec_t dt) {
|| collect_btrfs_allocation_section_field(metadata, bytes_used) != 0
|| collect_btrfs_allocation_field(global_rsv_size) != 0
) {
- error("BTRFS: failed to collect allocation/metadata for '%s'", node->id);
+ collector_error("BTRFS: failed to collect allocation/metadata for '%s'", node->id);
// make it refresh btrfs at the next iteration
refresh_delta = refresh_every;
continue;
@@ -537,7 +537,7 @@ int do_sys_fs_btrfs(int update_every, usec_t dt) {
if(do_allocation_system != CONFIG_BOOLEAN_NO) {
if (collect_btrfs_allocation_section_field(system, total_bytes) != 0
|| collect_btrfs_allocation_section_field(system, bytes_used) != 0) {
- error("BTRFS: failed to collect allocation/system for '%s'", node->id);
+ collector_error("BTRFS: failed to collect allocation/system for '%s'", node->id);
// make it refresh btrfs at the next iteration
refresh_delta = refresh_every;
continue;