12.07.2015 Views

PDF (PDF) - SIOS Technology Corp. Documentation

PDF (PDF) - SIOS Technology Corp. Documentation

PDF (PDF) - SIOS Technology Corp. Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

収 集 した 詳 細 変 化 率 データの 解 析roc-calc-diskstats#!/usr/bin/perl# Copyright (c) 2011, <strong>SIOS</strong> <strong>Technology</strong>, <strong>Corp</strong>.# Author:Paul Clementsuse strict;sub msg {printf STDERR @_;}sub dbg {return if (!$ENV{'ROC_DEBUG'});msg @_;}$0 =~ s@^.*/@@; # basenamesub usage {msg "Usage:$0 [dev-list]\n";msg "\n";msg "This utility takes a /proc/diskstats output file that contains\n";msg "output, logged over time, and calculates the rate of change of\n";msg "the disks in the dataset\n";msg "OUTPUT_CSV=1 set in env. dumps the full stats to a CSV file on STDERR\n";msg "\n";msg "Example:$0 1hour \"jun 23 12pm\" steeleye-iostat.txt sdg,sdh\n";msg "\n";msg "interval - interval between samples\n";msg "start time - the time when the sampling starts\n";msg "iostat-data-file - collect this with a cron job like:\n";msg "\t0 * * * * (date ; cat /proc/diskstats) >> /root/diskstats.txt\n";msg "dev-list - list of disks you want ROC for (leave blank for all)\n";exit 1;}usage if (@ARGV < 3);my $interval = TimeHuman($ARGV[0]);my $starttime = epoch($ARGV[1]);my $file = $ARGV[2];my $blksize = 512; # /proc/diskstats is in sectorsmy %devs = map { $_ => 1 } split /,/, $ARGV[3];my %stat;my $firsttime;SteelEye Protection Suite for Linux Technical <strong>Documentation</strong>Page 267

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!