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

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Fri Dec 24 23:54:02 MET 1999


"Andrey M. Fedorov (ns)" wrote:
>  
>  I tried to monitoring connection of my host to another host by using mrtg.
>  That is my shell-script to get time from ping (file
>  /usr/home/andre/bin/mping.sh):
>  
>  #!/bin/sh
>  ping -Q -q -c1 iimm |\
>  sed -n -e "/\([0-9.]*\/\)/p" |\
>  sed -n -e "s/^.*=\ / /p" |\
>  awk 'BEGIN{FS="/"}{print int($2*100)}'
>  #------------end of script -------------------
>  

[config looking good.]

>  ... but when I run mrtg mrtg.cfg I get:
>  
>  Problem with Externale get '`/usr/home/andre/bin/mping.sh`':
>      Expected an INTEGER for 'out' but got ''
>  
>  What does it mean?
>  How can I solve this problem?

The script is not returning data that MRTG understands.

Try to find out where the script fails.
Start with the ping command itself.  Does it return data when using
these options?  If so, append the 1st sed command.  Check the output
again and make sure it is what you expect.  Add the 2nd sed command.

Your script could be optimized.  Looking at it I expect it to:
1) grep the line with a slash in it
2) change anything upto and including "= " into a single space
3) print the value after the slash.

I'll assume the ping command returns something like
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 3.6/3.6/3.6 ms

If so, you could simplify it into this:
ping -Q -q -c1 iim | awk 'BEGIN{FS="/"};/\//{print int($5*100)}'

If I run this script, I get an error.  Routing the error to /dev/null
I'll end up with nothing. That might be your 
>      Expected an INTEGER for 'out' but got ''
error.

Run ping without options (or Read The FM) to see what options to use.
Try removing the "-Q" for instance.  As soon as the command returns
a number, try again from MRTG.

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