reengineering of port rrdfile. merged ifx (will notify existance of this via database).

****** YOU MUST RUN DISCOVERY OR "php fix-port-rrd.php" AFTER THIS *******



git-svn-id: http://www.observium.org/svn/observer/trunk@1656 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-08-10 15:54:01 +00:00
parent 8297e6aa5e
commit baf538df88
19 changed files with 298 additions and 73 deletions
+10 -5
View File
@@ -5,18 +5,23 @@
$this_port = &$port_stats[$device[device_id]][$port[ifIndex]];
$rrdfile = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("etherlike-".$port['ifIndex'].".rrd");
$old_rrdfile = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("etherlike-".$port['ifIndex'].".rrd");
$rrdfile = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("port-".$port['ifIndex']."-dot3.rrd");
$rrd_create = $config['rrdtool'] . " create $rrdfile ";
$rrd_create .= "RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797";
if(!file_exists($rrdfile)) {
foreach($etherlike_oids as $oid){
$oid = truncate(str_replace("dot3Stats", "", $oid), 19, '');
$rrd_create .= " DS:$oid:COUNTER:600:U:100000000000";
if(file_exists($old_rrdfile)) {
shell_exec('mv '.$old_rrdfile.' '.$rrd_file);
} else {
foreach($etherlike_oids as $oid){
$oid = truncate(str_replace("dot3Stats", "", $oid), 19, '');
$rrd_create .= " DS:$oid:COUNTER:600:U:100000000000";
}
shell_exec($rrd_create);
}
shell_exec($rrd_create);
}
$rrdupdate = "N";