Cacti 1.1.5 (partly?) loads plugins even during installer

Support for the Plugin Architecture

Moderators: Developers, Moderators

Post Reply
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Cacti 1.1.5 (partly?) loads plugins even during installer

Post by Howie »

I've been updating a script for Vagrant to get a Cacti 1.x development environment going automatically, and I noticed something odd:

even during the installer process of Cacti (accepting license, checks etc), some parts of inactive plugins are loaded. If I have weathermap in the plugins/ directory before the installer has run, then a few jquery parts (select All on the templates selection page) don't work, and the final Cacti console stops partway down - BEFORE any plugins are installed or enabled.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Cacti 1.1.5 (partly?) loads plugins even during installe

Post by Howie »

Also, if you (as a completely random example) download the latest release of thold from github, unzip it, try to install it, realise that it's not actually for Cacti 1.x and that you need to do a git clone to get a working version, then delete the directory and do that, Cacti will continue to tell you that it's not compatible - I guess something caches the previous version's status?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Cacti 1.1.5 (partly?) loads plugins even during installe

Post by Osiris »

Howie,

Can you reconfirm with 1.1.34, and if they still exist, open these as issues in the GitHub repo. In 1.1.34, all the headers common across all pages now. I think the second may still be an issue.
Before history, there was a paradise, now dust.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti 1.1.5 (partly?) loads plugins even during installe

Post by netniV »

So there are three functions in lib/plugins.php which look at the plugins/<plugin>/INFO file.
  • api_plugin_get_dependencies()
    This function uses parse_ini_file() to load the data into an array, then returns an array of the dependancies.

    This is used within lib/plugins.php by api_plugin_install()
  • api_plugin_remote_capabilities()
    This function uses parse_ini_file() to load the data into an array, then returns an array of the capabilities

    This is used within lib/plugins.php by api_plugin_run_plugin_hook() and api_plugin_run_plugin_hook_function() to run hooks, and api_plugin_has_capability() to check for capabilities
  • plugin_is_compatible()
    This function uses plugin_load_info_file to load the data into an array. If the value was returned as FALSE then it is assumed to be a legacy plugin. If the value returned is an array, it tries to find the version of compatibility and makes sure that the Cacti system is not below that value.

    This is used in plugins.php to determine whether to display the plugin as being compatible or not
None of these three functions check that a plugin is disabled, they simply read that data. Most of the code is completely unaware of what plugins are installed/enabled or not. If a plugin is installed, it will appear in the SQL database in the plugin_config table. The status field of that table determines whether it's enabled or not.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Cacti 1.1.5 (partly?) loads plugins even during installe

Post by phalek »

As far as I remember the setup.php file is always read in so anything that's in there and not contained in a function will be executed/included.

I realized that when I encrypted that file and Cacti failed to load although the plugin wasn't enabled at all.

Though that was with 0.8.x and I've not tested it with 1.x
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
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Cacti 1.1.5 (partly?) loads plugins even during installe

Post by Howie »

1.x has a much more involved setup process (which is a good thing! :-) ). I was a bit surprised I could break it.

Anyway, I think it's no longer an issue. My vagrant build script still does the same thing, and on newer 1.x it's fine.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests