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?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communityThe 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?
I'd choose another approach (if you're using ESX)
perl -MCPAN -e 'install <pluginname>'
:
aptitude install libxml-libxml-perl libclass-methodmaker-perl libcrypt-ssleay-perl libsoap-lite-perl libuuid-perl
'UUID' => '0.03',
to 'UUID' => '0.02',
perl Makefile.PL make 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
check_command check_esx!-l io!$_SERVICEESX_USER$!$_SERVICEESX_PW$!$_SERVICEIO_WARNING$!$_SERVICEIO_CRITICAL$!$_SERVICEESX_VM$
}
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
#!/bin/bash
DATE=`date`
#Write
echo $DATE > /drive/mount/point/testfile
if [ $? -eq 0 ]; then
echo "Write Successful"
else
echo "Cound not write file"
exit 2
fi
#Read
cat /drive/mount/point/testfile > /dev/null
if [ $? -eq 0 ]; then
echo " - Read Successful"
else
echo " - Cound not read file"
exit 2
fi
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:
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--------><----------Disks-----------><----------Network---------->
#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.