$counters) { foreach ($counters AS $counter => $types) { foreach ($types as $type => $data) { rrdtool_update_ng($device, 'juniper-firewall', array( 'pkts' => $data[$pkts], 'bytes' => $data[$bytes], ), $filter . '-' . $counter .'-'.$type ); } } } } echo("\n"); unset($fws, $filter, $counters, $counter, $data); // EOF