diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:19:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:20:17 +0000 |
commit | a64a253794ac64cb40befee54db53bde17dd0d49 (patch) | |
tree | c1024acc5f6e508814b944d99f112259bb28b1be /collectors/proc.plugin/proc_net_sockstat.c | |
parent | New upstream version 1.10.0+dfsg (diff) | |
download | netdata-upstream/1.11.0+dfsg.tar.xz netdata-upstream/1.11.0+dfsg.zip |
New upstream version 1.11.0+dfsgupstream/1.11.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | collectors/proc.plugin/proc_net_sockstat.c (renamed from src/proc_net_sockstat.c) | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/src/proc_net_sockstat.c b/collectors/proc.plugin/proc_net_sockstat.c index db3070660..0c3b6e196 100644 --- a/src/proc_net_sockstat.c +++ b/collectors/proc.plugin/proc_net_sockstat.c @@ -1,4 +1,8 @@ -#include "common.h" +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "plugin_proc.h" + +#define PLUGIN_PROC_MODULE_NET_SOCKSTAT_NAME "/proc/net/sockstat" static struct proc_net_sockstat { kernel_uint_t sockets_used; @@ -56,9 +60,9 @@ static int read_tcp_mem(void) { // fprintf(stderr, "TCP MEM low = %llu, pressure = %llu, high = %llu\n", low, pressure, high); - rrdvar_custom_host_variable_set(localhost, tcp_mem_low_threshold, low * sysconf(_SC_PAGESIZE) / 1024); - rrdvar_custom_host_variable_set(localhost, tcp_mem_pressure_threshold, pressure * sysconf(_SC_PAGESIZE) / 1024); - rrdvar_custom_host_variable_set(localhost, tcp_mem_high_threshold, high * sysconf(_SC_PAGESIZE) / 1024); + rrdvar_custom_host_variable_set(localhost, tcp_mem_low_threshold, low * sysconf(_SC_PAGESIZE) / 1024.0); + rrdvar_custom_host_variable_set(localhost, tcp_mem_pressure_threshold, pressure * sysconf(_SC_PAGESIZE) / 1024.0); + rrdvar_custom_host_variable_set(localhost, tcp_mem_high_threshold, high * sysconf(_SC_PAGESIZE) / 1024.0); return 0; } @@ -229,9 +233,9 @@ int do_proc_net_sockstat(int update_every, usec_t dt) { , NULL , "IPv4 Sockets Used" , "sockets" - , "proc" - , "net/sockstat" - , 2400 + , PLUGIN_PROC_NAME + , PLUGIN_PROC_MODULE_NET_SOCKSTAT_NAME + , NETDATA_CHART_PRIO_IPV4_SOCKETS , update_every , RRDSET_TYPE_LINE ); @@ -264,9 +268,9 @@ int do_proc_net_sockstat(int update_every, usec_t dt) { , NULL , "IPv4 TCP Sockets" , "sockets" - , "proc" - , "net/sockstat" - , 2500 + , PLUGIN_PROC_NAME + , PLUGIN_PROC_MODULE_NET_SOCKSTAT_NAME + , NETDATA_CHART_PRIO_IPV4_TCP_SOCKETS , update_every , RRDSET_TYPE_LINE ); @@ -302,9 +306,9 @@ int do_proc_net_sockstat(int update_every, usec_t dt) { , NULL , "IPv4 TCP Sockets Memory" , "KB" - , "proc" - , "net/sockstat" - , 4000 + , PLUGIN_PROC_NAME + , PLUGIN_PROC_MODULE_NET_SOCKSTAT_NAME + , NETDATA_CHART_PRIO_IPV4_TCP_MEM , update_every , RRDSET_TYPE_AREA ); @@ -334,9 +338,9 @@ int do_proc_net_sockstat(int update_every, usec_t dt) { , NULL , "IPv4 UDP Sockets" , "sockets" - , "proc" - , "net/sockstat" - , 2600 + , PLUGIN_PROC_NAME + , PLUGIN_PROC_MODULE_NET_SOCKSTAT_NAME + , NETDATA_CHART_PRIO_IPV4_UDP , update_every , RRDSET_TYPE_LINE ); @@ -366,9 +370,9 @@ int do_proc_net_sockstat(int update_every, usec_t dt) { , NULL , "IPv4 UDP Sockets Memory" , "KB" - , "proc" - , "net/sockstat" - , 2603 + , PLUGIN_PROC_NAME + , PLUGIN_PROC_MODULE_NET_SOCKSTAT_NAME + , NETDATA_CHART_PRIO_IPV4_UDP_MEM , update_every , RRDSET_TYPE_AREA ); @@ -398,9 +402,9 @@ int do_proc_net_sockstat(int update_every, usec_t dt) { , NULL , "IPv4 UDPLITE Sockets" , "sockets" - , "proc" - , "net/sockstat" - , 2602 + , PLUGIN_PROC_NAME + , PLUGIN_PROC_MODULE_NET_SOCKSTAT_NAME + , NETDATA_CHART_PRIO_IPV4_UDPLITE , update_every , RRDSET_TYPE_LINE ); @@ -430,9 +434,9 @@ int do_proc_net_sockstat(int update_every, usec_t dt) { , NULL , "IPv4 RAW Sockets" , "sockets" - , "proc" - , "net/sockstat" - , 3010 + , PLUGIN_PROC_NAME + , PLUGIN_PROC_MODULE_NET_SOCKSTAT_NAME + , NETDATA_CHART_PRIO_IPV4_RAW , update_every , RRDSET_TYPE_LINE ); @@ -462,9 +466,9 @@ int do_proc_net_sockstat(int update_every, usec_t dt) { , NULL , "IPv4 FRAG Sockets" , "fragments" - , "proc" - , "net/sockstat" - , 3010 + , PLUGIN_PROC_NAME + , PLUGIN_PROC_MODULE_NET_SOCKSTAT_NAME + , NETDATA_CHART_PRIO_IPV4_FRAGMENTS , update_every , RRDSET_TYPE_LINE ); @@ -494,9 +498,9 @@ int do_proc_net_sockstat(int update_every, usec_t dt) { , NULL , "IPv4 FRAG Sockets Memory" , "KB" - , "proc" - , "net/sockstat" - , 3020 + , PLUGIN_PROC_NAME + , PLUGIN_PROC_MODULE_NET_SOCKSTAT_NAME + , NETDATA_CHART_PRIO_IPV4_FRAGMENTS_MEM , update_every , RRDSET_TYPE_AREA ); |