Skip to content

Start/stop asynchronous sar (from sysstat) and a optionnal command on display.

Notifications You must be signed in to change notification settings

sathlan/monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monitor

NAME

monitor : a simple system statistic wrapper around sar and others.

The source is at github.

SYNOPSIS

Monitor is a system statistics collector. Useful for testing.

 monitor [--help|-h] [--version|-v]
          --action|-a      <start|stop>
          --log|-l         <file>
          [--command|-d    <command:arg1,arg2>]

DESCRIPTION

This script start a asynchronous sar collect with 1 second interval in the background and another in the foreground as an option.

This is useful while testing a system to collect:

  • every possible statistic with sar;
  • give the user immediate feedback on the particular subsystem the user is testing.

It as the ability to properly kill itself when the tests are terminated.

USAGE

The synopsis and the example describe the usage. The only catch is for the free form command that can be started in the foreground.

The format is : <command name>:<options separated by comma>

If one needs any commas in the option string, they should be escaped like this : _,_.

EXAMPLE

Start a disk intensive test. Then, use monitor to collect every statistic in a file, here db.log, and start a dstat -df -Dsda,dm-0 in the foreground:

monitor -a start -l db.log -c dstat:-df,-Dsda1_,_dm-0

Notice how the comma is escaped with ,.

The test end, so let’s stop the monitoring:

monitor -a stop

Now, enjoy the billion records you’ve got in db.log in csv format:

sadf -d -P ALL  -- -A 1 1000 db.log > metrics.csv

BUGS

The sar utility imply a Linux based system as it’s not available in (Free)BSD system. Maybe dtrace can fill the gap. If anyone has pointers, there are welcome.

Only one monitor process should be running, but the utility doesn’t enforce it.

This utility is Debian based as the sadc command path is hardcoded. See SAR at the top of the file, to change it

This utility has been tested on Debian Squeeze only.

Fill issues there: https://github.com/sathlan/monitor/issues

SEE ALSO

  1. sar: sysstat
  2. roundup: for the tests.

AUTHOR

sathlan <[email protected]>

COPYRIGHT

This software is Copyright (c) 2012 by sathlan.

This is free software, licensed under:

The GNU Lesser General Public License, Version 3, June 2007

About

Start/stop asynchronous sar (from sysstat) and a optionnal command on display.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages