public function fillHardwareRRDData() { if (!$this->checkHardwareRRDFile()) { $this->createHardwareRRDFile(); } $data = array(); $data[] = time(); $hardwareDS = RRD::getDSFromRRDFile($this->rrdHardwareFile); $tmphardware = array(); foreach ($this->nodeHardware as $key => $value) { $hardKey = $this->hardwareMapper->addNameToMapping($key); if (!in_array($hardKey, $hardwareDS)) { $hardwareDS[] = $key; RRD::addDS2RRDFile($this->rrdHardwareFile, $hardKey, "GAUGE", 600, 0, "U"); } $tmphardware[$hardKey] = $value; } foreach ($hardwareDS as $hard) { //echo $firm."\n"; $data[] = $tmphardware[$hard]; } $string = implode(":", $data); $ret = rrd_update($this->rrdHardwareFile, array($string)); echo rrd_error(); }