in reply to MRTG script should be easy
As Skeeve points out, ping returns slightly differently on every system, so some output would help immensely.
It's maybe worth trying swapping the /\,/ for "," - this shouldn't make any difference (in my opinion, at least), but it seems to on my system (Perl 5.004.04 on Solaris).
An alternative way to do this, rather than the way you're doing it currently, would be to make use of the Net::Ping module. This has the capability of returning the ping time for individual pings in milliseconds, and from that it should be trivial to ping a host a number of times and calculate your average time and packet loss.
As far as rounding goes, you can use the printf and sprintf functions to output formatted numbers - it'll round into the bargain. For example ..
printf "%.1f", 29.28; # outputs 29.3
I hope that helps a little - good luck with the split ...
-- Foxcub
#include www.liquidfusion.org.uk
|
|---|