View Issue Details

IDProjectCategoryView StatusLast Update
453RackTablesdefaultpublic2015-06-11 06:05
Reporteruser110Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionwon't fix 
Product Version0.19.6 
Summary453: Rack Tables + Nagios
DescriptionAdd the ability to generate Nagios device configuration from Objects, and have links to the Nagios information from the Rack Tables interface.
TagsNo tags attached.

Relationships

related to 306 closeduser105 Rack Tables + Cacti 

Activities

2011-07-20 05:27

 

rt2n.tar.bz2 (6,840 bytes)

2011-08-02 17:20

 

rt2n_new.tar.bz2 (6,262 bytes)

user143

2011-08-02 17:21

  ~0000384

Attached new version with support for vm's.
infrastation

infrastation

2011-08-03 09:55

administrator   ~0000388

This will take some time to review.

2011-09-05 11:16

 

racktablesnagiosview.patch (2,277 bytes)   
### 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']))
 	{
racktablesnagiosview.patch (2,277 bytes)   

user167

2011-09-05 11:17

  ~0000423

The patch nagiosview.patch enables racktables to render an (iframe-based) portlet to view the status details from a nagios-server.

It awaits a dictionary entry named "Nagios Hostname" and replaces its value in the configured nagios url (replacing %%NAGIOS%%)

I don't know, if secret.php the right way to configure that. Tell me, if it's not.

2012-02-24 11:51

 

shinken.tgz (2,903 bytes)
blaza-pl

blaza-pl

2012-02-24 11:51

reporter   ~0000617

I have modified this nagiospatch to work on my system. I use shinken monitoring tool. Maybe this will be helpful.

I have one tab with color based on status retrieved using Livestatus.
Objects in Racks are also colored based on status retrieved using Livestatus.
Click on "Nagios" tab redirects to Thruk web interface.
It requires additional css and colors in DB. And socat (debian has a package) to communicate with Livestatus.It uses 'name' from rackobject to search for.
adoom42

adoom42

2015-06-11 06:05

administrator   ~0002879

I'm closing this ticket because it's so old. If someone would like to contribute further, please see https://github.com/RackTables/racktables-contribs/blob/master/nagios.php as a starting point.

Issue History

Date Modified Username Field Change
2011-07-20 05:27 user105 New Issue
2011-07-20 05:27 user105 File Added: rt2n.tar.bz2
2011-07-20 05:29 user105 Reporter user105 => user110
2011-07-20 05:29 user105 Target Version => 0.20.0
2011-07-20 05:30 user105 Relationship added related to 306
2011-08-02 17:20 user143 File Added: rt2n_new.tar.bz2
2011-08-02 17:21 user143 Note Added: 0000384
2011-08-03 09:55 infrastation Note Added: 0000388
2011-09-05 11:16 user167 File Added: racktablesnagiosview.patch
2011-09-05 11:17 user167 Note Added: 0000423
2011-09-05 11:51 infrastation Status new => assigned
2011-09-05 11:51 infrastation Assigned To => user105
2012-02-24 11:51 blaza-pl File Added: shinken.tgz
2012-02-24 11:51 blaza-pl Note Added: 0000617
2012-09-10 00:18 adoom42 Target Version 0.20.0 =>
2013-07-22 05:21 adoom42 Assigned To user105 =>
2013-07-22 05:21 adoom42 Status assigned => new
2015-06-11 06:05 adoom42 Note Added: 0002879
2015-06-11 06:05 adoom42 Status new => closed
2015-06-11 06:05 adoom42 Resolution open => won't fix