nmidDynTree

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

nmidDynTree

Post by phalek »

This is the first release of the nmidDynTree plugin. This plugin replaces the default cacti tree with a ajax based JQuery based plugin.

Features of this release:
- Save selected Item in cookie
- Load sub-items on demand (ajax)
- Different icons can be added ( currently, only "header" and "host" are different )
- Supports multiple trees
- Supports default Cacti access

Compatibility: Cacti 0.8.7g with PIA 2.9.

This plugin comes with two files, the plugin itself and a replacement for the lib/html_tree.php file.

To install, download the zip and unpack it into the plugins dir. Enabling it as usual.
Then replace your html_tree.php file with the one on the same download page


You can download the plugin here: http://redmine.nmid-plugins.de/projects ... tree/files

Look at the screenshot of the replacement tree:
Image
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
X-dark
Cacti User
Posts: 111
Joined: Wed Jun 18, 2008 10:21 am
Location: France

Re: nmidDynTree

Post by X-dark »

I get those two errors:

Code: Select all

Undefined variable: dhtml_tree in /srv/http/cacti/lib/html_tree.php on line 504
Call to undefined function tree_tier() in /srv/http/cacti/lib/html_tree.php on line 617
The first one may be related to the commented line 502. If I uncomment it I get this error instead :

Code: Select all

Undefined offset: 9 in /srv/http/cacti/lib/html_tree.php on line 726
I've no idea why the error on line 617 as the include tree.php should provide the function.
Cedric Girard
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: nmidDynTree

Post by phalek »

Odd,

Going to invest this.

Replacing the html_tree.php with the original file will give you the old Cacti style back.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
X-dark
Cacti User
Posts: 111
Joined: Wed Jun 18, 2008 10:21 am
Location: France

Re: nmidDynTree

Post by X-dark »

X-dark wrote:I've no idea why the error on line 617 as the include tree.php should provide the function.
Actually there is no include in that function. With those two additional lines at the beginning of create_dhtml_tree function, it works:

Code: Select all

global $colors, $config;
include_once($config["library_path"] . "/tree.php");
However I still get these errors:

Code: Select all

Undefined variable: dhtml_tree in /srv/http/cacti/lib/html_tree.php on line 504
Undefined offset: 9 in /srv/http/cacti/lib/html_tree.php on line 728
Cedric Girard
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: nmidDynTree

Post by phalek »

Please use the attached files, that should fix these issues.

Edit: File removed, updates will be provided with a new version from the project page mentioned above.
Last edited by phalek on Tue Aug 16, 2011 5:24 am, edited 1 time in total.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
X-dark
Cacti User
Posts: 111
Joined: Wed Jun 18, 2008 10:21 am
Location: France

Re: nmidDynTree

Post by X-dark »

OK. With this new version and this patch:

Code: Select all

--- /tmp/html_tree.php	2011-08-16 12:04:16.000000000 +0200
+++ html_tree.php	2011-08-16 12:11:18.000000000 +0200
@@ -559,6 +559,10 @@
 }
 
 function create_dhtml_tree() {
+	global $colors, $config;
+
+	include_once($config["library_path"] . "/tree.php");
+
 	/* Record Start Time */
 	list($micro,$seconds) = split(" ", microtime());
 	$start = $seconds + $micro;
The only error left is:

Code: Select all

Undefined offset: 9 in /srv/http/cacti/lib/html_tree.php on line 727
Cedric Girard
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: nmidDynTree

Post by phalek »

Ok, here's another file then, including your patch.
Attachments
html_tree.zip
(12.61 KiB) Downloaded 300 times
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
X-dark
Cacti User
Posts: 111
Joined: Wed Jun 18, 2008 10:21 am
Location: France

Re: nmidDynTree

Post by X-dark »

Quite OK:

Code: Select all

--- /tmp/html_tree.php	2011-08-16 12:22:04.000000000 +0200
+++ /srv/http/cacti/lib/html_tree.php	2011-08-16 13:28:47.000000000 +0200
@@ -724,7 +724,7 @@
 			}
 			if ( $tier > 0 ) {
 				for ( $tierCount = $oldTier; $tierCount >= 0; $tierCount-- ) {
-					if ( array_key_exists($i, $dhtml_tree) {
+					if ( array_key_exists($i, $dhtml_tree)) {
 						$dhtml_tree[$i] = $dhtml_tree[$i]  .  "</ul></li>\n";
 					}
 				}
Cedric Girard
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: nmidDynTree

Post by phalek »

Silly me :D
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
X-dark
Cacti User
Posts: 111
Joined: Wed Jun 18, 2008 10:21 am
Location: France

Re: nmidDynTree

Post by X-dark »

phalek wrote:Silly me :D
Testing is so old school! :lol:
Cedric Girard
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: nmidDynTree

Post by phalek »

Sure, but only if you're having a mobile virtual cacti system on your android system ... ehm
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
X-dark
Cacti User
Posts: 111
Joined: Wed Jun 18, 2008 10:21 am
Location: France

Re: nmidDynTree

Post by X-dark »

phalek wrote:Sure, but only if you're having a mobile virtual cacti system on your android system ... ehm
Indeed, this may complicate the testing part. ;)
Cedric Girard
User avatar
zoemu
Cacti User
Posts: 287
Joined: Fri Jul 10, 2009 1:38 pm
Location: Toronto, Canada

Re: nmidDynTree

Post by zoemu »

Phalek:

I installed nmidDynTree, and it went well..just a small problem....the menu never loads; I just get the circuling timer that's all...anyideas ?

Thanks

LA
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: nmidDynTree

Post by phalek »

It's an ajax call to the server, so it's actually calling the following URL to get the tree:

http://<server>/cacti/plugins/nmidDynTree/getTree.php
or
http://<server>/plugins/nmidDynTree/getTree.php

try these and check if you do get any data back.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
X-dark
Cacti User
Posts: 111
Joined: Wed Jun 18, 2008 10:21 am
Location: France

Re: nmidDynTree

Post by X-dark »

phalek wrote:Just realized that it's not loading the tree partially but instead always loads the whole tree. I'm going to debug it and change that.
Any update on this bug?
Cedric Girard
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests