Hi all<br><br>For all of you that are using the diskstat.ksh I posted on Xymonton 2 weeks ago, heads-up!<br><br>Following in the grand tradition that every useful program will contain at least one variable, one loop and one bug, my script must be useful.<br>
It contained a rather severe bug. <br>Some of the more observant may have noticed that the graphs for "Percent of Time Waiting" exceeded 100 from time to time. Odd, no?<br><br>OK, here's what happened.<br>Check the for loop that kicks off around line 32.<br>
There is one less element than columns in the output of iostat -xrn<br>The missing column is wsvc<span style="font-family: courier new,monospace;">_t</span> (average service time in wait queue, in milliseconds)<br><br>Oddly enough, this column is omitted in the output of <span style="font-family: courier new,monospace;">iostat -xr </span>and only makes its appearance when -n is used.<br>
Which is the cause of my mistake. The original first draft of the script used -xr, and then changed to use -n to get more useful device names. (and then had to do some creative awking to get the device names back to the first column)<br>
Compare<span style="font-family: courier new,monospace;"> iostat -x | head</span> to <span style="font-family: courier new,monospace;">iostat -xn | head</span><br>Methinks this is a Solaris bug. I can't think of any valid reason for the column mismatch.<br>
<br>So, if you are using the diskstat test, all values for the last 3 graphs will be wrong.<br>They are "Average Response Time of Transaction", "Percent of Time Waiting" and "Percent of Time Disk Busy"<br>
<br>How to fix this.<br>First of all, change line 32 of diskstat.ksh from<br><span style="font-family: courier new,monospace;">for subtest in reads writes kreads kwrites wait actv svct pw pb</span><br>to <br><span style="font-family: courier new,monospace;">for subtest in reads writes kreads kwrites wait actv <b>wsvc </b>svct pw pb</span><br>
<br>Update hobbitgraph.cfg with the new graph definition.<br><span style="font-family: courier new,monospace;">[diskstat-wsvc]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    FNPATTERN diskstat-wsvc,(.*).rrd</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    TITLE Average Number of Transactions Waiting</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    YAXIS Total</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    -l 0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    DEF:p@RRDIDX@=@RRDFN@:lambda:AVERAGE</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    LINE2:p@RRDIDX@#@COLOR@:@RRDPARAM@</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    GPRINT:p@RRDIDX@:LAST: \: %5.1lf (cur)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    GPRINT:p@RRDIDX@:MAX: \: %5.1lf (max)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    GPRINT:p@RRDIDX@:MIN: \: %5.1lf (min)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    GPRINT:p@RRDIDX@:AVERAGE: \: %5.1lf (avg)\n</span><br><br>Add the new test to hobbitserver.cfg<br><span style="font-family: courier new,monospace;">TEST2RRD=</span> gets the extra <span style="font-family: courier new,monospace;">diskstat-wsvc=ncv</span><br>
<span style="font-family: courier new,monospace;">GRAPHS=</span> gets <span style="font-family: courier new,monospace;">diskstat-wsvc::7</span><br>And we need to add another line for SPLIT_NCV<br><span style="font-family: courier new,monospace;">SPLITNCV_diskstat-wsvc="*:GAUGE"</span><br>
<br>I have updated Xymonton already, so you could just grab the new version there.<br><br>For those concerned with hanging onto their old data, you could do the following.<br>Rename all diskstat-svct*.rrd to diskstat-wsvc*.rrd<br>
Rename all diskstat-pw*.rrd to diskstat-svct*.rrd<br>Rename all diskstat-pb*.rrd to diskstat-pw*.rrd<br>The exact command is left as an exercise for the reader.<br>Of course, all the data that should be in diskstat-pb*.rrd, is lost. Gone forever. (Never retained, to be more correct)<br>
<br>Or you could just trash diskstat-svct*.rrd, diskstat-pw*.rrd and diskstat-pb*.rrd and start over. It's only been 12 days, at most.<br><br>Apologies for the inconvenience.<br><br>Regards<br>     Vernon<br><br><br>