[mrtg] MRTG Script error ... Now Slightly OT
Martin Rheumer
martinr at hotkey.net.au
Wed Apr 23 09:43:01 CEST 2008
I actually tried this out.. ( with the corrected paths ). On a Fedora
Core 7 / 8 machine it produces the same output every time I run it.
Has anyone actually tried to use the iostat and got some results from
it and could perhaps shed some light on what I have done wrong.
(wally)[/usr/local/bin]root# ./diskio.sh
7670
4114
(wally)[/usr/local/bin]root# ./diskio.sh
7670
4114
(wally)[/usr/local/bin]root# ./diskio.sh
7670
4114
(wally)[/usr/local/bin]root# ./diskio.sh
7670
4114
Even waiting 12 hours gives the same results ?
Thanks
Martin
At 10:50 AM 22/4/2008 +0200, =?windows-1252?Q?Ale=9A?= wrote:
>SYED JAHANZAiB ~!~ AA Internet Cable.Network Services pravi:
>> I am facing a littile problem in creating MRTG Graph for Disk I/O
perfromance.
>> I created script to collect read/write data by thie following script.
>>
>> ################################
>> #disk.sh
>> #!/bin/bash
>> Kbr=`iostat -x |grep sda | awk '{print $7}' |sed "s/[.]//"`
>> Kbw=`iostat -x |grep sda | awk '{print $6}' |sed "s/[.]//"`
>> echo $Kbr
>> echo $Kbw
>> ################################
>> If I run disk.sh, it shows me following result which is ok
>>
>> 429
>> 26
>>
>> My disk.cfg is as follows...
>> ################################
>> Target[disk]: `/usr/local/mrtg-2/bin/disk.sh`
>> 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
>> #################################
>>
>> But when i set it in MRTG , it shows me follwing error and donot
updatedisk Graph.
>>
>> ##################
>>
>> 2008-04-21 17:04:02 -- Started mrtg with config
'/usr/local/mrtg-2/bin/mrtg.cfg'
>>
>> 2008-04-21 17:04:38 -- 2008-04-21 17:04:02: WARNING: Problem with
External get '/usr/local/mrtg-2/bin/disk.sh':
>> Expected a Number for 'in' but got ''
>>
>> 2008-04-21 17:04:38 -- 2008-04-21 17:04:02: WARNING: Problem with
External get '/usr/local/mrtg-2/bin/disk.sh':
>> Expected a Number for 'out' but got ''
>>
>> 2008-04-21 17:04:38 -- 2008-04-21 17:04:38: ERROR: Target[disk][_IN_] '
$target->[47]{$mode} ' did not eval into defined data
>>
>> 2008-04-21 17:04:38 -- 2008-04-21 17:04:38: ERROR: Target[disk][_OUT_] '
$target->[47]{$mode} ' did not eval into defined data
>>
>> #############################
>>
>> What could be the error ???
>>
>> Regards,
>> _________________________________________________________________
>> Invite your mail contacts to join your friends list with Windows Live
Spaces. It's easy!
>>
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&
mkt=en-us
>> _______________________________________________
>> mrtg mailing list
>> mrtg at lists.oetiker.ch
>> https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
>>
>>
>Maybe you should try:
>
>iostat -x |grep sda | awk '{print $7}' | sed 's/[^[:digit:]]//g'
>
>The result will be the same, but it is number for sure. :-)
>
>
>
>_______________________________________________
>mrtg mailing list
>mrtg at lists.oetiker.ch
>https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
>
More information about the mrtg
mailing list