Get the App
SLTechnology News&Howtos  ›  Servers  › 

Example Analysis of read and write Monitoring of mrtg hard disk in Ubuntu

Shulou Source: shulou.com Published: 2022-05-31 18:16:05 11月14日 Update

This article mainly shows you the "sample analysis of mrtg hard disk read and write monitoring in Ubuntu", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let the editor lead you to study and study the "sample analysis of mrtg hard disk read and write monitoring in Ubuntu".

Ubuntu has always supported the mainstream i386, AMD64 and PowerPC platforms, so most PC users can install the corresponding Ubuntu version on their computers.

Hard disk read and write monitoring [collection every 5 minutes by default]

Ubuntu mrtg switches to superuser:

Sudo-sH

Ubuntu mrtg set up a hard disk read-write script:

Mkdir / opt/mrtg

Vim / opt/mrtg/mrtg.disk

#! / bin/bash

Hd=sda

Disk=/dev/$hd

UPtime= `/ usr/bin/uptime | awk'{print $3 "" $4 "" $5}'`

KBread_sec= `iostat-x $disk | grep $hd | awk'{print 8 $}'`

KBwrite_sec= `iostat-x $disk | grep $hd | awk'{print 9 $}'`

Echo $KBread_sec

Echo $KBwrite_sec

Echo $UPtime

Hostname

Ubuntu mrtg enables scripts to execute:

Chmod + 755 / opt/mrtg/mrtg.disk

Modify / etc/mrtg.cfg to add hard disk read and write to file *

Target [disk]: `/ opt/mrtg/ mrtg.disk`

Title [disk]: Disk HDA I/O Utilization Report

# Unscaled [disk]: dwym

MaxBytes [disk]: 10240000

PageTop [disk]: Disk I/O Utilization Report

Kmg [disk]: KB,MB,GB

LegendI [disk]: Disk I/O KBread/sec

LegendO [disk]: Disk I/O KBwrite/sec

Legend1 [disk]: Disk I/O KBread/sec

Legend2 [disk]: Disk I/O KBwrite/sec

YLegend [disk]: Megabytes

ShortLegend [disk]: &

Options [disk]: growright,gauge,nopercent

Rebuild the index page:

Indexmaker / etc/mrtg.cfg > / var/www/mrtg/index.html

Visit:

Http://localhost/mrtg/

The above is all the contents of the article "sample Analysis of mrtg hard disk read and write Monitoring in Ubuntu". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Hard drives monitoring examples analysis content articles computers scripts learning help personal computers mainstream users platforms files easy to understand more organized version Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Xiaomi macOS Microsoft MySQL