#!/bin/sh
#------------------------------------------------------------------------------
# OPT_RRDTOOL   /etc/rrdtool/ping6.val                             __FLI4LVER__
# Creation:     bastard
# Last Update:  $Id$
#------------------------------------------------------------------------------

ping6_val_update_all ()
{
    local db_path=$1
    shift
    for host in $*
    do    
	set `ping6 -c 5 $host | grep round-trip`
	if [ -n "$4" ]
	then
	    val=$4
	    set `echo $val | sed 's#/# #g'`
            min="$1"
            avg="$2"
            max="$3"
        else        
            min="U"
            avg="U"
            max="U"
        fi
        rrdtool update $db_path/$host.rrd N:$min:$avg:$max
    done
}
#
# invoke iteration
#
. /etc/rrdtool/rrdtool-common 
rrdtool_val_iterate ping6 all_at_once
