cacti icon indicating copy to clipboard operation
cacti copied to clipboard

Remote Pollers - Support execution of custom functions at poller bottom

Open browniebraun opened this issue 3 years ago • 14 comments

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 avatar Oct 07 '21 13:10 browniebraun

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() ?

netniV avatar Oct 07 '21 13:10 netniV

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

browniebraun avatar Oct 07 '21 13:10 browniebraun

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. ;)

browniebraun avatar Oct 07 '21 13:10 browniebraun

remote_maint:1?

TheWitness avatar Oct 07 '21 17:10 TheWitness

Good point. extending the capabilities would be useful.

browniebraun avatar Oct 07 '21 19:10 browniebraun

Let's make that the plan then.

TheWitness avatar Oct 07 '21 21:10 TheWitness

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.

TheWitness avatar Oct 19 '21 01:10 TheWitness

I would really love meeting again in person.

browniebraun avatar Oct 27 '21 09:10 browniebraun

Yea, before we start expiring...

TheWitness avatar Oct 27 '21 12:10 TheWitness

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

netniV avatar Oct 29 '21 16:10 netniV

Hahaha!! It too me a second this made. My morning

On Fri., Oct. 29, 2021, 12:33 Mark Brugnoli-Vinten, < @.***> wrote:

@browniebraun https://github.com/browniebraun to meet you in person... walk to a mirror... and wave :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Cacti/cacti/issues/4417#issuecomment-954884991, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGEXTHT7M32IEUKNZS4VS3UJLLHXANCNFSM5FRHNC5A .

bmfmancini avatar Oct 31 '21 15:10 bmfmancini

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

browniebraun avatar Nov 01 '21 17:11 browniebraun

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

TheWitness avatar Apr 12 '22 23:04 TheWitness

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).

netniV avatar Apr 13 '22 13:04 netniV

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

TheWitness avatar Oct 08 '22 16:10 TheWitness