[mrtg] Re: Disk I/O stats
Bjorn Nilsen
lists at valhalla.net.nz
Tue Feb 26 22:02:29 MET 2002
This is the output from my awk command, is there a problem that the two
numbers are the same and I have left the uptime and hostname blank?
# /usr/bin/awk '/cpu /{print $2+$3+$4+$5; print $2+$3+$4+$5; print ""; print
""}'</proc/stat
1094155649
1094155649
# /usr/bin/awk '/cpu /{print $2+$3+$4+$5; print $2+$3+$4+$5; print ""; print
""}'</proc/stat
1094156076
1094156076
# /usr/bin/awk '/cpu /{print $2+$3+$4+$5; print $2+$3+$4+$5; print ""; print
""}'</proc/stat
1094156180
1094156180
>
> Weird. What does the raw output from your awk command look like?
> I use the following script to obtain disk read/write counters:
>
>
> #!/bin/sh
> ##diskio.sh - Display read and write disk io counters for use with mrtg.
> ##this script requires /proc/stat and has been tested on linux 2.2.13
> ##Usage - ./diskio.sh
> ##
> /bin/cat /proc/stat | grep disk_rio | awk ' { printf("%d\n", $2) } '
> /bin/cat /proc/stat | grep disk_wio | awk ' { printf("%d\n", $2) } '
> echo `/usr/bin/uptime | /usr/bin/awk ' { print $3 " " $4 " " $5 } ' |
/usr/bin/sed s/,//g`
> echo /etc/HOSTNAME
> ##end of script
>
>
> The output is as follows:
>
> > ./diskio.sh sda
> 71286067
> 138311955
> 98 days 16:20
> mrtg-1
> >
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://www.ee.ethz.ch/~slist/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the mrtg
mailing list