#!/usr/bin/env php \n\n"; exit(1); } if (is_numeric($options['h'])) { $where = "`device_id` = ?"; } else { $where = "`hostname` = ?"; } $device = dbFetchRow("SELECT * FROM devices WHERE " . $where, array($options['h'])); $ports = dbFetchRows("SELECT * FROM ports WHERE `device_id` = ?", array($device['device_id'])); foreach ($ports as $port) { $old_rrdfile = trim($config['rrd_dir'])."/".trim($device['hostname'])."/port-".$port['ifIndex'].".rrd"; $new_rrdfile = get_port_rrdfilename($device, $port); printf("%s -> %s\n", $old_rrdfile, $new_rrdfile); rename($old_rrdfile, $new_rrdfile); } // EOF