我的 iostat 给出以下输出
$ iostat
Linux 3.13.0-29-generic (Inksedge) 08/13/2015 _x86_64_ (4 CPU)
Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
xvdap1 0.62 0.13 9.01 3282841 226020852
xvdb 0.03 0.00 0.12 7721 2999916
xvdc 0.00 0.00 0.00 1376 0
check_iostat 不适用于设备 xvdap1!我也尝试过 xvda、xvda1,但没用!
# /usr/lib/nagios/plugins/check_iostat -d xvda1 -w 100,100,100 -c 200,200,200
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
(standard_in) 1: syntax error
OK - I/O stats tps= MB_read/s= MB_written/s= | 'tps'=; 'MB_read/s'=; 'MB_written/s'=;
那么我应该给出什么设备名称才能获得正确的输出?
它适用于 xvdb:
# /usr/lib/nagios/plugins/check_iostat -d xvdb -w 100,100,100 -c 200,200,200
OK - I/O stats tps=0.00 MB_read/s=0.00 MB_written/s=0.00 | 'tps'=0.00; 'MB_read/s'=0.00; 'MB_written/s'=0.00;
答案1
得到了答案:由于缺少 iostat 命令,它给出了错误的输出!
#apt-get 安装 sysstat
安装 sysstat 后在 Nagios 上获得输出:
IO-Stats /dev/xvda
OK 08-19-2015 14:28:10 43d 8h 7m 28s 1/4 OK - I/O stats tps=2.00 MB_read/s=0.00 MB_written/s=0.00
IO-Stats /dev/xvdb
OK 08-19-2015 14:26:48 61d 4h 47m 46s 1/4 OK - I/O stats tps=0.00 MB_read/s=0.00 MB_written/s=0.00
IO-Stats /dev/xvdc
OK 08-19-2015 14:26:48 61d 4h 47m 13s 1/4 OK - I/O stats tps=0.00 MB_read/s=0.00 MB_written/s=0.00
IO-Stats /dev/xvdf
OK 08-19-2015 14:25:10 6d 3h 4m 19s 1/4 OK - I/O stats tps=0.00 MB_read/s=0.00 MB_written/s=0.00