Results 1 to 4 of 4

Thread: top output all cpus without user-action

  1. #1
    Join Date
    May 2014
    Beans
    2

    top output all cpus without user-action

    Every hour I got cron running:

    Code:
    top -d 99 -n 1 -b > /..../server_top_output.txt
    For a tool that animates server stats. The problem is it's only spitting out one CPU, not the 8 CPU's on my virtual ubuntu server.

    When in top myself, I hit `1` and it reveals all 8.. but I can't figure out how to get it into my cronjob command.

    Any help or guidance would be greatly appreciated.
    Last edited by darkodonie; May 21st, 2014 at 06:35 PM.

  2. #2
    Join Date
    Jun 2007
    Beans
    11,156

    Re: bash output all cpus without user-action

    Get top the way you want it (i.e press '1' top show all CPU's), and then press 'W' (Shift + w) to write a configuration file. I tested it with your command and it works.

  3. #3
    Join Date
    May 2014
    Beans
    2

    Re: top output all cpus without user-action

    Cleaver! Exactly what I was looking for. Thank you so much!

  4. #4
    Join Date
    Feb 2008
    Location
    Pelican Bay Correctional
    Beans
    Hidden!

    Re: top output all cpus without user-action

    wrt: ~/.toprc
    I use this in mine:
    Code:
    RCfile for "top with windows"        # shameless braggin'
    Id:a, Mode_altscr=0, Mode_irixps=1, Delay_time=3.000, Curwin=0
    Def    fieldscur=AEHIOQTWKNMbcdfgjplrsuvyzX
        winflags=30137, sortindx=13, maxtasks=20
        summclr=1, msgsclr=1, headclr=3, taskclr=1
    Job    fieldscur=ABcefgjlrstuvyzMKNHIWOPQDX
        winflags=62777, sortindx=0, maxtasks=0
        summclr=6, msgsclr=6, headclr=7, taskclr=6
    Mem    fieldscur=ANOPQRSTUVbcdefgjlmyzWHIKX
        winflags=62777, sortindx=13, maxtasks=0
        summclr=5, msgsclr=5, headclr=4, taskclr=5
    Usr    fieldscur=ABDECGfhijlopqrstuvyzMKNWX
        winflags=62777, sortindx=4, maxtasks=0
        summclr=3, msgsclr=3, headclr=2, taskclr=3
    seems to show me all CPUs and shows the full path of each command.

    Hope that's helpful.
    What's a landing but a take off in reverse?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •