Skip to content

Support execution of custom functions at poller bottom for remote pollers #4417

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

Closed
browniebraun opened this issue Oct 7, 2021 · 15 comments
Closed
Labels
enhancement General tag for an enhancement resolved A fixed issue
Milestone

Comments

@browniebraun
Copy link
Member

browniebraun commented Oct 7, 2021

Feature Request

Hook 'poller_finishing' could probably used for that approach too, but I'm wondering why we are not supporting a hook to perform individual plugin tasks at the bottom of a remote poller run.

The current code of poller.php does not take this case into account - If I'm not totally wrong. From my point of view a remote poller is not just stupid collector. It should be workhorse.

`/* start post data processing */
if ($poller_id == 1) {
	multiple_poller_boost_check();
	poller_replicate_check();
	snmpagent_poller_bottom();
	boost_poller_bottom();
	dsstats_poller_bottom();
	dsdebug_poller_bottom();
	reports_poller_bottom();
	spikekill_poller_bottom();
	automation_poller_bottom();
	poller_maintenance();
	api_plugin_hook('poller_bottom');
	bad_index_check($mibs);
} else {
	// flush the boost table if in recovery mode
	if ($poller_id > 1 && $config['connection'] == 'recovery') {
		cacti_log('NOTE: Remote Data Collection to force processing of boost records.', true, 'POLLER');
		poller_recovery_flush_boost($poller_id);
	}
	automation_poller_bottom();
	poller_maintenance();
}
`
@browniebraun browniebraun added the enhancement General tag for an enhancement label Oct 7, 2021
@netniV
Copy link
Member

netniV commented Oct 7, 2021

The reason for this is to process all data that is now gathered back on the main poller at the end of the cycle. I would imagine if you want it on a remote poller I guess it should come under poller_maintainence() ?

@browniebraun
Copy link
Member Author

yep, that's the right place to execute tasks e.g. for hosts a remote poller is handling.

@browniebraun
Copy link
Member Author

Well, you know I'm most probably the only one using the RRDproxy as data backend, but it offers you the option to make the remote pollers more independent. ;)

@TheWitness
Copy link
Member

remote_maint:1?

@browniebraun
Copy link
Member Author

Good point. extending the capabilities would be useful.

@TheWitness
Copy link
Member

Let's make that the plan then.

@TheWitness
Copy link
Member

You know, we need to spend some of our funds to get together again. Airfares are too high right now though. Stupid COVID. Blame the Chinese Communist Party, the US government, the NIH, and the Department of Defense for colluding in biological warfare research.

@browniebraun
Copy link
Member Author

I would really love meeting again in person.

@TheWitness
Copy link
Member

Yea, before we start expiring...

@netniV
Copy link
Member

netniV commented Oct 29, 2021

@browniebraun to meet you in person... walk to a mirror... and wave :)

@bmfmancini
Copy link
Member

bmfmancini commented Oct 31, 2021 via email

@browniebraun
Copy link
Member Author

lol. Already done. Damn! I'm old and gray. 😉

@TheWitness TheWitness added this to the v1.2.21 milestone Feb 14, 2022
@TheWitness
Copy link
Member

I'm half past dead. @bmfmancini did we kind of already get this one with the changes for syslog?

@netniV
Copy link
Member

netniV commented Apr 13, 2022

Currently poller.php has two hooks for poller_bottom but doesn't pass data to suggest which place it's calling from (in the loop or out of it).

@TheWitness TheWitness modified the milestones: v1.2.21, v1.2.22 Apr 14, 2022
@TheWitness TheWitness modified the milestones: v1.2.22, v1.2.23 Jun 19, 2022
@TheWitness TheWitness added the resolved A fixed issue label Oct 8, 2022
TheWitness added a commit that referenced this issue Oct 8, 2022
Remote Pollers - Support execution of custom functions at poller bottom
@TheWitness
Copy link
Member

Okay, new hook in poller_maintenance.php called poller_remote_maint and only run on Remote Data Collectors. Documentation site updated as well.

@netniV netniV changed the title Remote Pollers - Support execution of custom functions at poller bottom Support execution of custom functions at poller bottom for remote pollers Dec 31, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement General tag for an enhancement resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

4 participants