check_iostat

check_iostat

plugin (script) to check the I/O status of a device.

This script has been designed and written on Linux for the lowest common denominator of shells (sh), requiring awk, grep, tail and iostat as external programs.
The locations of these can easily be changed by editing the variables at the top of the script.
The script can be used to query 3 of the key statistics (Transactions Per Second, KB read per second, and KB written per second) separately or all 3 can be checked at the same time.
Note though that there is only one set of warning and critical values so if you do run it "all-in-one" then the same warning and critical levels will be used for all, note that in most situations this is not desirable!

Note that device should NOT include full path, instead it should just be the device name, e.g. hda1, or sda1, or vpatha1, etc...

Note that you need iostat in order to run this plugin (Debian/Ubuntu: sysstat)

Usage:

./check_iostat -w < warning value > -c < critical value > -l < Number of samples > -t|i|o|a < device > [ -v ] [ -h ]

NOTE:

When specifying device, /dev/ is assumed, e.g. for /dev/sda you should just enter sda for the device

Options:

Flag Description
-w Warning trigger level
-c Critical trigger level
-t I/O transactions per second (TPS/IOPS) on < device >
-i Kilobytes read IN per second on < device >
-o Kilobytes written OUT per second on < device >
-a Kilobytes written OUT and read IN per Second on < device >
-l Number of samples to take (must be greater than 1)
-v Verbose output (ignored for now)
-h Show this page

Changelog:

1.0 - Initial release

1.1 - Fixed typo in usage

1.2 - Fixed bug in critical/warning level checking which could result in erroneous results. Thanks to Drew Sudell for pointing this out!

1.3 - Initial GPL3 Release

1.4.2 - Many thanks to Alexander Kaufmann for many refinements to the script including properly formatted output stats which should allow PnP graphing

1.4.5 - Refinements to check logic and clarifying usage text

1.4.6 - Added sudo, added check if device exists, fixed some typos

1.4.7 - Added check if iostat is installed