Neue Version verfügbar !! Bitte hier klicken.
Neue Version meiner Racktables Erweiterung.
Änderungen:
* IPv6 Unterstützung
* Unterstützung von Server chassis (Bladesysteme)
* VM Hypervisor anzeige
* Unterstützt neues Racktables Plugin System
Hier findet man den Artikel über Version 0.1.
Download
Racktables Extention (230.32 kB)Neue Version verfügbar !! Bitte hier klicken.
Installation
Verschiebe den Ordner “extensions” in das “wwwroot” Verzeichnis von racktables.
Mit Racktables 0.19.X
Ändere oder erstelle die Datei “local.php” im Verzeichnis “inc” mit folgendem Inhalt:
<?php # Load server report require_once "extensions/reports/server-report.php"; # Load virtual machine report require_once "extensions/reports/vm-report.php"; # Load switch report require_once "extensions/reports/switch-report.php"; ?>
oder kopiere die Beispieldatei.
Mit Racktables 0.20.0 oder neuer:
Ändere oder erstelle die Datei “extensions.php” im Verzeichnis “plugins” mit folgendem Inhalt:
<?php # Load server report require_once "../wwwroot/extensions/reports/server-report.php"; # Load virtual machine report require_once "../wwwroot/extensions/reports/vm-report.php"; # Load switch report require_once "../wwwroot/extensions/reports/switch-report.php"; ?>
oder kopiere die Beispieldatei.
Screenshots:
Benutzung
Nun in die Racktables Webseite einloggen und “Reports” aufrufen.
Man findet nun zwei neue Reiter “Server” und “Virtual machines” im Menü.
Bemerkung: Man kann mehrere Spalten gleichzeitig sortieren durch das gedrückthalten von Shift wärend man auf weitere Spalten in der Kopfzeile klickt!
Modifikationen
Eigene Attribute hinzufügen:
Zuerst sucht man sich die ID seines Attributes. In diesem Beispiel ist es die “10002″. Nun öffnet man zum Beispiel die Datei “vm-report.php” und fügt folgende Teile ein:
[...]
$aResult[$Result['id']]['myValue'] = '';
if ( isset( $attributes['10002']['a_value'] ) )
$aResult[$Result['id']]['myValue'] = $attributes['10002']['a_value'];
[...]
[...]
<th>My Value</th>
[...]
[...]
<td>'.$aRow['myValue'].'</td>
[...]
Ein einfacher Weg, die ID seines Custom Attributes zu finden ist sich den Quelltext (mit dem Browser) der Attribute in der Konfiguration anzuschauen.
Bemerkung: Falls es sich um einen Standartwert handelt und nicht um ein Attribut (Nicht in der Attributliste im Konfigurationsmenü enthalten) kann man den Wert direkt auslesen:
Beispiel mit Asset-Tag:
[...] $aResult[$Result['id']]['sAssetTag'] = $Result['asset_no']; [...] [...] <th>Asset Tag</th> [...] [...] <td>'.$aRow['sAssetTag'].'</td> [...]
Eigene Sortierung:
Ich habe jede Menge Server mit Namen wie vServer1, vServer2, … vServer11, etc. und ich möchte vServer 10 nach vServer2 in meiner Liste haben. Deswegen habe ich eine eigene Sortierung gebaut.
Zuerst erstellt man eine neue Datei mit dem Namen “sorter.js” im JQuery-Verzeichnis mit folgendem Inhalt:
$.tablesorter.addParser ( {
id: 'vserver',
is: function(s) {
return false;
},
format: function(s) {
s = s.replace(/<a\b[^>]*>/i,'');
s = s.replace(/[^0-9]+/g,'');
return s.trim(s);
},
type: 'numeric'
});
Nun öffnet man seine Report Datei wie zum Beispiel “vm-report.php” und fügt folgendes hinzu:
Zuerst den neuen Sorter einfügen:
"echo ' <script type="text/javascript" src="extensions/jquery/sorter.js"/>';"
und unterhalb der Tabelle im Tablesorter JS-Teil:
[...]
headers: {
0: { sorter: "vserver" },
3: { sorter: "ipAddress" }
}
[...]
Dieser Customsorter entfernt den Hyperlink (durch den Report hinzugefügt) und alle Textteile vom Servernamen (nur für die Sortierung) und sortiert den Rest nummerisch.






You my friend, are a rockstar! This is a great addition to RT for sure!
Question, is version 0.20 generally available? If not, how did you get it?
Thank you !
I used the SVN Repository from Racktables
https://racktables.svn.sourceforge.net/svnroot/racktables/
Version 0.20.0 is in the Trunk
I am using Racktables 0.19.3 and observe the following error. How to fix it?
PHP Warning: require_once(extensions/reports/server-report.php): failed to open stream: Permission denied in /var/www/html/racktables/inc/local.php on line 4
I hope you mean 0.19.13
Check the permissions of the file “server-report.php” and allow access to it for your webserver user.
Greetings
Sebastian
It was caused by the selinux.
Finally I work around this issue by execute setsebool -P httpd_read_user_content=1 as root
I am using Centos 6.3.
If I don’t want to change the selinux policy and set httpd_read_user_content=1, what others I can do to fix it?
I found the fix finally.
Change to the racktables dir and execute to reset the SELinux security contexts
restorecon -Rv extensions/
An excellent plugin, indeed. Thank you very much for your contribution. I have been looking to do the same, when I stumbled over your extension.
Have you considered to push it upstream to either racktables core or perhaps the contrib?
https://github.com/RackTables/racktables-contribs
Thanks again!
Hi,
thank you !
I’m currently working on version 0.3 of the extension with some new features.
I hope to release it with racktabes 0.20.0 so i can remove a lot of stuff from the sourcode i need to be compatible with some older versions of racktables.
Add it to contrib is a good idea, the racktables developers should decide if they want to add it to the core.
Greets
Sebastian
Great!
Looking forward to 0.3!
Does anyone have this running under version 0.20.0? I have it running fine under 0.19.13 but when trying the new plugin location setup on 0.20.0 it never loads. Any ideas? Thanks for your work on this!!
Hi,
it works on racktables 0.20.0 ( i developed it on 0.20.0 )
Did you follow the instructions for version 0.20.0 ? Only the extension.php should be in the plugin directory. The plugin requests some files (JQuery and CSS) from the webroot. The rest of the plugin must stay on its old position.
Greetings
Sebastian
I have the same problem as Chuck. I have followed the instructions exactly but won’t load. Any suggestions?
Hi,
extension folder is in the webroot of racktables and extension.php in the plugin directory ?
Old local.php removed (replaced by extension.php in v 0.20.0)
Greetings
Sebastian
I think there is a problem reading the path.
My directory structure is c:\www\racktables\extensions\
The server is publishing as http://servername/racktables
How does the extension.php plugin path need to be set?
require_once “../racktables/extensions/reports/server-report.php”;
Does not appear to be read at all.