Zabbix monitoring Disk IO

Source: Internet
Author: User

Monitoring the fundamentals of disk IO: Analyze the/proc/diskstats file to monitor the performance of the IO.

++++++++++++++++++++++++ 's explanation of/proc/diskstats ++++++++++++++++++++++++++++++

# cat/proc/diskstats |grep SDA |head-1

8 0 SDA 2280 1445 76478 11956 249 188 3490 932 0 9913 12805

Explanatory notes:

First to third domain, respectively, main device number, secondary device number, device name

4th domain: The number of read times-----Read the disk, the total number of successful reads completed.

(number of issued reads. This is the total number of reads completed successfully.)

5th field: Merge read complete, 9th field: Number of merge writes completed. For efficiency, adjacent reads and writes may be merged. Thus two times 4K of reading before it is finally processed to disk may become a 8K read before it is counted (and queued), so there is only one I/O operation. This field lets you know how frequently such operations are done.

(number of reads merged)

6th field: Number of read sectors, total number of sectors successfully read.

(Number of sectors read. This is the total number of sectors read successfully.)

7th domain: The number of milliseconds spent reading, which is the number of milliseconds spent on all read operations (measured in __make_request () to End_that_request_last ()).

(number of milliseconds spent reading. This is the total number of milliseconds spent by all reads (as measured from __make_request () to End_that_request_last ()) .)

8th domain: The number of write completion times----Write completed, the total number of successful write completed.

(number of writes completed. This is the total number of writes completed successfully.)

9th field: The number of merge write finishes-----The number of merge writes.

(Number of writes merged Reads and writes which is adjacent to each other could be merged for efficiency. Thus 4K reads may become one 8K read before it was ultimately handed to the disk, and so it would be counted (and queued ) as only one I/O. This field lets the know how often is done.)

10th field: Number of write sectors----write sector, total number of successful write sectors.

(Number of sectors written. This is the total number of sectors written successfully.)

11th domain: The number of milliseconds the write operation spends---the number of milliseconds the write takes, which is the number of milliseconds spent on all writes (measured in __make_request () to End_that_request_last ()).

(number of milliseconds spent writing this was the total number of milliseconds spent by all writes (as measured from __mak E_request () to End_that_request_last ()).)

12th domain: The number of input/output requests being processed---the current progress of I/O, only this domain should be 0. Decreases when the request is submitted to the appropriate request_queue_t and the request is completed.

(Number of I/Os currently in progress. The only field is should go to zero. Incremented as requests is given to appropriate request_queue_t and decremented as they finish.)

13th domain: The number of milliseconds spent in an input/output operation----The number of milliseconds spent on I/O operations, and this field grows as long as field 9 is not 0.

(number of milliseconds spent doing I/Os. This field was increased so long as field 9 is nonzero.)

14th domain: The weighted number of milliseconds that the input/output operation spends-----weighted, the milliseconds spent on I/O operations, and the domain increases at the beginning of each I/O, I/O, and I/O merges. This can provide a convenient measurement standard for I/O completion time and storage for those that can accumulate.

(number of milliseconds spent doing I/Os. This field is incremented on each I/O start, I/O completion, I/O merge, or read of these stats by the number of I/Os in PR Ogress (Field 9) times the number of milliseconds spent doing I/O since the last update of this field. This can provide a easy measure of both I/O completion time and the backlog that could be accumulating.)


Environmental Description: CentOS6.6 32-bit system, zabbix2.2.9

If the Zabbix server and client are already installed.

Operations on the client (IP: 192.168.20.100):

modifying Client configuration Files

# vi/usr/local/zabbix-2.2.9/etc/zabbix_agentd.conf

Add the following content:

unsafeuserparameters=1userparameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep  $1 | head -1 | awk  ' {print $$4} '                      //the number of disk reads userparameter= custom.vfs.dev.read.ms[*],cat /proc/diskstats | grep $1 | head -1 |  awk  ' {print $$7} '                       //the number of milliseconds the disk reads Userparameter=custom.vfs.dev.write.ops[*],cat  /proc/diskstats | grep $1 | head -1 | awk  ' {print $$8} '                     //the number of disk writes userparameter=custom.vfs.dev.write.ms[*],cat /proc/diskstats | grep $1  | head -1 | awk  ' {print $$11} '                    //the number of milliseconds the disk writes Userparameter=custom.vfs.dev.io.active[*],cat /proc/diskstats  | grep $1 | head -1 | awk  ' {print $$12} '              userparameter=custom.vfs.dev.io.ms[*],cat /proc/ diskstats | grep $1 | head -1 | awk  ' {print $$13} '                          //the number of milliseconds spent on IO operations userparameter=custom.vfs.dev.read.sectors[*],cat /proc/diskstats  | grep $1 | head -1 | awk  ' {print $$6} '               //the number of read sectors (equal to 512B for a sector) userparameter= Custom.vfs.dev.write.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk  ' {print $$10} '            //number of Write sectors (one sector equals 512B)

