From 69e0b770cc270bc305c1adb33150ea980921f690 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Mon, 14 Nov 2011 16:53:37 +0000 Subject: [PATCH] thing git-svn-id: http://www.observium.org/svn/observer/trunk@2722 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/polling/entity-physical.inc.php | 77 ++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 includes/polling/entity-physical.inc.php diff --git a/includes/polling/entity-physical.inc.php b/includes/polling/entity-physical.inc.php new file mode 100644 index 000000000..1a483e6ce --- /dev/null +++ b/includes/polling/entity-physical.inc.php @@ -0,0 +1,77 @@ + $entry) + { + $group = 'c6kxbar'; + foreach($entry as $key => $value) + { + $subindex = NULL; + $entPhysical_attribs[$index][$subindex][$group][$key] = $value; + } + } + + foreach($chan_stats as $index => $entry) + { + list($index,$subindex) = explode(".", $index, 2); + $group = 'c6kxbar'; + foreach($entry as $key => $value) + { + $entPhysical_attribs[$index][$subindex][$group][$key] = $value; + } + + // FIXME -- Generate RRD files + + + } + +print_r($entPhysical_attribs); + +} + + + +// Set Entity Attribs +foreach (dbFetch("SELECT * FROM `entPhysical_attribs` WHERE `device_id` = ?", array($device['device_id'])) as $entity) +{ + if (!isset($entPhysical_attribs[$entity['entPhysicalIndex']][$entity['subindex']][$entity['group']][$entity['key']])) + { + dbDelete('entPhysical_attribs', "`device_id` = ? AND `entPhysicalIndex` = ? AND `subindex` = ? AND `group` = ? AND `key` = ?", + array($device['device_id'], $entity['entPhysicalIndex'], $entity['subindex'], $entity['group'], $entity['key'])); + } else { + if($entPhysical_attribs[$entity['entPhysicalIndex']][$entity['subindex']][$entity['group']][$entity['key']] != $entity['value']) + { + echo("no match!"); + } + unset($entPhysical_attribs[$entity['entPhysicalIndex']][$entity['subindex']][$entity['group']][$entity['key']]); + } +} +// End Set Entity Attrivs + +// Delete Entity Attribs +foreach ($entPhysical_attribs as $epi => $entity) +{ + foreach($entity as $subindex => $si) + { + foreach($si as $group => $ti) + { + foreach($ti as $key => $value) + { + dbInsert(array('device_id' => $device['device_id'], 'entPhysicalIndex' => $epi, 'subindex' => $subindex, 'group' => $group, 'key' => $key, 'value' => $value), 'entPhysical_attribs'); + } + } + } +} +// End Delete Entity Attribs + +?>