Check Disk Unix I/O

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
murawweh.daher
Posts: 66
Joined: Wed Sep 02, 2015 2:02 pm
Location: Ramallah - West Bank
Contact:

Check Disk Unix I/O

Post by murawweh.daher »

Hello,

i installed nrpe agent on solaris10 and want to check disk i/o, i tried to use check_iostat plugin but everytime have error as below.
what is the best way to check disk load for solaris 10?

./check_iostat -h
./check_iostat: function: not found
-e
This plugin shows the I/O usage of the specified disk, using the iostat external program.
It prints three statistics: Transactions per second (tps), Kilobytes per second
read from the disk (KB_read/s) and and written to the disk (KB_written/s)

./check_iostat:
-d <disk> Device to be checked (without the full path, eg. sda)
-c <tps>,<read>,<wrtn> Sets the CRITICAL level for tps, KB_read/s and KB_written/s, respectively
-w <tps>,<read>,<wrtn> Sets the WARNING level for tps, KB_read/s and KB_written/s, respectively

./check_iostat: -1: bad number
Regards,
Murawweh Daher
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check Disk Unix I/O

Post by rkennedy »

What version of the check_io script are you running?
Former Nagios Employee
murawweh.daher
Posts: 66
Joined: Wed Sep 02, 2015 2:02 pm
Location: Ramallah - West Bank
Contact:

Re: Check Disk Unix I/O

Post by murawweh.daher »

!/bin/sh
#
# Version 0.0.2 - Jan/2009
# Changes: added device verification
#
# by Thiago Varela - [email protected]

please find attached file (please remove .txt just for uploading)
You do not have the required permissions to view the files attached to this post.
Regards,
Murawweh Daher
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check Disk Unix I/O

Post by tgriep »

If you edit that plugin and remove the following lines from it, that message will go away.

Code: Select all

function help {
echo -e "\n\tThis plugin shows the I/O usage of the specified disk, using the iostat external program.\n\tIt prints three statistics: Transactions per second (tps), Kilobytes per second\n\tread from the disk (KB_read/s) and and written to the disk (KB_written/s)\n\n$0:\n\t-d <disk>\t\tDevice to be checked (without the full path, eg. sda)\n\t-c <tps>,<read>,<wrtn>\tSets the CRITICAL level for tps, KB_read/s and KB_written/s, respectively\n\t-w <tps>,<read>,<wrtn>\tSets the WARNING level for tps, KB_read/s and KB_written/s, respectively\n"
	exit -1
}
Solaris's command shell doesn't work with functions used in scripts.

Try that and see if it works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
murawweh.daher
Posts: 66
Joined: Wed Sep 02, 2015 2:02 pm
Location: Ramallah - West Bank
Contact:

Re: Check Disk Unix I/O

Post by murawweh.daher »

./check_iostat -d / -w 1,2,3 -c 2,3,4
ERROR: Device incorrectly specified
./check_iostat: help: not found
./check_iostat: test: unknown operator ==
./check_iostat: [[: not found
./check_iostat: [[: not found
./check_iostat: [[: not found
./check_iostat: : cannot execute
./check_iostat: test: unknown operator 2 | bc
./check_iostat: : cannot execute
./check_iostat: test: unknown operator 1 | bc
OK - I/O stats tps= KB_read/s= KB_written/s= | 'tps'=; 'KB_read/s'=; 'KB_written/s'=;
Regards,
Murawweh Daher
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check Disk Unix I/O

Post by rkennedy »

murawweh.daher wrote:./check_iostat -d / -w 1,2,3 -c 2,3,4
ERROR: Device incorrectly specified
./check_iostat: help: not found
./check_iostat: test: unknown operator ==
./check_iostat: [[: not found
./check_iostat: [[: not found
./check_iostat: [[: not found
./check_iostat: : cannot execute
./check_iostat: test: unknown operator 2 | bc
./check_iostat: : cannot execute
./check_iostat: test: unknown operator 1 | bc
OK - I/O stats tps= KB_read/s= KB_written/s= | 'tps'=; 'KB_read/s'=; 'KB_written/s'=;
I believe it's looking for a mount, not just /.

Code: Select all

-d <disk> Device to be checked (without the full path, eg. sda)
Former Nagios Employee
murawweh.daher
Posts: 66
Joined: Wed Sep 02, 2015 2:02 pm
Location: Ramallah - West Bank
Contact:

Re: Check Disk Unix I/O

Post by murawweh.daher »

i tried without full path and same issue.
Regards,
Murawweh Daher
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Check Disk Unix I/O

Post by lmiltchev »

Use "sda", instead of "/". Example:

Code: Select all

[root@192 tmp]# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          9.4G  6.1G  3.3G  66% /
devtmpfs        2.0G  140K  2.0G   1% /dev
tmpfs           2.0G     0  2.0G   0% /dev/shm
/dev/sda1       9.4G  6.1G  3.3G  66% /

[root@192 tmp]# ./check_iostat.sh -d sda1 -w 1,2,3 -c 2,3,4
CRITICAL - I/O stats tps=7.46 KB_read/s=3.35 KB_written/s=174.58 | 'tps'=7.46; 'KB_read/s'=3.35; 'KB_written/s'=174.58;
Be sure to check out our Knowledgebase for helpful articles and solutions!
murawweh.daher
Posts: 66
Joined: Wed Sep 02, 2015 2:02 pm
Location: Ramallah - West Bank
Contact:

Re: Check Disk Unix I/O

Post by murawweh.daher »

i test on Linux and worked fine.
./check_iostat -c 20,20,20 -w 10,10,10 -d sda
CRITICAL - I/O stats tps=232.33 KB_read/s=238.10 KB_written/s=5615.89 | 'tps'=232.33; 'KB_read/s'=238.10; 'KB_written/s'=5615.89;


but on Solaris 10 didn't work.
Regards,
Murawweh Daher
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check Disk Unix I/O

Post by rkennedy »

Can you post the full input / output when you attempt it on the Solaris machine?
Former Nagios Employee
Locked