Eric Stewart: Running Off At The Mouth

UnifiedTrees 1.0 Cacti Plugin: Major Update

by Eric Stewart on Feb.16, 2016, under Networking, Technology

It’s time to upgrade my Cacti installs and also upgrade UnifiedTrees to work with the new version of Cacti.  Be aware that it’s likely that the GitHub repo will be under active development for a while, so I’d recommend downloading from the releases page.  There’s some information in the original blog post about UT.  Install should be fairly simple:

  1. Unzip it into your Cacti plugins directory.
  2. Do the whole “install” “enable” in Plugins Management.
  3. Go through the settings (depending on how many Cacti installs you have, pick a server and then make everyone else a client).
  4. Don’t forget database users and all that.

First, the good news:

  • UnifiedTrees 1.0 (and above) shouldn’t require any patching.
  • It uses the Cacti 0.8.8f (and I suspect back down to “c”) JavaScript tree.
  • If you’re running in a mixed environment (where you haven’t upgraded all of your Cacti instances to 0.8.8f and might be running UnifiedTrees 0.8) it should handle switching to the older server fairly painlessly, and an individual Cacti install is what renders the tree, even if it’s a client.  So you can have a server running 0.8 and a client running 1.0 or visa versa.  Theoretically, anyway.
  • The database didn’t change, and the back-end tree collection did not change.

The bad news:

  • It won’t be supported on Cacti earlier than 0.8.8f and I doubt seriously that it will work at all on 0.8.8b and earlier.
  • Upgrading UT should be done during the same process as upgrading Cacti.  In my case, it involved setting up a separate directory, doing “git clone”s in the plugins directory of that new Cacti directory.  What I do with Cacti is create the new/upgrade install into a directory that includes a version tag in the name and then change a non-tagged symlink when I’m ready to pull the trigger.  Additional notes on that:
    • In your preferred method, trigger a Poller Cache rebuild – that will probably fix any rra path issues.
    • You may need to bounce (disable/enable) the UT plugin for the new version to truly kick in.
  • There’s likely a lot of old code that’s not even used.
  • It hasn’t been tested much (yet), so it’s probably a bit buggy.

Evil gritty details:

The “new” tree that Cacti uses handles “local” references in such a way that the URL/page doesn’t show (in the location bar) the reference to a given host entry.  I am not very Javascript savvy so how exactly this works is not something I understand all that well.  I did have to come up with some ugly looking code here and there to handle things like:

  • Realizing the selected “node” in a tree is actually on another server, forcing the Javascript to open a URL fully in the browser instead of just pulling the data like Cacti does natively.
  • Once that URL is triggered, code was needed to pick apart the URL to determine the new value for “node_id” (which isn’t directly correlative or codified with any other information, and can change depending on your UT setup/design) so that the Javascript on the new server knows what data to pull and display.

Hi! Did you get all the way down here and not find an answer to your question? The two preferred options for contacting me are:
  • Twitter: Just start your Twitter message with @BotFodder and I'll respond to it when I see it.
  • Reply to the post: Register (if you haven't already) on the site, submit your question as a comment to the blog post, and I'll reply as a comment.

Leave a Reply

You must be logged in to post a comment.