[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Where can I get the source code of top?
On Sun, 2008-04-06 at 19:37 +0800, Kun Niu wrote:
> Dear all,
> I'm trying to write a utility for system monitor.
> My netbsd version is 3.1.
> It needs to gather information about the system cpu usage data like
Looking at how top(8) does it is going to get ugly -- fast.
What you want is SNMP. Check out Net-SNMP in pkgsrc in net/net-snmp/
SNMP abstracts all of those OS/Kernel-specific data structures into MIB
data, then makes millionaires out of people who can tolerate it.
> cpu load in user mode, system mode, idle task and so on.
> On linux, I have the file "/proc/stat".
> But I don't have it on netbsd.
> However, I find that top can get the information I want.
> So which file should I rely on on netbsd?
> Or where can I get the source code of top for netbsd?
> Thanks in advance for any hint.
IMPORTANT: This message contains confidential information and is intended only
for the individual named. If the reader of this message is not an intended
recipient (or the individual responsible for the delivery of this message to an
intended recipient), please be advised that any re-use, dissemination,
distribution or copying of this message is prohibited. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system.
Main Index |
Thread Index |