[mrtg] MRTG Script error
SYED JAHANZAiB ~!~ AA Internet Cable.Network Services
aacable at hotmail.com
Wed Apr 23 09:33:49 CEST 2008
Thanks , The PATH absense was the problem. AFter adding paths to every utility like awk grep n iostat, script is working gr8 :D
Problem Solved. Thanks once Again . . .
----------------------------------------
> Date: Tue, 22 Apr 2008 11:44:57 +0200
> From: alex at ergens.op.het.net
> To: mrtg at lists.oetiker.ch
> Subject: Re: [mrtg] MRTG Script error
>
> On Tue, Apr 22, 2008 at 07:52:53AM +0000, SYED JAHANZAiB ~!~ AA Internet Cable. Network Services wrote:
>
>> But when i set it in MRTG , it shows me follwing error and donot updatedisk Graph.
>
>> 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 ''
>
>> What could be the error ???
>
>
> If it works from the command line but not from MRTG, it is likely
> that your PATH setting is wrong when you run MRTG.
>
> For instance: awk is located in /usr/bin/awk but when MRTG is running
> the PATH does not contain /usr/bin/.
>
> Solution #1:
> * Always use full paths: write '/usr/bin/awk', not just 'awk'.
> * Same for the other utilities you use.
>
> Solution #2:
> * Make sure PATH does contain all necessary directories:
> *
> * Your script should contain the following line:
> * PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/you/bin
> *
> * Make sure you change the command so that it applies to your system.
>
> In my opinion, solution #1 is the better one.
>
> Remark about your script: in almost all cases, you need not combine
> 'grep' and 'awk' and 'sed'.
>
> Some examples:
>
> wrong: grep 'x' | awk '{print $1}'
> good: awk '/x/ {print $1}'
>
> wrong: grep 'x' | sed 's/x/y/g'
> good: sed -n '/x/s/x/y/gp'
>
> wrong: grep 'x' | awk '{print $1}' | sed 's/x/y/g'
> good: awk '/x/{gsub("x","y",$1);print $1}'
>
> HTH
> Alex
>
> _______________________________________________
> mrtg mailing list
> mrtg at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
More information about the mrtg
mailing list