From: <no...@so...> - 2002-10-31 23:16:14
|
Bugs item #492310, was opened at 2001-12-12 21:00 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=492310&group_id=12694 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: NET-SNMPD will not return correct value Initial Comment: NET-SNMPD will not return correct value if free/available/total of memory/size is greater than 2G on Solaris 2.6 7 8. ---------------------------------------------------------------------- Comment By: Ben Stern (bstern) Date: 2002-10-31 18:16 Message: Logged In: YES user_id=146989 This is due to a bug in memory_solaris2.c in agent/mibgroup/ucd-snmp, as far as I can tell. [All of my line numbers are relative to ucd-snmp 4.2.6 unpatched.] I replaced the lines: ksp1 = kstat_lookup(kstat_fd, "unix", 0, "system_pages"); kstat_read(kstat_fd, ksp1, 0); kn = kstat_data_lookup(ksp1, "physmem"); long_ret = kn->value.ul * (getpagesize() / 1024); with long_ret = sysconf(_SC_PHYS_PAGES) * (getpagesize()/1024); (starting at line 121) and probably more importantly, replaced line 128 (the old line 128, which read: long_ret = (getTotalFree() - getFreeSwap()) * (getpagesize() / 1024); with: long_ret = sysconf(_SC_AVPHYS_PAGES) * (getpagesize()/1024); since the algorithm for finding free memory in getTotalFree() uses the same counting process as getFreeSwap(), so it subtracts x from x and always gets 0. When I changed both of those portions, ucd_snmpd stopped returning 0 for free memory, and also started return swap in K rather than in 512 byte chunks. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-12-16 20:22 Message: Logged In: NO The package I'm using is ucd-snmp-4.2.3. The OID I'm trying to retrive is 1.3.6.1.4.1.2021.4.4.0 1.3.6.1.4.1.2021.4.3.0 1.3.6.1.4.1.2021.4.6.0 ---------------------------------------------------------------------- Comment By: John Naylon (jbpn) Date: 2001-12-14 08:29 Message: Logged In: YES user_id=93926 Which version of the package are you using? And which specific OID are you retrieving to get these values? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=492310&group_id=12694 |