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

mass-migration of api-objects #10249

Open
K0nne opened this issue Nov 21, 2024 · 2 comments
Open

mass-migration of api-objects #10249

K0nne opened this issue Nov 21, 2024 · 2 comments

Comments

@K0nne
Copy link
Contributor

K0nne commented Nov 21, 2024

Describe the bug

I need to migrate a few thousend hosts and services. These objects were created with api-calls. Our zones have changed and I am in need to move those objects into a new zone.

When I change the zone-attribute of a host and its services in /var/lib/icinga2/api/packages/_api/<individual_name>/conf.d/services and /hosts on the configmaster, the checks for those objects are executed manualy without problems afterwards, but the automatic scheduling seems broken, because the checks are pending now. Manual scheduling works to fix this temporary, but in the next cycle there's no automatic scheduling again.

after zone-attribute modification:
image

after manual execution:
image

next automatic cycle:
image

When I move the zone-attribute back to its original value, scheduling of those checks is working again.

Question

Is there a convenient way to mass-migrate api-objects into another zone? Just the zone-attribute needs to change.
I have no automatic way to perform this.

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Version used (icinga2 --version): 2.13.10
  • Operating System and version: RHEL8
  • Enabled features (icinga2 feature list):
Disabled features: command compatlog debuglog elasticsearch gelf graphite influxdb2 livestatus opentsdb perfdata statusdata syslog
Enabled features: api checker icingadb influxdb mainlog notification
  • Icinga Web 2 version and modules (System - About): 2.12.1
@Al2Klimov
Copy link
Member

Hello @K0nne and thank you for reporting!

change the zone-attribute of a host and its services in /var/lib/icinga2/api/packages/_api/<individual_name>/conf.d/services and /hosts on the configmaster

On Fedora 40, I've done exactly this to my Icinga 2.14.3 and reloaded all nodes. The hosts still got checked. Didn't test services so far, but you could try incrementing the version attribute by 1.

Cheers && A/K

@K0nne
Copy link
Contributor Author

K0nne commented Nov 26, 2024

I have tested your suggestion (changed the zones-attribute of a host and its services to the new zone, increased the version-attibute of those objects by 1, reloaded the configmaster and all affected satellites), but unfortunately it did not change anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants