This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Saving Snapshots of TOP automatically every half hour

I have a problem I am trying to debug where my astaro's load is locking for long periods of time.  The thing is, I don't necessarily notice it until the next day when I get the report so I can't see what top is showing (I reboot automatically at 6am).

I am not a linux guru, but something tells me that a script for this wouldn't be too difficult.  Any ideas?


This thread was automatically locked due to age.
Parents Reply Children
  • Thanks for the help, but I need a little more...
    How do I get that off the box?  I have the logs automatically copy to a UNC share on the network, can I make this do the same? 

    How do I save the date and time in the file name?
  • top -b -n 1 > /tmp/top-report-`date '+%Y-%m-%d-%H%M'`.txt

    would create one file each minute, with the date in the filename.

    You don't want to let this run too long, or you'll have 1000's of files created.

    You could probably do a SMB mount...
    mkdir /tmp/toplog
    mount -t cifs ...

    Barry
  • BTW, Astaro has some SNMP traps for monitoring; you can point Cacti or whatever at it and graph the load.
    It won't tell you what process is causing the load though.

    Barry