syntaxer run

git-svn-id: http://www.observium.org/svn/observer/trunk@2966 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-04-05 16:37:46 +00:00
parent 619415d668
commit 392d97bf73
18 changed files with 232 additions and 255 deletions

View File

@@ -11,21 +11,21 @@ if($device['os'] == "ios")
$chan_stats = snmpwalk_cache_oid($device, "cc6kxbarModuleChannelTable", array(), "CISCO-CAT6K-CROSSBAR-MIB");
$chan_stats = snmpwalk_cache_oid($device, "cc6kxbarStatisticsTable", $chan_stats, "CISCO-CAT6K-CROSSBAR-MIB");
foreach($mod_stats as $index => $entry)
foreach ($mod_stats as $index => $entry)
{
$group = 'c6kxbar';
foreach($entry as $key => $value)
foreach ($entry as $key => $value)
{
$subindex = NULL;
$entPhysical_state[$index][$subindex][$group][$key] = $value;
}
}
foreach($chan_stats as $index => $entry)
foreach ($chan_stats as $index => $entry)
{
list($index,$subindex) = explode(".", $index, 2);
$group = 'c6kxbar';
foreach($entry as $key => $value)
foreach ($entry as $key => $value)
{
$entPhysical_state[$index][$subindex][$group][$key] = $value;
}
@@ -70,8 +70,6 @@ if($device['os'] == "ios")
}
// Set Entity state
foreach (dbFetch("SELECT * FROM `entPhysical_state` WHERE `device_id` = ?", array($device['device_id'])) as $entity)
{
@@ -80,7 +78,7 @@ foreach (dbFetch("SELECT * FROM `entPhysical_state` WHERE `device_id` = ?", arra
dbDelete('entPhysical_state', "`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_state[$entity['entPhysicalIndex']][$entity['subindex']][$entity['group']][$entity['key']] != $entity['value'])
if ($entPhysical_state[$entity['entPhysicalIndex']][$entity['subindex']][$entity['group']][$entity['key']] != $entity['value'])
{
echo("no match!");
}
@@ -92,11 +90,11 @@ foreach (dbFetch("SELECT * FROM `entPhysical_state` WHERE `device_id` = ?", arra
// Delete Entity state
foreach ($entPhysical_state as $epi => $entity)
{
foreach($entity as $subindex => $si)
foreach ($entity as $subindex => $si)
{
foreach($si as $group => $ti)
foreach ($si as $group => $ti)
{
foreach($ti as $key => $value)
foreach ($ti as $key => $value)
{
dbInsert(array('device_id' => $device['device_id'], 'entPhysicalIndex' => $epi, 'subindex' => $subindex, 'group' => $group, 'key' => $key, 'value' => $value), 'entPhysical_state');
}