简体   繁体   中英

How do I see linux kernel SNMP counters?

The kernel has a bunch of SNMP counters it increments under various situations, and I want to get the current values on my system. I found nstat , but that does not show all the counters (even with the -z option). For example, I want to see the value of "XfrmInStateSeqError", which is incremented in net/xfrm/xfrm_input.c:

if (async && x->repl->check(x, skb, seq)) {
  XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATESEQERROR);
  goto drop_unlock;
}

The system in question is Ubuntu 12.04 running kernel 3.2.0.

On my Debian it is just not compiled with kernel :

grep XFRM_STATISTICS /lib/modules/3.1.0-1-amd64/build/.config
# CONFIG_XFRM_STATISTICS is not set

hence no /proc/net/xfrm_stat

i guess setting CONFIG_XFRM_STATISTICS and recompiling kernel will do it...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM