Tested on FreeBSD 10.1 and 9.3.
net-snmp-5.7.2_16 works fine, show real process number (checked with top and ps):
/usr/local/libexec/nagios/check_snmp -P 2c -o .1.3.6.1.2.1.25.1.6.0 -H edited -C edited -w 300 -c 350
SNMP OK - 115 | iso.3.6.1.2.1.25.1.6.0=115;300;350;
After update to net-snmp-5.7.3_1 top and ps still show ca. 115 processes, but snmpd says different:
/usr/local/libexec/nagios/check_snmp -P 2c -o .1.3.6.1.2.1.25.1.6.0 -H edited -C edited -w 300 -c 350
SNMP CRITICAL - 429 | iso.3.6.1.2.1.25.1.6.0=429;300;350;
Downgrade to 5.7.2 fixes this problem.
Ah, yes, you are right. The hrSWRunTable now includes (kernel)threads, and that makes a big difference when it is used as the source for the system number of processes. It is now more like "ps auxH".
This probably warrants a config option that defaults to the old behavior.
The attached patch should allow you to change the behavior back to the earlier release. Will that work for you?
Sounds good. Will you commit this to master as well?
Thanks,
-r
If you tell me it is OK :-)
Original submitter is reporting that the patch didn't do the trick. Any
thoughts?
Here's the email I received:
I don't think that patch fixed the problem.
pkg info -o net-snmp
net-snmp-5.7.3_3 net-mgmt/net-snmp
ps auxfw | wc -l
/usr/local/libexec/nagios/check_snmp -P 2c -o .1.3.6.1.2.1.25.1.6.0 -H edited
-C edited -w 300 -c 350
SNMP CRITICAL - 814 | iso.3.6.1.2.1.25.1.6.0=814;300;350;
I'm the original submitter, if I could provide any additional info don't hesitate to ask.
Silly oversight. This new patch should actually use the config parameter :(
Please try that instead, and add "count_kthreads 0" in your snmpd.conf.
Shouldn't this default to off so that it mimics the behavior of the
previous release?
-r
Now it works, thank you.
BTW: I also think that count_kthreads 0 should be default.
Last edit: Lukasz Wasikowski 2015-02-17
Yes and no. For Linux it has counted kernel threads for a long time, so the default should be OS dependent then :-(
But you are probably right, I will update the patch