View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
453 | RackTables | default | public | 2011-07-20 05:27 | 2015-06-11 06:05 |
Reporter | Assigned To | ||||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | closed | Resolution | won't fix | ||
Product Version | 0.19.6 | ||||
Summary | 453: Rack Tables + Nagios | ||||
Description | Add the ability to generate Nagios device configuration from Objects, and have links to the Nagios information from the Rack Tables interface. | ||||
Tags | No tags attached. | ||||
related to | 306 | closed | Rack Tables + Cacti |
2011-07-20 05:27
|
|
2011-08-02 17:20
|
|
Attached new version with support for vm's. | |
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'])) { |
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
|
|
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. |
|
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. | |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-07-20 05:27 |
|
New Issue | |
2011-07-20 05:27 |
|
File Added: rt2n.tar.bz2 | |
2011-07-20 05:29 |
|
Reporter | user105 => user110 |
2011-07-20 05:29 |
|
Target Version | => 0.20.0 |
2011-07-20 05:30 |
|
Relationship added | related to 306 |
2011-08-02 17:20 |
|
File Added: rt2n_new.tar.bz2 | |
2011-08-02 17:21 |
|
Note Added: 0000384 | |
2011-08-03 09:55 | infrastation | Note Added: 0000388 | |
2011-09-05 11:16 |
|
File Added: racktablesnagiosview.patch | |
2011-09-05 11:17 |
|
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 |