Find the answer to your Linux question:
Results 1 to 2 of 2
I have a CentOS 5.5 x64 installation and am trying to use dstat to record historical stats every second. Minimal installation. dstat is version 0.7.2, Kernel is 2.6.18-194.11.3.el5, Python 2.4.3. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    1

    CentOS 5.5 + cron + dstat + csv logging


    I have a CentOS 5.5 x64 installation and am trying to use dstat to record historical stats every second. Minimal installation. dstat is version 0.7.2, Kernel is 2.6.18-194.11.3.el5, Python 2.4.3.

    I have this script:

    /etc/cron.hourly/dstat_hourly.sh

    Script contains:

    NOW=$(date +"%Y%m%d%H")
    LOGFILE="/var/log/dstat/dstat.$NOW.log"
    dstat --output $LOGFILE --noheaders -t -af -m -D sda,sdb -r 1 3600


    When I run the script as root within an ssh shell, it will create a log file and append until I break out. It also displays the data on the screen.

    But, when cron runs it, I only get 25 lines in the CSV file and then it stops.

    25 is very oddly the same as a default line count for the terminal.

    I've tried swapping arguments around and nothing helps.

    What am I doing wrong?

  2. #2
    Just Joined!
    Join Date
    Jun 2012
    Posts
    1

    The same problem

    I have the same problem. Have you resolve it?

    Quote Originally Posted by azherdev View Post
    I have a CentOS 5.5 x64 installation and am trying to use dstat to record historical stats every second. Minimal installation. dstat is version 0.7.2, Kernel is 2.6.18-194.11.3.el5, Python 2.4.3.

    I have this script:

    /etc/cron.hourly/dstat_hourly.sh

    Script contains:

    NOW=$(date +"%Y%m%d%H")
    LOGFILE="/var/log/dstat/dstat.$NOW.log"
    dstat --output $LOGFILE --noheaders -t -af -m -D sda,sdb -r 1 3600


    When I run the script as root within an ssh shell, it will create a log file and append until I break out. It also displays the data on the screen.

    But, when cron runs it, I only get 25 lines in the CSV file and then it stops.

    25 is very oddly the same as a default line count for the terminal.

    I've tried swapping arguments around and nothing helps.

    What am I doing wrong?

Posting Permissions

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