From 931f405b7774582cffa62d79a0dd5b4df6dff093 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Fri, 18 May 2012 10:10:46 +0000 Subject: [PATCH] minisyntaxfix + add rewrite for EX3300 git-svn-id: http://www.observium.org/svn/observer/trunk@3203 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/pages/device/alerts.inc.php | 30 ++++++++++++++++-------------- includes/rewrites.php | 1 + 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/html/pages/device/alerts.inc.php b/html/pages/device/alerts.inc.php index 6d88cbd53..bbbd0c7c3 100644 --- a/html/pages/device/alerts.inc.php +++ b/html/pages/device/alerts.inc.php @@ -22,19 +22,19 @@ echo(' function get_entity_list($type, $subtype = "*", $device_id = "*", $entry) { - if($type == "storage") { $table = $type; } else { $table = $type.'s'; } - if($type == "port") { $deleted = "deleted"; } else { $deleted = $type.'_deleted'; } + if ($type == "storage") { $table = $type; } else { $table = $type.'s'; } + if ($type == "port") { $deleted = "deleted"; } else { $deleted = $type.'_deleted'; } $query = 'SELECT '.$type.'_id AS id, '.$deleted.' FROM '.$table.' WHERE 1'; $args = array(); - if(is_numeric($device_id)) + if (is_numeric($device_id)) { $query .= " AND device_id = ?"; $args[] = $device_id; } - if(is_numeric($entry['entity'])) + if (is_numeric($entry['entity'])) { $query .= " AND ".$type."_id = ?"; $args[] = $entry['entity']; @@ -42,25 +42,27 @@ function get_entity_list($type, $subtype = "*", $device_id = "*", $entry) $entities_db = dbFetchRows($query, $args); - foreach($entities_db as $entity_db) + foreach ($entities_db as $entity_db) { /// Is this entity marked as deleted? - if($entity_db['deleted'] != "1") + if ($entity_db['deleted'] != "1") + { $entities[] = $entity_db['id']; + } } return $entities; } -foreach($glo_conditions as $type => $subtypes) +foreach ($glo_conditions as $type => $subtypes) { - foreach($subtypes as $subtype => $metrics) + foreach ($subtypes as $subtype => $metrics) { - if(empty($subtype)) { $subtype = "*"; } - foreach($metrics as $metric => $entries) + if (empty($subtype)) { $subtype = "*"; } + foreach ($metrics as $metric => $entries) { - foreach($entries as $entry_id => $entry) + foreach ($entries as $entry_id => $entry) { - if($entry['enable'] == 1) { $enabled = ''; } else { $enabled = ''; } + if ($entry['enable'] == 1) { $enabled = ''; } else { $enabled = ''; } echo(''); echo(''); echo(''); @@ -69,10 +71,10 @@ foreach($glo_conditions as $type => $subtypes) /// Get which entities match this checker $entities = get_entity_list($type, $subtype, $device['device_id'], $entry['entity']); - if(!empty($entities)) + if (!empty($entities)) { echo('
'.$type.''.$subtype.''.$metric.''.htmlentities($entry['operator']).''.$entry['value'].''.$entry['severity'].''.$enabled.'
'); - foreach($entities as $entity) + foreach ($entities as $entity) { echo(''.generate_entity_link($type, $entity).""); } diff --git a/includes/rewrites.php b/includes/rewrites.php index a7a41cd88..3ed80e1b7 100644 --- a/includes/rewrites.php +++ b/includes/rewrites.php @@ -176,6 +176,7 @@ $rewrite_junos_hardware = array( 'jnxProductNameSRX5600' => 'SRX5600', 'jnxProductNameMX240' => 'MX240', 'jnxProductNameEX3200' => 'EX3200', + 'jnxProductNameEX3300' => 'EX3300', 'jnxProductNameEX4200' => 'EX4200', 'jnxProductNameEX8208' => 'EX8208', 'jnxProductNameEX8216' => 'EX8216',