The usual plugins are all about known stats of a system but we are seeing really odd results on some of our vmware instances with hdparm -t.

Anyone know of a test actually does a write/read on a disk or nfs mount in nagios?

  • 1
    What do you mean? Please elaborate more details. – quanta Sep 23 '11 at 4:56

I'd choose another approach (if you're using ESX)

  • Download the ESX Nagios Plugin and save it in your Nagios plugins folder
  • Install needed Perl modules with perl -MCPAN -e 'install <pluginname>':
    • Nagios::Plugin
    • Params::Validate
    • Math::Calc::Units
    • Class::Accessor::Fast
    • Config::Tiny
  • Download the latest SDK named "vSphere SDK for Perl x.x" (registration required): http://www.vmware.com/support/developer/viperltoolkit/
  • Install required libs: aptitude install libxml-libxml-perl libclass-methodmaker-perl libcrypt-ssleay-perl libsoap-lite-perl libuuid-perl
  • Edit Makefile.PL and change the line 'UUID' => '0.03', to 'UUID' => '0.02',
  • Compile it:
    perl Makefile.PL
    make test
    make install

Create this new command:

define command {
    command_name    check_esx
    command_line    $USER1$/check_esx3 -H $HOSTADDRESS$ $ARG1$ -u $ARG2$ -p $ARG3$ -w $ARG4$ -c $ARG5$ $ARG6$

Now add a new service, f.e.:

define service {
   name                    esx-io
   use                     generic-service
   service_description     ESX I/O

Then use this check on a host:

define service {
    use               esx-io
    host_name         <hostname>
    servicegroups     foo
    _ESX_USER         <ESX-api check user>
    _ESX_PW           a-password
    _IO_WARNING       70
    _IO_CRITICAL      80

Maybe that's not exactly what you wanted, but I thought I'd share it.


Haven't tested this, but if all you want to do is write then read a file try a little shell script like



echo $DATE > /drive/mount/point/testfile

if [ $? -eq 0 ]; then
        echo "Write Successful"
        echo "Cound not write file"
        exit 2

cat /drive/mount/point/testfile > /dev/null

if [ $? -eq 0 ]; then
        echo " - Read Successful"
        echo " - Cound not read file"
        exit 2

exit 0

That script could be improved greatly, and probably has some errors, but it writes to a file then reads it back, if ether of those fail it will return critical. You could probably do with modifying that so it uses an argv for the file path and it might throw some unwanted errors to the console but it's a start


It's trivial to write your own tests. Write a script that does what you want to test and evaluate the possible outcomes.

In your case you could try a dd on the nfs-share or disk to test the write and open a file to test the read. You could then use the result from dd to return one in three statuses:

  • OK

You can add extra info in the string after the status. Ex:

OK - Everything went better then expected. Writespeed > 2500kbps
WARNING - Write speed is below treshold: < 500kbps.
CRITICAL - Write Failed!

Add the script in your check_nrpe-config (or whatever you are using to run remote scripts) and you are good to go.


Monitoring disk performance can be a lot trickier than just writing a file and seeing how long it takes. Same thing with reading. How do you know what's going on during the writes/reads? There could be spikes in the cpu load, network traffic issues (especially if nfs), in short all kinds of things. At the very least run collectl in one window while write the file in another. Here's a quick example of what it shows after installing the RPM and simply running the command 'collectl':

[root@poker ~]# collectl
#cpu sys inter  ctxsw KBRead  Reads KBWrit Writes   KBIn  PktIn  KBOut  PktOut
   0   0  1103    171      0      0      0      0      0      1      0       0
   0   0  1120    265      0      0      0      0      0      1      0       1

lots more switches and options. it even can show nfs stats on the same line if you're interested.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.