[mrtg] Re: [mrtg]error: Expected an INTEGER for 'out' but got

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Sat Dec 25 14:01:10 MET 1999


> #!/bin/sh
> ping -Q -q -c1 iimm |\
> awk 'BEGIN{FS="/"};/\//{print int($5*100)}'
> 
> It returns one integer number.
> 
> Problem with Externale get '`/usr/home/andre/bin/mping.sh`'
>     Expected an INTEGER for 'out' but got ''
> 
> But I can`t understand second error :(
> It looks like MRTG trys to write something to my script and then expects
> replay from it ...

You should (re)read the manual.  Check config.txt (or config.html) and
pay attention to the "external program" part in the "Target" section.
You'll read that MRTG needs two values (in and out) followed by the
uptime and the description of the device.

You could append your AWK script with those values.  Change it into
awk -F/ '/\//{print int($5*100)};END{print "0\nquite some time\niimm"}'

The script would be:
----------------------cut here------------------
#!/bin/sh
ping -c1 iimm|awk -F/ '
/\//{print int($5*1000)}
END{print "0\nsome time\niimm"}'
----------------------cut here------------------

You should (IMHO) multiply by 1000 and not by 100.  This way, you will
measure in microseconds.  Check that same config.txt file and read the
"kMG" section.  You should be able to tell MRTG that you return micro-
seconds and would like to see miliseconds.  If your script returns for
instance 1230, it is 1230 microseconds and MRTG should write 1.23 ms.
This means that MRTG should write "m" when it normally writes "k" for
kilo.  I could be wrong but I think the string should look like

"ShortLegend[iimm]: s"
"kMG[iimm]: u,m,,k,M,G"

( not that I expect your script to return gigaseconds :-)  )


Regards,
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:mrtg-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/mrtg



More information about the mrtg mailing list