Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Sun Dec 21, 2014 10:07 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 42 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: nmidDynTree
PostPosted: Sun Aug 14, 2011 3:06 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2073
Location: Kressbronn, Germany
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 Book
---
Author of the nmid Plugins
Author of the nmidClient for Android
Author of the CereusReporting plugin


Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Tue Aug 16, 2011 4:51 am 
Offline
Cacti User

Joined: Wed Jun 18, 2008 10:21 am
Posts: 110
Location: France
I get those two errors:
Code:
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:
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


Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Tue Aug 16, 2011 4:54 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2073
Location: Kressbronn, Germany
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 Book
---
Author of the nmid Plugins
Author of the nmidClient for Android
Author of the CereusReporting plugin


Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Tue Aug 16, 2011 4:58 am 
Offline
Cacti User

Joined: Wed Jun 18, 2008 10:21 am
Posts: 110
Location: France
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:
global $colors, $config;
include_once($config["library_path"] . "/tree.php");


However I still get these errors:
Code:
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


Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Tue Aug 16, 2011 5:05 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2073
Location: Kressbronn, Germany
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.

_________________
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti Book
---
Author of the nmid Plugins
Author of the nmidClient for Android
Author of the CereusReporting plugin


Last edited by phalek on Tue Aug 16, 2011 5:24 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Tue Aug 16, 2011 5:13 am 
Offline
Cacti User

Joined: Wed Jun 18, 2008 10:21 am
Posts: 110
Location: France
OK. With this new version and this patch:
Code:
--- /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:
Undefined offset: 9 in /srv/http/cacti/lib/html_tree.php on line 727

_________________
Cedric Girard


Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Tue Aug 16, 2011 5:24 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2073
Location: Kressbronn, Germany
Ok, here's another file then, including your patch.


Attachments:
html_tree.zip [12.61 KiB]
Downloaded 134 times

_________________
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti Book
---
Author of the nmid Plugins
Author of the nmidClient for Android
Author of the CereusReporting plugin
Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Tue Aug 16, 2011 6:30 am 
Offline
Cacti User

Joined: Wed Jun 18, 2008 10:21 am
Posts: 110
Location: France
Quite OK:

Code:
--- /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


Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Tue Aug 16, 2011 6:36 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2073
Location: Kressbronn, Germany
Silly me :D

_________________
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti Book
---
Author of the nmid Plugins
Author of the nmidClient for Android
Author of the CereusReporting plugin


Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Tue Aug 16, 2011 6:46 am 
Offline
Cacti User

Joined: Wed Jun 18, 2008 10:21 am
Posts: 110
Location: France
phalek wrote:
Silly me :D

Testing is so old school! :lol:

_________________
Cedric Girard


Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Tue Aug 16, 2011 7:05 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2073
Location: Kressbronn, Germany
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 Book
---
Author of the nmid Plugins
Author of the nmidClient for Android
Author of the CereusReporting plugin


Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Tue Aug 16, 2011 7:10 am 
Offline
Cacti User

Joined: Wed Jun 18, 2008 10:21 am
Posts: 110
Location: France
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


Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Tue Sep 06, 2011 11:44 am 
Offline
Cacti User
User avatar

Joined: Fri Jul 10, 2009 1:38 pm
Posts: 279
Location: Toronto, Canada
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


Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Wed Sep 07, 2011 4:46 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 2073
Location: Kressbronn, Germany
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 Book
---
Author of the nmid Plugins
Author of the nmidClient for Android
Author of the CereusReporting plugin


Top
 Profile  
 
 Post subject: Re: nmidDynTree
PostPosted: Wed Sep 07, 2011 4:50 am 
Offline
Cacti User

Joined: Wed Jun 18, 2008 10:21 am
Posts: 110
Location: France
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 42 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group