Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Apr 2005 18:10:41 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Ronald Klop <ronald-freebsd8@klop.yi.org>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: gstat and scripting
Message-ID:  <20050420231040.GD29613@dan.emsphone.com>
In-Reply-To: <opspjxzpmq8527sy@smtp.local>
References:  <opspjxzpmq8527sy@smtp.local>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Apr 21), Ronald Klop said:
> The tool gstat can produce very nice stats. Can I get these stats
> from the system periodicly for use in my one scripts/graphs? Is there
> a sysctl like kern.ad0.reads? Or some other way of retreiving this
> info from the kernel. Looking at the gstat output, the numbers must
> be in there.

You can use net-snmp and mrtg to graph disk stats.
I suggest applying the patch at
http://sourceforge.net/tracker/index.php?func=detail&aid=1085243&group_id=12694&atid=312694
so you get 64-bit counters (32-bit counters roll over too fast to be
useful):

$ snmptable -v2c localhost diskiotable
SNMP table: enterprises.ucdavis.ucdExperimental.ucdDiskIOMIB.diskIOTable

 diskIOIndex diskIODevice diskIONRead diskIONWritten diskIOReads diskIOWrites diskIONReadX diskIONWrittenX diskIOLA1 diskIOLA5 diskIOLA15
           1          da0  3682573440     4134971392     7734458     71468595  68107082880    828768692224      1794       398        138
           2          cd0          24              0           3            0           24               0         0         0          0
           3          cd1   911237260              0       13932            0    911237260               0         0         0          0
           4        pass0        1622             24          40            1         1622              24         0         0          0
           5        pass1           0              0           0            0            0               0         0         0          0
           6        pass2       57676     2710198624        3302        42848        57676      2710198624         0         0          0

If you graph diskIONReadX and diskIONWrittenX over time, you'll get a
nice graph of throughput.

-- 
	Dan Nelson
	dnelson@allantgroup.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050420231040.GD29613>