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

Rebuilding the poller cache does not always work as expected #5279

Closed
xmacan opened this issue Mar 24, 2023 · 12 comments
Closed

Rebuilding the poller cache does not always work as expected #5279

xmacan opened this issue Mar 24, 2023 · 12 comments
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team porting required Requires porting to develop resolved A fixed issue
Milestone

Comments

@xmacan
Copy link
Member

xmacan commented Mar 24, 2023

I found that multiCPU_avg data source was updated during the update. Old code has a lot of parameters:
function ss_multicpu_avg($hostname,$snmp_community,$snmp_version, $snmp_port,$snmp_timeout)
new code has only host_id.

My poller cache looked like this:
cache1

So I haven't new data data ater update.

I tried system utilities -> rebuild poller cache. Unfortunately I'm not sure if I didn't run cli rebuild_poller_cache.php :-(
Result was:
cache2
Instead of host_id is here hostname. It seems that other parameters have been cut off.

Next run rebuild poller cache from web or cli = the same result.

management -> devices -> choose one -> repopulate poller cache = work well
Cli push_out_hosts.php = works well too.

cache3

For me it is very confusing. Why host repopulating cache is doing anything different than other repopulate action?

1.2.23 (and older version too, I think that I reported it before

@xmacan xmacan added bug Undesired behaviour unverified Some days we don't have a clue labels Mar 24, 2023
@TheWitness
Copy link
Member

Is this the latest 1.2.x branch or what?

@xmacan
Copy link
Member Author

xmacan commented Mar 27, 2023

Last line of issue description - it is on 1.2.23 version. I've seen it on older versions. I can update to actual 1.2.24 branch and test it again if you want.

@TheWitness
Copy link
Member

Please.

@xmacan
Copy link
Member Author

xmacan commented Mar 31, 2023

The first problem. Old ss script has more parameters:
function ss_esxi_vhosts($hostname,$snmp_community,$snmp_port,$snmp_timeout) {
new has only one:
function ss_esxi_vhosts($device_id) {

So after update from (1.2.23 -> 1.2.24) data input method has few obsolete parameters:
poller2

@xmacan
Copy link
Member Author

xmacan commented Mar 31, 2023

the rest. In poller cache I have:
poller_1

After utilities->rebuild_poller_cache (gui) I got
poller3

That is wrong. Rebuild poller cache from cli - the same result.

Save device -> still wrong
php rebuild_poller_cache.php --host-id=611 --debug -> still wrong

php push_out_hosts.php --host-id=611 --debug -> OK
Device -> repopulate pller cache -> OK

@TheWitness
Copy link
Member

Just looking at the rebuild script. Damn, it's wrong in a number of places. That script is not multiple-poller aware as of right now. Big oversight.

TheWitness added a commit that referenced this issue Apr 1, 2023
Rebuild poller cache does not work as expected.

This change modifies the output during runtime and separates each poller_id into larger loops.
TheWitness added a commit that referenced this issue Apr 1, 2023
This change will make the handling between push_out_hosts and rebuild_poller_cache consistent.
@TheWitness TheWitness added resolved A fixed issue confirmed Bug is confirm by dev team and removed unverified Some days we don't have a clue labels Apr 1, 2023
@TheWitness TheWitness added this to the v1.2.25 milestone Apr 1, 2023
@xmacan
Copy link
Member Author

xmacan commented Apr 3, 2023

Tested, works fine now. Thank you

@xmacan
Copy link
Member Author

xmacan commented Apr 3, 2023

Maybe one thing, DEBUG is little bit confusing. I ran rebuild_poller_cache for one host, but scripts says there are '2' devices. Is it normal?

[root@kaktus /usr/local/share/cacti/cli]# php rebuild_poller_cache.php --host-id=649 --debug
NOTE: Do not interrupt this script. Rebuilding the Poller Cache can take quite some time
DEBUG: There are '2' Devices to rebuild poller items for on poller 1.

@xmacan xmacan reopened this Apr 3, 2023
@TheWitness
Copy link
Member

Yea, whoops. Good catch. Let me fix that.

@TheWitness
Copy link
Member

This additional fix will report properly when there is either a host_id or host_template_id specified. It's that stupid host zero case.

@TheWitness
Copy link
Member

Just close when you are satisfied.

@xmacan
Copy link
Member Author

xmacan commented Apr 3, 2023

It is reporting now correctly:
There are '1' Devices to rebuild poller items for on poller 1.

@xmacan xmacan closed this as completed Apr 3, 2023
@TheWitness TheWitness added the porting required Requires porting to develop label Jun 11, 2023
@netniV netniV changed the title Rebuild poller cache does not work as expected Rebuilding the poller cache does not always work as expected Sep 3, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 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 porting required Requires porting to develop resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants