Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins may not work correctly with Multi-Poller setups #4951

Closed
roninsakos opened this issue Oct 12, 2022 · 23 comments
Closed

Plugins may not work correctly with Multi-Poller setups #4951

roninsakos opened this issue Oct 12, 2022 · 23 comments
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team question A question not a bug remote data collection Issue related to remote data collection resolved A fixed issue
Milestone

Comments

@roninsakos
Copy link

roninsakos commented Oct 12, 2022

Describe the bug

We have cacti 1.2.16 on linux env with a multipoller setup (6 remote +1 main ) and we decide to upgrade to 1.2.22.The main plugins that we use is reportit and weathermap. it seems that after the upgrade we face a long/lot of delays on every click that we do on the new environment. After reading the issues
#4611
#4611
#4615
#4615

from the above i understood that until version 1.2.20 the hook tables of the plugins from the main poller didn't sync on the remote pollers so the plugins always run only on the main.after 1.2.20 every poller run the plugins.it seems that on the above 2 plugins that we use (reportit ,weathermap) create unexpectedly long delays and they can not work correctly any more on a multi poller environment.

To Reproduce

we tested it with one main poller and one remote. when we install the plugins and we go to the graphs tab , the graphs take a long time to appear.also clicking on any cacti choice from "console" it seems that we have 2-3 sec delay. if we uninstall the plugins or disable the remote pollers the delays disappear . there are no error logs even on a debug log level.

Expected behavior

option for the remote pollers not to copy or not act like they are the main poller and run plugins.

Desktop (please complete the following information)

  • OS centos 7

  • chrome,firefox

Additional context

the plugin options on the INFO file
capabilities = online_view:0, online_mgmt:0, offline_view:0, offline_mgmt:0, remote_collect:0
seems not to have any effect

@roninsakos roninsakos added bug Undesired behaviour unverified Some days we don't have a clue labels Oct 12, 2022
@thurban
Copy link
Contributor

thurban commented Oct 12, 2022

The sync/copy of files for plugins is configured using the "nosync" setting in the INFO file.

Here's an example to skip most of the file/directory copy to the remote pollers for the CereusReporting plugin:
nosync = archive,backup,tmp,*.pdf,setup.php,vendor,server,templates,translations,ReportEngines,queueScripts,modules,libs,include,images,dsstats_reports,docs,assets,*.php

@roninsakos
Copy link
Author

roninsakos commented Oct 12, 2022

How this action can help our case?isn't a file problem but a db/cacti problem and it has to do with the way cacti handles the plugins in a multipoller env after the 1.2.20 changes.To mention that we have tried the above options but we have also the cacti option resource sync disable.we tried also to delete he plugin folder from the remote poller but we can not avoid the sync between the main and the remote poller and whatever we do the tables are copied in the remote poller.(plugin_*).i am confident that it has to do with the sync because when we disable the remote poller with the plugins activated and installed everything is ok. Also it works fine in a standalone poller and it wotks fine in all versions prior 1.2.20

@thurban
Copy link
Contributor

thurban commented Oct 12, 2022

Well, check if the plugins exists on the remote poller and if there is a setup.php file on there. If yes, then it copied over the plugin.
You can prevent this behaviour with the nosync entry in the INFO file.

Obviously setting "resource sync" to disable should also have the same effect, just checking if the setting is being ignored or the sync is always done even if the "nosync" is set.

@roninsakos
Copy link
Author

roninsakos commented Oct 12, 2022

The nosync option has to do with files/folders.And yes it works.but have in mind that even with no plugin folder in the renote poller the plugin tables are sync and i can see the active/inactive plugins from the remote poller gui using the cacti plugin option with/or without a plugin folder( on the remote poller)

@thurban
Copy link
Contributor

thurban commented Oct 12, 2022

Yes, but it does not call the plugin hook if the files are not present, the cacti code prevents it and does not cause any performance issues.

Basically, it's a UI issue on the remote pollers, where the plugin page should hide any plugins that are not existing/working on the remote poller. But it does not cause any performance issues.

I had this behaviour with a Cacti setup previously, but that was mostly caused by hostname/dns resolution issues. Can you check that DNS resolution is ok or switch to IP addresses for the remote pollers ?

@roninsakos
Copy link
Author

for being more precise i uploaded a video with the problem.in the browser i have two tabs .one with the main poller and one with the remote. in the remote the plugin folder is always empty.i have disable the resource sync.there is only one device on the main poller.(localhost) . when the plugin is active/installed when i go to the graphs tabs there is a delay of 3-4 sec on every graph.in a live env this delay is multiplied by the graphs that the device has. if i remove the remote poller or disable the plugin everything works fine and there is no delay. In the remote poller the plugin is visible without the plugin files to be present on the /cacti/plugin folder.one more thing that i saw is that the apache service take long time to restart when the problem occurs (without errors on cacti logs).from dns perspective everything looks fine.

cacti.mp4

@roninsakos
Copy link
Author

roninsakos commented Oct 14, 2022

While testing things i came across on this piece of code on /cacti/lib/poller.php

if ($class == 'all' || $class == 'plugins') {
       $data = db_fetch_assoc('SELECT * FROM plugin_config');
       replicate_out_table($rcnn_id, $data, 'plugin_config', $remote_poller_id);
       $data = db_fetch_assoc('SELECT * FROM plugin_hooks');
       replicate_out_table($rcnn_id, $data, 'plugin_hooks', $remote_poller_id);
       $data = db_fetch_assoc('SELECT * FROM plugin_realms');
       replicate_out_table($rcnn_id, $data, 'plugin_realms', $remote_poller_id);
}

if i comment it out ,it fix the delay/performance issue. Perhaps a check/flag code could be introduced here for which plugins we/must need to be replicated to the remote pollers.

@TheWitness
Copy link
Member

Interesting that reportit shows up, but nothing else. Is that due to it being the only plugin replicated?

@roninsakos
Copy link
Author

roninsakos commented Oct 15, 2022

The plugins on the main poller are not installed/disabled except from reportit.if i activate/install them they will show up also on the remote without the cacti/plugin folder to be present on the remote poller.the performance issue appears with reportit,weathermap.i havent test the others.the above code that i post replicates all the plugin table.so i assume it will replicate all the installed plugins.

@TheWitness
Copy link
Member

So, you have file replication disabled?

@roninsakos
Copy link
Author

resource replication is disabled, yes.

@roninsakos
Copy link
Author

hello, any update on that? do you have tested it to verify the performance issue? thnk you.

@TheWitness
Copy link
Member

I've updated Intropage to work a bit better, but you have to show the log's for the other plugin errors.

TheWitness added a commit that referenced this issue Oct 20, 2022
@TheWitness
Copy link
Member

Update to the latest lib/plugins.php and see if it makes a difference.

@roninsakos
Copy link
Author

hello there are no errors on the plugins/logs. i will try the new file .

@roninsakos
Copy link
Author

roninsakos commented Oct 26, 2022

i just push the change to the test env but still there is delay when going to see graphs. ( i unistall/install again the plugins)

@TheWitness TheWitness added the remote data collection Issue related to remote data collection label Nov 1, 2022
@TheWitness
Copy link
Member

Just getting back from vacation.

@roninsakos
Copy link
Author

roninsakos commented Nov 9, 2022

Hello , any update?

@TheWitness
Copy link
Member

Busy with the day job. Sorry. Weekends mostly and when I get free time at the moment.

@roninsakos
Copy link
Author

reminder

@TheWitness
Copy link
Member

Can you enable the file replication between your master Cacti server and the remotes?

@roninsakos
Copy link
Author

Yes.no difference.same problem

@TheWitness
Copy link
Member

@roninsakos, I'm back at it today. By any chance, are you available to go through the issue online? Do you have a lab setup with the problems? Sorry, stuff like this has to happen on the weekends. You can reach me at thewitness at cacti dot net.

TheWitness added a commit that referenced this issue Dec 18, 2022
* upgrading to 1.2.22 most of the plugins break in a multipoller setup
* When remote poller is in offline mode GUI inaccesible and poller times out
* When in Recovery Mode plugins that are designed to work remotely stop working
@TheWitness TheWitness added confirmed Bug is confirm by dev team and removed unverified Some days we don't have a clue labels Dec 18, 2022
@TheWitness TheWitness added question A question not a bug resolved A fixed issue labels Dec 18, 2022
@TheWitness TheWitness added this to the v1.2.23 milestone Dec 18, 2022
TheWitness added a commit that referenced this issue Dec 18, 2022
Porting these three fixes from the 1.2.x branch

* upgrading to 1.2.22 most of the plugins break in a multipoller setup
* When remote poller is in offline mode GUI inaccesible and poller times out
* When in Recovery Mode plugins that are designed to work remotely stop working
@netniV netniV changed the title upgrading to 1.2.22 most of the plugins break in a multipoller setup Plugins may not work correctly with Multi-Poller setups Dec 31, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team question A question not a bug remote data collection Issue related to remote data collection resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants