Re: auto_nlist failed on cp_time at location 1



In the last episode (Apr 24), Tim Stoddard said:
I applied your patch by hand and recompiled/reinstalled net-snmp,
however I am still seeing the same error just on a different memory
address now.

Apr 24 10:16:41 shaggy snmpd[73273]: kvm_read(*, 1, 0xbf7fe830, 20) = -1: kvm_read: Bad address
Apr 24 10:16:41 shaggy snmpd[73273]: auto_nlist failed on cp_time at location 1
Apr 24 10:16:46 shaggy snmpd[73273]: kvm_read(*, 1, 0xbf7fe830, 20) = -1: kvm_read: Bad address
Apr 24 10:16:46 shaggy snmpd[73273]: auto_nlist failed on cp_time at location 1
Apr 24 10:16:51 shaggy snmpd[73273]: kvm_read(*, 1, 0xbf7fe830, 20) = -1: kvm_read: Bad address
Apr 24 10:16:51 shaggy snmpd[73273]: auto_nlist failed on cp_time at location 1

Hm. It looks like net-snmp has two different pieces of code that both
do the same thing (read CPU and vmstat info). I wonder which OIDs
trigger them on your system? On my system, walking
enterprises.ucdavis.systemStats uses the cpu_nlist.c code. Here's a
patch for the other file (vmstat_freebsd2.c); it's not even compiled on
my 7-stable system, so I can't verify that it's correct. I'm not sure
why my first patch didn't apply; I attached it straight out of my
net-snmp/files/ directory.

--
Dan Nelson
dnelson@xxxxxxxxxxxxxxx
--- agent/mibgroup/ucd-snmp/vmstat_freebsd2.c 2008-04-24 10:25:59.834152091 -0500
+++ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c 2008-04-24 10:25:59.834152091 -0500
@@ -189,13 +189,15 @@
* Update structures (only if time has passed)
*/
if (time_new != time_old) {
+ int size;
time_diff = time_new - time_old;
time_old = time_new;

/*
* CPU usage
*/
- auto_nlist(CPTIME_SYMBOL, (char *) cpu_new, sizeof(cpu_new));
+ size = sizeof(cpu_new);
+ sysctlbyname("kern.cp_time", &cpu_new, &size, NULL, 0);

cpu_total = 0;

_______________________________________________
freebsd-stable@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@xxxxxxxxxxx"

Relevant Pages

  • Re: Please Help
    ... What has been happening lately is any browser I use starts to eat up ... memory that starts ... dropping like a rock while the CPU usage is listed as just a few %. ... I have Exceptions Disabled and when I go to delete these ...
    (comp.security.firewalls)
  • Please Help
    ... What has been happening lately is any browser I use starts to eat up ... memory that starts ... dropping like a rock while the CPU usage is listed as just a few %. ... I have Exceptions Disabled and when I go to delete these new ...
    (comp.security.firewalls)
  • Re: Error Using Remoting, System.OutOfMemoryException anyone ever seen this?
    ... it to transfer the DataSet to the client like I wanted. ... >> As Integer, ByVal pnUserID As Integer, ByVal piView As Short) As DataSet ... >> As for memory use, the client which is hung is not peaked out of memory, ... >> it is running 1% cpu usage and barely any memory used. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: plotting cpu and mem consumption
    ... >>amount of cpu usage and memory consumption of the program. ... > profiling library (or libraries, ...
    (comp.lang.cpp)
  • Re: XP Professional SP@ is slow --- very slow
    ... The second most probable cause of slow performance is simply that the applications you have open, including background processes, require more memory than your computer has to offer. ... Go to the Processes tab and display the processes in decreasing order of CPU usage. ... If your computer is of recent vintage, say, over the last four years, then unless you're running a busy server you won't see a big speed improvement from defragmenting, even with third-party tools. ... The only thing I can think of that would cause such a CPU usage is a background program runnibg somewhere, ...
    (microsoft.public.windowsxp.perform_maintain)