monitor : a simple system statistic wrapper around sar and others.
The source is at github.
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>]
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.
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 : _,_
.
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
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
sar
: sysstatroundup
: for the tests.
sathlan <[email protected]>
This software is Copyright (c) 2012 by sathlan.
This is free software, licensed under:
The GNU Lesser General Public License, Version 3, June 2007