In the server-side test, whether the data can be taken:

#/usr/local/zabbix-2.2.9/bin/zabbix_get-s 192.168.20.100-p 10050-k ' custom.vfs.dev.read.ops[sda] ' 2308#/usr/local/ Zabbix-2.2.9/bin/zabbix_get-s 192.168.20.100-p 10050-k ' custom.vfs.dev.write.ms[sda] ' 1509#/usr/local/zabbix-2.2.9 /bin/zabbix_get-s 192.168.20.100-p 10050-k ' CUSTOM.VFS.DEV.WRITE.OPS[SDA] ' 386


Zabbix Web browser operation:

1, add the indicator: ideas: First add the template, and then add item on the template.

configuration--templates--the top right corner of Create templates, fill in the template name and add to a group;

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m02/73/a2/wkiom1ycbosqq2rsaana7hbd7-q986.jpg "title=" 1.jpg "alt=" Wkiom1ycbosqq2rsaana7hbd7-q986.jpg "/>

2. Enter the newly created template--items, top right corner Create items

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m01/73/9f/wkiol1ycbvorpagdaalkxqhokxk071.jpg "title=" 2.jpg "alt=" Wkiol1ycbvorpagdaalkxqhokxk071.jpg "/>


Indicator Details:

First indicator of NAME:DISK:$1:READ:BYTES/SEC

KEY:CUSTOM.VFS.DEV.READ.SECTORS[SDA]

Units:b/sec

Store value:speed per second//differential rate, differential calculation

Use custom multiplier 512//will multiply the value by 512, because this is a sector, converted to byte 512B

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m02/73/a2/wkiom1ycby2dqfesaakvnlfeoaw492.jpg "title=" qq20150908103724.jpg "alt=" Wkiom1ycby2dqfesaakvnlfeoaw492.jpg "/>

Similarly, the other indicator methods are added as follows:

Second indicator: NAME:DISK:$1:WRITE:BYTES/SEC

KEY:CUSTOM.VFS.DEV.WRITE.SECTORS[SDA]

Units:b/sec

Store Value:speed per second

Use custom multiplier 512

Third Indicator: Name:disk:$1:read:ops per second

KEY:CUSTOM.VFS.DEV.READ.OPS[SDA]

Units:ops/second

Store Value:speed per second

Fourth indicator: Name:disk:$1:write:ops per second

KEY:CUSTOM.VFS.DEV.WRITE.OPS[SDA]

Units:ops/second

Store Value:speed per second

Fifth Indicator: Name:disk:$1:read:ms

KEY:CUSTOM.VFS.DEV.READ.MS[SDA]

Units:ms

Store Value:speed per second

Sixth indicator: Name:disk:$1:write:ms

KEY:CUSTOM.VFS.DEV.WRITE.MS[SDA]

Units:ms

Store Value:speed per second


3. Enter the newly created template--graphs, top right corner create graphs, fill in name, add Item item, select Graph type

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m00/73/9f/wkiol1ycb32bbvvraajlazlc76g322.jpg "title=" 3.jpg "alt=" Wkiol1ycb32bbvvraajlazlc76g322.jpg "/>

4, copy created items, graphs copied to the host to be monitored

5, Monitoring--graps, select the Group,host,graph project, monitor the diagram;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/A2/wKiom1YCb7iD5KBJAAPHnwFW2gY058.jpg "title=" 4.jpg " alt= "Wkiom1ycb7id5kbjaaphnwfw2gy058.jpg"/>


Zabbix monitoring disk IO So far, for the machine with more than one hard disk can be scripted, automatically extract the name of the hard disk to monitor;


This article is from the "Model Student's Learning blog" blog, please be sure to keep this source http://mofansheng.blog.51cto.com/8792265/1697548

Zabbix monitoring Disk IO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.