$b_in:$b_out:$p_in:$p_out "); $rrdfile = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename('cip-'.$acc['ifIndex'].'-'.$acc['mac'].'.rrd'); if (!is_file($rrdfile)) { rrdtool_create( $rrdfile, 'DS:IN:COUNTER:600:0:12500000000 DS:OUT:COUNTER:600:0:12500000000 DS:PIN:COUNTER:600:0:12500000000 DS:POUT:COUNTER:600:0:12500000000 '.$config['rrd_rra'] ); } // FIXME - use memcached to make sure these values don't go backwards? $fields = array( 'IN' => $b_in, 'OUT' => $b_out, 'PIN' => $p_in, 'POUT' => $p_out, ); rrdtool_update($rrdfile, $fields); if ($acc['update']) { // Do Updates dbUpdate($acc['update'], 'mac_accounting', '`ma_id` = ?', array($acc['ma_id'])); } //end if }//end if }//end foreach unset($cip_array); if ($mac_entries) { echo " $mac_entries MAC accounting entries\n"; } echo "\n"; }//end if