private function createHardwareGraph($start, $title, $width, $height)
 {
     $options = array("--slope-mode", "--start", "-" . $start, "--title={$title}", "--vertical-label=Hardware", "--width", $width, "--height", $height, "--lower=0");
     //$hardwareDS = RRD::getDSFromRRDFile($this->rrdHardwareFile);
     //sort($hardwareDS);
     $hardwareDS = array();
     $hardwareDSsort = $this->hardwareMapper->getMappingSort();
     foreach ($hardwareDSsort as $key => $value) {
         $hardwareDS[] = $key;
     }
     for ($i = 0; $i < count($hardwareDS); $i++) {
         $hardware = $hardwareDS[$i];
         $options[] = "DEF:" . $hardware . "=" . $this->rrdHardwareFile . ":" . $hardware . ":AVERAGE";
         if ($i == 0) {
             $options[] = "AREA:" . $hardware . ColorTable::getColor($i) . ":" . $this->hardwareMapper->getNameForCode($hardware) . "\t";
         } else {
             $options[] = "STACK:" . $hardware . ColorTable::getColor($i) . ":" . $this->hardwareMapper->getNameForCode($hardware) . "\t";
         }
         $options[] = 'GPRINT:' . $hardware . ':AVERAGE:%8.0lf %s\\l';
     }
     //print_r($options);
     $options[] = "--tabwidth";
     $options[] = "350";
     RRD::createRRDGraph($this->getFileName("hardware", $start, $width, $height), $options);
 }
예제 #2
0
 private function createGraphTrafficPackages($start, $title, $width, $height)
 {
     $options = array("--slope-mode", "--start", "-" . $start, "--title={$title}", "--vertical-label=Traffic Packages", "--width", $width, "--height", $height, "--lower=0", "DEF:trafRxPa=" . $this->getRRDFileName() . ":trafRxPa:AVERAGE", "DEF:trafTxPa=" . $this->getRRDFileName() . ":trafTxPa:AVERAGE", "DEF:trafMgmtTxPa=" . $this->getRRDFileName() . ":trafMgmtTxPa:AVERAGE", "DEF:trafMgmtRxPa=" . $this->getRRDFileName() . ":trafMgmtRxPa:AVERAGE", "DEF:trafForwardPa=" . $this->getRRDFileName() . ":trafForwardPa:AVERAGE", "LINE2:trafRxPa#00FF00:trafRxPa", "LINE2:trafTxPa#F06FF0:trafTxPa", "LINE2:trafMgmtTxPa#0F0FF0:trafMgmtTxPa", "LINE2:trafMgmtRxPa#FFFF0F:trafMgmtRxPa", "LINE2:trafForwardPa#124f77:trafForwardPa");
     RRD::createRRDGraph($this->getFileName("trafficPackages", $start, $width, $height), $options);
 }