get system info? (linux/unix)

Discussion in 'C++' started by Mr. S, Mar 29, 2005.

  1. Mr. S

    Mr. S Guest

    Hi!

    How can I retrive system infos under linux/unix? I want to know CPU
    frequency, CPU usage, RAM, RAM usage.

    THX
    Mr. S
     
    Mr. S, Mar 29, 2005
    #1
    1. Advertisements

  2. Probably ask in a linux programming newsgroup.

    - JFA1
     
    James Aguilar, Mar 29, 2005
    #2
    1. Advertisements

  3. Mr. S

    marbac Guest

    Open the files in /proc and parse for the info.
    e.g. cpuinfo: /proc/cpuinfo
     
    marbac, Mar 29, 2005
    #3
  4. processor : 0
    vendor_id : GenuineIntel
    cpu family : 15
    model : 2
    model name : Intel(R) Pentium(R) 4 CPU 3.00GHz
    stepping : 9
    cpu MHz : 2994.945
    cache size : 512 KB
    physical id : 0
    siblings : 1
    fdiv_bug : no
    hlt_bug : no
    f00f_bug : no
    coma_bug : no
    fpu : yes
    fpu_exception : yes
    cpuid level : 2
    wp : yes
    flags : fpu vme de pse tsc msr pae mce \
    cx8 apic sep mtrr pge mca cmov pat pse36 clflush \
    dts acpi mmx fxsr sse sse2 ss ht tm
    bogomips : 5976.88
    total: used: free: shared: buffers: cached:
    Mem: 3169955840 2455195648 714760192 0 77500416
    2259369984
    Swap: 6440329216 8298496 6432030720
    MemTotal: 3095660 kB
    MemFree: 698008 kB
    MemShared: 0 kB
    Buffers: 75684 kB
    Cached: 2204828 kB
    SwapCached: 1588 kB
    Active: 1527844 kB
    ActiveAnon: 6020 kB
    ActiveCache: 1521824 kB
    Inact_dirty: 200812 kB
    Inact_laundry: 232080 kB
    Inact_clean: 324152 kB
    Inact_target: 456976 kB
    HighTotal: 2228160 kB
    HighFree: 683172 kB
    LowTotal: 867500 kB
    LowFree: 14836 kB
    SwapTotal: 6289384 kB
    SwapFree: 6281280 kB
     
    E. Robert Tisdale, Mar 29, 2005
    #4
  5. Le Mon, 28 Mar 2005 15:18:27 -0800, Mr. S a écrit :
    you can use a library such as libgtop.
     
    =?iso-8859-1?q?Beno=EEt_Dejean?=, Mar 29, 2005
    #5
  6. Mr. S

    Mr. S Guest

    Thanks a lot Mr. Tisdale! That's the right information!

    THX
    Mr. S
     
    Mr. S, Mar 29, 2005
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.