Reports
Racktables extension with custom report.
Downloads:
Current Version: racktables_extension_v0.3.3.tar.gz (3612 Downloads )
Installation
Attension: New installation procedure with version 0.3.3
Move all the contents of the „plugins“ folder into the racktables „plugins“ folder:
$ cp -r plugins/* /usr/local/racktables/plugins/
This enables ALL reports.
You can remove or add them by adding or deleting one of this files:
For Server Report: server-report.php
For Virtual Machines Report: vm-report.php
For Switch Report: switch-report.php
For Custom Report: custom-report.php
Don’t remove the other files !
Available on GitHub, too:
https://github.com/RackTables/racktables-contribs/tree/master/extensions
Screenshots:
Usage
Login into racktables and go to „Reports“.
Now you find „Server“, „Virtual machines“, „Switches“ and „Custom“ in the report menu.
Note: Sort multiple columns simultaneously by holding down the shift key and clicking a second, third or even fourth column header!
Modifikations
Add custom attribute:
Find the ID of your attribute. In this example it is „10002“. Open the report file „vm-report.php“ for example. And add the following componets to the file:
[...] $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> [...]
An easy way to find the ID of your custom attribute is to look in the source code (with your browser) of the attribute setting in the configuration.
Note: If it is an standart value and not an attribute (Don’t listed in attributes in the configuration menu) you can directly access the values:
Example with asset Tag:
[...] $aResult[$Result['id']]['sAssetTag'] = $Result['asset_no']; [...] [...] <th>Asset Tag</th> [...] [...] <td>'.$aRow['sAssetTag'].'</td> [...]
Custom sorter:
I have a lot of servers like vServer1, vServer2, …, vServer11, etc. but i want to list vServer10 after vServer2 so i created a custom sorter.
First create a new file in the jQuery-Folder called „sorter.js“ with the following content:
$.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' });
Now open your report file „vm-report.php“ for example and add:
First the include of the new JS-Sorter:
"echo ' <script type="text/javascript" src="extensions/jquery/sorter.js"/>';"
And below the table in the tablesorter JS-Part:
[...] headers: { 0: { sorter: "vserver" }, 3: { sorter: "ipAddress" } } [...]
This sorter removes the hyperlink (added by the report) and all text parts from the name of the server (only for the sorting) and sorts the column now numeric.
Colors & Icons for Report:
Open „extensions/jquery/themes/racktables/style.css“ and look for the examples at the end of the file. Like this one:
table.tablesorter tbody tr span.object_typeid_4 a { color:red; }
This set the color of all phyical servers (type4) to red.
Downloads:
Current Version:
racktables_extension_v0.3.3.tar.gz (3612 Downloads )
Plugins
Cable ID
Racktables Cable ID Plugin:
Shows cable ids of an rack and displays dublicate cable ids.
Download: racktables_cableid_plugin_v0.2.tar.gz (5622 Downloads )
Just copy the file into the plugin directory of racktables.
Nagios
Racktables Nagios Plugin
Download: racktables_nagios_plugin_v0.1.tar1.gz (6335 Downloads )
Just copy the file into the plugin directory of racktables.
$nagios_user = 'nagiosadmin'; $nagios_password = 'nagios'; $nagios_url = 'https://localhost/nagios3';
Adjust this parameters to your configuration.
Note: Racktables „Common name“ and Nagios „Hostname“ must be identical.
This plugin needs the php curl extension. (aptitude install php5-curl)
For Racktables 0.19.XX copy the nagios.php into the „inc“ folder and add the following line to „local.php“ in the „inc“ folder:
require_once "inc/nagios.php";
Use FQDN instead of Hostname:
Replace:
[...] $object = spotEntity ('object', $_REQUEST['object_id']); [...] $nagios_url_cgi = str_replace("%%NAGIOS%%", urlencode($object['name']), $nagios_url_cgi); [...]
with:
[...] $attributes = getAttrValues ($_REQUEST['object_id']); [...] $nagios_url_cgi = str_replace("%%NAGIOS%%", urlencode($attributes[3]['value']), $nagios_url_cgi); [...]
Misc
NDOUtils – has problems
Small script reads nagios problems from ndo database and set has_problems flag in racktables:
updateProblems.pl_.tar.gz (5595 Downloads )Just download and unpack. You may want to create a cronjob like this one (crontab -e):Einfach herunterladen und entpacken.
*/5 * * * * /path/to/updateProblems.pl
This cronjob executes the script every 5 minutes.
Works with plain Nagios and NDOUtils Setup or an Centreon installation. But you have to use the same name of a server in both system !
Donations
If you appreciate my work, feel free to make a donation with paypal:
Pingback: Nagios Plugin for Racktables | Sebastian Mogilowskis Blog
Pingback: Racktables Extension v0.3 | Sebastian Mogilowskis Blog
Pingback: Racktables Extension v0.2 | Sebastian Mogilowskis Blog
Guest
11 Jun 2013Is it plugins workable on RackTables 0.20.4? I tried loading them in but the whole server went down..
sebastian
11 Jun 2013It should working. I currently can’t test it.
I release a new version with small fixes in the end of august.
blaza-pl
14 Jun 2013It seems it fails with newest php version because $_POST variable cannot be re-assigned.
PHP Fatal error: Cannot re-assign auto-global variable _POST
blaza-pl
18 Jun 2013It seems there is a problem with newset PHP version.
The variable $_POST cannot be re-assigned.
error message: PHP Fatal error: Cannot re-assign auto-global variable _POST custom-report.php on line 658
sebastian
3 Sep 2013Hi,
this Bug and some others are fixed in Version 0.3.1 http://www.mogilowski.net/wp-content/plugins/download-monitor/download.php?id=20
Edu Alcaniz
10 Jul 2013I tried to put in my server, one guy install
XAMPP
C:\xampp\htdocs\racktables\
what is the right configuration of extension.php to work in 20.3?
sebastian
10 Jul 2013Hi,
it should placed in C:\xampp\htdocs\plugins
But i’m not sure if it all runs on windows how it should.
blaza-pl
14 Jun 2013It fails with newset PHP version (tested on 5.4.4-14) because $_POST[’name‘] is re-assign and this is forbidden by php.
The error is: PHP Fatal error: Cannot re-assign auto-global variable _POST
sebastian
29 Jan 2014This is fixed in version 0.3.1
Thank you !
Jacob
29 Jan 2014Installed Racktables extensions per instructions. But it completely crashes the app and I get the following error in /var/log/httpd/error_log:
[Tue Jan 28 15:57:26 2014] [error] [client 10.65.21.98] PHP Warning: require_once(../wwwroot/extensions/reports/server-report.php): failed to open stream: No such file or directory in /var/www/html/RackTables-0.20.6/plugins/extension.php on line 4
[Tue Jan 28 15:57:26 2014] [error] [client 10.65.21.98] PHP Fatal error: require_once(): Failed opening required ‚../wwwroot/extensions/reports/server-report.php‘ (include_path=‘.:/usr/share/pear:/usr/share/php‘) in /var/www/html/RackTables-0.20.6/plugins/extension.php on line 4
Component versions:
Racktables 0.20.6
php-5.3.3-27
httpd-2.2.15-29
Racktables Extension (Version 0.3.1)
Any Ideas?
Thanks,
Jacob
sebastian
29 Jan 2014Hi,
the path doesn’t match. You have a different installation structure.
You have to fix your relative path to your environment. Or use an absolut path:
require_once „/var/www/html/RackTables-0.20.6/extensions/reports/server-report.php“
But i’m not sure i don’t know exactly your path structure.
My webroot is: „/var/www“
There i have my „plugins“ and „racktables“ folders. The „extensions“ folder is inside the „racktables“ folder. (Same level as the index.php of racktables.
I hope this helps you to change the require_once to your setup.
Greetings
Sebastian
Jacob
29 Jan 2014Our path looks like:
/var/www/html/RackTables-0.20.6/wwwroot/index.php
I read through the RT install instuctions. It seems like the installation was done a little strange. (Install was not done by me.) Thanks for pointing out the issue. I will look correcting our installation or modifying the paths as you say.
Thanks for your help.
Jacob
Justin
2 Mrz 2014The extension has been working great. i would like to modify your server report and i’m having some problems when i do. I would like to remove the MAC col. I removed commented out the lines of code that I thought would do this but all i get is the MAC header removed but the data rows still have that col with empty data so everything is mis-alligned. I know i could create a custom report but would like to have this as a standard. Thanks
sebastian
6 Mrz 2014Hi,
you have to remove the l2address foreach lines. (With
)
And you have to change the javascript on the bottom of the page. „1: {sorter: „ipAddress“ },“
Greetings
Sebastian
Greetings
Sebastian
Aaron Webstey
9 Apr 2014Incredible extensions. Any chance you’ll add support to „permalink to results“ or something like that on custom reports?
I was going to write my own report to list all list all IP addresses in use by any system, but your custom report pretty much does that for me. It would just be nice to be able to bookmark the report for quick access instead of clicking through the interface to get it.
Again, incredible work!!! I would donate if I were allowed; my work doesn’t go for that sort of thing.
Rob Walker
30 Apr 2014Is it possible to use this via wget? I would like to automate an inventory reporting script, and gathering data from this custom report would be awesome.
Thanks,
Rob
sebastian
30 Apr 2014Hi,
you can use it like that:
wget --http-user=admin --http-password=XXXXX -O "vms.csv" "http://localhost/racktables/wwwroot/index.php?page=reports&tab=vm&csv"
Please change the URL to your setup.
Greetings
Sebastian
Charelly
15 Mai 2014The extension(v0.3.1) has been working excellent. i would like to modify your server report and i’m having some problems when do i want to modify the server report.
Name MAC IP Comment Contact Type OEM S/N HW Expire Date OS Location
-> Name FQDN IP(s) MAC SW(type) CPU Memory Disk HW(type) H/W Introduction Location Contact Comment
How to do modified the server-report.php file???
I wonder if you can help me??
Also, Can I print out the Server or Switches report??
Korean Language (Utf-8) is broken when CSV export.
Linux RackTables 0.20.6 Apache (2.2.15) PHP 5.3.3 MySQL (5.1.71) racktables_extensions_v0.3.1
sebastian
16 Mai 2014Hi,
export the report as CSV and open it with libre office or excel and print it.
Sure you can add or remove colums in the server report. You have to extend the „$aResult“ array with the value you like to add to your report. Don’t forget to extend the CSV and HTML table for the new output values.
If you don’t have any experience in PHP just use the custom report instead.
Greetings
Sebastian
Charelly
16 Mai 2014HI sebastian…..
Thank you for your quickly reply…
Actually, I sometimes used the cusotm report….
However, our co-workers want to use by defined server report.
Thus, I want to configure the defined Server Report in order to replace our configuration document for our job.
I shouldn’t have experienced in PHP. sigh… ã… .ã…
Also, I want to view rack image with add object picture.
https://bugs.racktables.org/view.php?id=999
I’ll really be looking forward to your reply.. ^^
Best Regards.
Charelly
sebastian
16 Mai 2014Hi,
just try it. Look at the source code and try to add your own fields.
There are examples in my racktables article: http://www.mogilowski.net/projects/racktables
Look at „Modifikations“ section.
Greets
Sebastian
Charelly
16 Mai 2014Thank you for your advice….
Though I have never experienced the PHP programming,
I’ll try to look at the source code and I’ll customizing the report for our job.
I think that Racktables extension 0.3.1 is great..
Thank you..You’ve been a great hep already..
Regards,
Charelly
Charelly
22 Mai 2014Hi….
I’m sorry to have caused you so much trouble.
I still have several questions regarding the customize of the racktables.
I’d like to manage the DCIM (Data Center Infrastructure Management) by racktables.
If i study the PHP programming, can I afford to do that(example)???
I was wondoring if I could use to method by the Racktables Extension.
Thank you for your time and prompt response.
Charelly
22 Mai 2014Sorry…
The example chart was broken.
Could you removed before my comment??
If you inform to me your e-mail, I’ll send the e-mail.
I’ll attach an examle file.
Regards.
Charelly
sebastian
22 Mai 2014Hi,
sorry i don’t understand your specific problem. You can add custom colums to the reports by following the instructions in this article.
Greetings
Sebastian
Charelly
23 Mai 2014HI….
Thank you for your reply..
Sorry to have bothered you…
I sent an e-mail..
I think that the extension function has been working great for custom report.
However, I want to see a statistical data for system management.
I’d like to see with a count of vendor equipment and amount of Locations.
If I study the PHP programming, can I be customized the racktables by extension.
Is it possible ????
Thank you for your warnings and helpful suggestions. ^^
Best regards
Charelly
Michael
9 Feb 2015Thank you so much for your work. These reports are awesome – especially the custom one!
Dan
17 Feb 2015Great plugin.
I have a question regarding custom reports. I would like to find out how many units a specific Object Type is utilizing. Is this possible? I can’t seem to figure it out.
For instance I would like to find out how many units Object Type Servers is using and which are tagged with Tag MMX.
Raphael Nunes
13 Mrz 2015Hi. Thanks for your effort on this project.
I can not make the plugin to work in version 0.20.8.
My plugin dir is inside racktables dir, and the path is correct in the pre-init.php.
My question is what else should be inside plugins? Right now I have only extensions.php. Is it right?
sebastian
13 Mrz 2015Hi,
thank you !
Put extensions.php inside the plugins folder and the extensions folder inside the wwwroot.
Rao
11 Aug 2015Hi Guys,
figured out how to get this installed. here is the process for racktables 0.20 install for this .
INSTALL PLUGINS IN RACKTABLES
WWWROOT folder for us is /var/www/html/racktables/
Create plugins folder in /var/www/html
+>racktablespc:/var/www/html$ sudo mkdir plugins
unrar racktables_extensions_v0_3_1_tar_gz by doing
+>racktablespc:/home/sydneyit$ sudo tar -zxf racktables_extensions_v0_3_1_tar_gz
now move extensions folder to /var/www/html/racktables/
+>sudo cp -R /home//racktables_extensions_v0.3.1/extensions /var/www/html/racktables/
now copy extension.php to /var/www/html/plugins
+>sudo cp extensions.php /var/www/html/plugins/
Now, modify extensions.php to as below:
+>racktablespc:/var/www/html/plugins$sudo vi extensions.php
Code:
BEGIN
END
Final step.
restart apache.: sudo service apache2 restart
should be all good
B
23 Nov 2015Thanks man, you make my day 😉
Egon
24 Aug 2015Hi Sebastian,
We recently add the „Customer Report“ plugin into our Racktables 0.20.10. We don’t have output for the Object Type „Rack“. Is this a known issue? And is the a possibility to resolve this?
Thanks in advance,
Egon.
sebastian
25 Aug 2015Hi,
no there is no known issue about this at the moment.
I’ll take a look at this problem. If you can mail me some more informations or details it will may help me.
Greetings
Sebastian
Egon
5 Okt 2015Hi Sebastian,
Sorry for the late reply, i’ve forgot to select the response by email 😉
What information do you need? FYI: We have several locations with several rows and racks within a row. On selecting the object type „Rack“ (or „Row“and/or „Location“ btw!) and one/more/all „Common Values“, „Attributes“ or „Tags“ I’m getting only a „No items found !!!“ response. All other types gives me the output.
Egon.
Egon
4 Nov 2015Hi Sebastian,
Have you been able to have a look into this?
Regards,
Egon.
sebastian
6 Nov 2015Hi,
yes i did and i can confirm this bug.
It would be fixed in the next version.
Greetings
Sebastian
Egon
16 Nov 2015Hi Sebastian,
Thanks for confirming this. Any ideas when the next release will be published? I have an urgent need for getting the rack info out of Racktables.
Egon.
Yasin Shaikh
21 Sep 2015Hi
Any chance you can give me any ideas on how I can export/report all remote connection points on a switch, I have tried but cant find the excat id number I need o use.
Thanks
Much appreciated
sebastian
21 Sep 2015Hi,
i created a Interface Mod for Racktables to show me external Patchpanel connections:
http://www.mogilowski.net/wp-content/uploads/patchPanelInterfaces.tar.gz
https://www.freelists.org/post/racktables-users/Patch-panels,3
Look at the „renderObjectPortRowExtended“ function in the interface.php file.
I check if the remote Object is type 9 (=Patchpanel)
$remote_object[‚objtype_id‘]) == 9
an than if there is an external connection on this remote object.
Switches are Type #8 maybe it helps you to create your own script.
Greetings
Sebastian
iurii
14 Okt 2015Hi all,
It’s not working for RT 0.20.10. Not changes on page Reports, also if I open:
1. http://example.com/extensions/reports/vm-report.php – Page is clear
2. http://example.com/index.php?page=reports&tab=vm – Internal error. Failed to find handler for page ‚reports‘, tab ‚vm‘
Anybody can provide normal instruction for installation plugins to RT 0.20.10 (PHP 5.4.16) ???
iurii
15 Okt 2015I have done 🙂
all folders and files in wwwroot (/var/www/racktables) have chown apache:apache
1. mkdir /var/www/racktables/plugins
2. cp extensions /var/www/racktables
3. add to /var/www/racktables/inc/secret.php such row: $racktables_plugins_dir = ‚/var/www/racktables/plugins‘;
4. Make links in plugins folder to extensions files, for example
/var/www/racktables/plugins:
ln -s ../extensions/reports/vm-report.php vm-report.php
it works for me!
sebastian
16 Okt 2015Hi,
i’m running my extension on 0.20.10, too.
There shouldn’t be any changes on the installation.
extensions.php in the plugin folder which includes the single reports should working.
But if it works for you don’t change your setup 🙂
Marc
21 Okt 2016I am having the same problem, however I still cannot get it to work after applying your changes. I am running RT 0.20.11.
Any suggestions?
Marc.
Marc
21 Okt 2016After some more work I solved my own problem. The problem being that when I follow the instructions to install these plugins, upon logging into Racktables, I get a blank screen.
I had to set ownership of user and group for all files to ‚www-data‘ (this is the account running my apache daemon).
chown www-data: *.php
chown -R www-data: css js pix
I also found that as long as I don’t have the files „extension.php“ and „linkmgmt.php“ available, it works. With these files available in the plugin directory, I get a blank screen directly after authenticating. I have tried setting the ownership of the above 2 files to www-data, but that did not solve the problem.
Further details: I am running RT 0.20.11 on a TurnkeyLinux LAMP virtual machine.
Marc
21 Okt 2016Further to my previous comment: I also added
$racktables_plugins_dir = ‚/var/www/racktables/plugins/‘;
to the secret.php file.
That is the directory where I keep all plugins. I am not symlinking anything.
Marc.
Ed
28 Okt 2015Hi!
I Thank you very much for a great plugin. I have used it some and made some new reports and everything works fine except for one thing. In all the reports where there are some entries without ip-address that column is sorted fine, however if I have a report where all entries have an ip-address I can not sort on that column. This goes for all reports including the included ones. I tried to fix it by adding an empty character to the ip-address and if I do it is sortable but now as text, i.e in the „wrong“ order.
I have tried with chrome and explorer but it is the same.
Am I the only one affected by this or has anyone else seen the same problem?
Br
/ed
sebastian
29 Okt 2015Hi,
i created a own tablesorter type for ip-addresses.
sorter: "ipAddress"
make sure you use it for the correct column.
Greetings
Sebastian
Ed
29 Okt 2015Thanks, worked directly.
br
/ed
RJ
21 Jan 2016Hi Sebastian,
This is a great plugin! Thanks for working on this. I have been playing with the server reports and manage to add ,ore columns by adding new attributes. However, I wanted to add the Location column – not by adding additional attribute but linking the actual location name against the the row and rack name for each object. Can you help me on this?
Also, I wanted to ask if there is a way to bulk upload data on racktables.
Thanks in advance!
RJ
sebastian
22 Jan 2016Hi,
did you read the examples for adding additional attributes ?
Greetings
Sebastian
RJ
1 Feb 2016Thanks Sebastian, I managed to sort this one out. I ended up adding some lines in the SQL schema. To further improve the report, I wanted to have filtering on the columns, is this possible? Similar to an excel spreadsheet when you apply filters.
Sebastian
4 Feb 2016Hi,
what about the Javascript Filters at the top of the table ?
Egon
22 Jan 2016Hi Sebastian,
Regarding my post on August 24: Do you know when the new release will be available with the fix for the issue I’ve mentioned?
Thanks in advance,
Egon.
sebastian
22 Jan 2016Hi,
sorry lots of other projekts 😉
I thing end of next month.
Greetings
Sebastian
sebastian
5 Feb 2016Hi Egon.
it’s done 😉
The new version is here and the bug you had reported is fixed.
Greetings
Sebastian
Egon
5 Feb 2016Hi Sebastian,
You make my day 🙂 I’ll install the new version asap and will let you know.
Thanks for the speed and effort! Keep up the good work…
Greetiing,
Egon.
Egon
12 Feb 2016Hi Sebastian,
Just installed 0.3.3 and Looks good! The only issue I see for now, is that Rack Objects don’t show Tags.
Enzo
24 Apr 2016Hello,
I insstalled and work perftectly just one suggest, is not possible export all the objects for a rack, when in the custom report check ‚rack‘, show all the racks, and select the rack then show an error:
Object ‚object’#’75‘ does not exist
Ron
10 Mai 2016Hello, I write from Venezuela , I want to know where to find information for initial data loading, I have installed 0.20.11 RackTables in the Debian operating system 8.4.0 Jessie 64bits (Debian terminal or console ) , operating system mounted on my virtual machine ( VirtualBox ) , and I need to make a manual, for the initial loading of data regarding the installation and configuration and perform , I hope you can help me , greetings
sebastian
12 Mai 2016Hello,
i’m not sure what you want but have you tried to import „init-sample-racks.sql“ from the script folder ?
Greetings
Ron
12 Mai 2016Thanks, I found what I wanted , I understand that my comment was somewhat confusing , this was due to the mistranslation , my native language is Spanish , Greetings
Ron
12 Mai 2016Thanks, I found what I wanted , I understand that my comment was somewhat confusing , this was due to the mistranslation , my native language is Spanish , Greetings
RJ
25 Jan 2017Hi Sebastian,
Can you help me with the code in adding custom column in server report? What I want is to add a column to display all the tags for each object. As the tags are not part of the Attributes, I can’t seem to add them the way you described it in your guide.
I know the same result can be achieved using your „Custom Report“ plugin but I would like to have it on the other reports as well.
Thanks.
sebastian
1 Feb 2017Hi,
best way is to take a look at the sourcecode from the custom report. (getResult Function)
The tags are loaded with the functions „loadEntityTags“ and „getImplicitTags“ to the $Result array.
This part is not in the server or vm report. Just copy and paste with little mods and it should work for you.
Greetings
Sebastian
Mehboob Chhipa
6 Apr 2017Excellent Work works like charm
I wanted to know can we order display of columns in custom report?
Pingback: Tools – Racktables – Reportes – Lord Raven's Blog
brian
15 Mai 2017After I install Nagios plugins, (Just copy the file into the plugin directory of racktables)
then, I can see the tag on Main page : Objects : „Nagios“
But How can I config the setting the Nagios?