+++ This bug was initially created as a clone of Bug #1461666 +++ Description of problem: Configure following lines in /etc/snmp/snmpd.conf, in order to monitor number of runnig processes by net-snmp. proc systemd proc sshd In case of systemd, the snmpd failed to collect number of running processes. In case of "other than systemd", the snmpd successfully collect number of running processes. Affected version net-snmp-5.7.3 How reproducible: Always Steps to Reproduce: 1. Add following 2 lines in /etc/snmp/snmpd.conf proc systemd proc sshd 2. Restart net-snmpd # systemctl restart snmpd.service 3. Access MIB snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.2021.2 Actual results: # snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.2021.2 UCD-SNMP-MIB::prIndex.1 = INTEGER: 1 UCD-SNMP-MIB::prIndex.2 = INTEGER: 2 UCD-SNMP-MIB::prNames.1 = STRING: systemd UCD-SNMP-MIB::prNames.2 = STRING: sshd UCD-SNMP-MIB::prMin.1 = INTEGER: 1 UCD-SNMP-MIB::prMin.2 = INTEGER: 1 UCD-SNMP-MIB::prMax.1 = INTEGER: 0 UCD-SNMP-MIB::prMax.2 = INTEGER: 0 UCD-SNMP-MIB::prCount.1 = INTEGER: 0 <== Always 0 UCD-SNMP-MIB::prCount.2 = INTEGER: 8 <== Expected UCD-SNMP-MIB::prErrorFlag.1 = INTEGER: error(1) <= Not expected UCD-SNMP-MIB::prErrorFlag.2 = INTEGER: noError(0) UCD-SNMP-MIB::prErrMessage.1 = STRING: No systemd process running <= not expected UCD-SNMP-MIB::prErrMessage.2 = STRING: UCD-SNMP-MIB::prErrFix.1 = INTEGER: noError(0) UCD-SNMP-MIB::prErrFix.2 = INTEGER: noError(0) UCD-SNMP-MIB::prErrFixCmd.1 = STRING: UCD-SNMP-MIB::prErrFixCmd.2 = STRING: Expected results: prCount for systemd should be same as running systemd processes. Additional info: Same test on Fedora 24, the prCount for systemd is 1. systemd-229-20.fc24.x86_64 net-snmp-5.7.3-13.fc24.x86_64 Judging from these test result, I suspect something wrong wrong with systemd-219 side. --- Additional comment from Lukáš Nykrýn on 2017-06-15 07:27:58 EDT --- Well I know nothing about net-snmp especially how it determines running processes. ALso the results on fedora looks fishy, since systemd runs as one process. Reassigning to net-snmp, so someone more qualified in this area could check it. --- Additional comment from Josef Ridky on 2017-07-19 10:03 EDT --- I apologize for later answer. Here is proposed patch, which solves described problem. Issue was caused by wrongly used iterator, which iterates thru net-snmp structure and always ignore first record.
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle. Changing version to '27'.
Commit: https://src.fedoraproject.org/rpms/net-snmp/c/3d45358cc7c255e5464fbba0b5b7481ae681a1d3 Build: https://koji.fedoraproject.org/koji/buildinfo?buildID=1062821