### Eclipse Workspace Patch 1.0
#P racktables
Index: wwwroot/inc/secret.php
===================================================================
--- wwwroot/inc/secret.php	(Revision 234)
+++ wwwroot/inc/secret.php	(Arbeitskopie)
@@ -34,4 +34,9 @@
 	'cache_expiry' => 600,
 );
 
+// Nagios configuration
+
+//$nagios_attribute_name = "Nagios Hostname";
+//$nagios_url = "http://<mynagiosserver>/nagios/cgi-bin/status.cgi?host=%%NAGIOS%%";
+
 ?>
Index: wwwroot/inc/interface.php
===================================================================
--- wwwroot/inc/interface.php	(Revision 246)
+++ wwwroot/inc/interface.php	(Arbeitskopie)
@@ -669,7 +669,7 @@
 
 function renderRackObject ($object_id)
 {
-	global $nextorder, $aac, $virtual_obj_types;
+	global $nextorder, $aac, $virtual_obj_types, $nagios_attribute_name, $nagios_url;
 	$info = spotEntity ('object', $object_id);
 	amplifyCell ($info);
 	// Main layout starts.
@@ -723,14 +723,28 @@
 	}
 	if ($info['has_problems'] == 'yes')
 		echo "<tr><td colspan=2 class=msg_error>Has problems</td></tr>\n";
-	foreach (getAttrValues ($object_id) as $record)
+		
+	$nagios_hostname = "";
+	
+	foreach (getAttrValues ($object_id) as $record) {
+	    
 		if
 		(
 			strlen ($record['value']) and 
 			permitted (NULL, NULL, NULL, array (array ('tag' => '$attr_' . $record['id'])))
-		)
+		) {
+            if ($record['name'] == $nagios_attribute_name) {
+                
+                $nagios_hostname = $record['value'];
+                
+            } 
 			echo "<tr><th width='50%' class=sticker>${record['name']}:</th><td class=sticker>" .
 				formatAttributeValue ($record) . "</td></tr>";
+                
+        }
+        
+    }
+
 	printTagTRs
 	(
 		$info,
@@ -774,6 +788,20 @@
 
 	switchportInfoJS ($object_id); // load JS code to make portnames interactive
 	renderFilesPortlet ('object', $object_id);
+    
+    // Render Nagios portlet
+    
+    if (strlen($nagios_hostname) > 0) {
+        
+        startPortlet ('nagios');
+        
+        $tmp = str_replace("%%NAGIOS%%", $nagios_hostname, $nagios_url);
+        
+        echo '<iframe src="' . $tmp. '" width="100%" height="400" frameborder="0"></iframe>';
+        
+        finishPortlet();
+        
+    }
 
 	if (count ($info['ports']))
 	{
