From: SourceForge.net <no...@so...> - 2010-09-06 12:23:35
|
Bugs item #3060360, was opened at 2010-09-06 14:23 Message generated for change (Tracker Item Submitted) made by johanhuysmans You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=3060360&group_id=12694 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: agent Group: linux Status: Open Resolution: None Priority: 5 Private: No Submitted By: Johan Huysmans (johanhuysmans) Assigned to: Nobody/Anonymous (nobody) Summary: Problem with counting procs Initial Comment: CentOS 5 - net-snmpd-5.3.2.2-9 Every 3 seconds the prErrorFlags are checked from the configured procs. But on some moments it falsely detects an error, which is gone during the next check. Investigating this we didn't notice any strange behavior on the machines, the specific process did not restart. I enabled debugging and noticed that whenever such false positive occurs the list of running processes is much smaller. The debugging output also showed the function that handles the process counting and therefore I verified that piece of code. As it was reading from /proc/*/status I wrote a bash script which did exactly the same, but the problem never occurred. I copied the sh_count_proc function out of snmpd code into a separate program doing only the proc check. And the problem occurred again. Every time the specific proc isn't found the debug output "Could not fgets for /proc/<pid>/status" is printed as last line. In the code you can see that in the if block a break is used and no continue. Is there a reason why there is a break instead of a continue? I attached my test script. This function is copied from the latest stable snmp-5-5 from file: agent/mibgroup/ucd-snmp/proc.c ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=3060360&group_id=12694 |