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
[dev.icinga.com #10971] Services created on satellite without name fail when synchronizing with master. #3840
Comments
Updated by mfriedrich on 2016-01-14 14:36:17 +00:00
That config does not match the error message. Please attach the config file from the output. |
Updated by pkcinna on 2016-01-14 21:24:29 +00:00
It looks like if no name is set the name is created from the loop value but that is an array itself so when converted to a string, it has embedded quotes Example: |
Updated by mfriedrich on 2016-01-15 07:46:46 +00:00 That's how apply for is designed to work - taking the value from an array, or the key from a dictionary in a for loop. Yours is a nested array, wouldn't that better fit as dictionary with the service name as key, and the list of whatever as array? Imho this is a config issue, not a bug. |
Updated by pkcinna on 2016-01-15 12:40:06 +00:00 I agree it may seem minor but in my opinion it needs to be consistent... either invalid on both the satellite and the master or valid on both. For example... |
Updated by gbeutner on 2016-01-21 08:12:40 +00:00
The real problem here is that the object's name isn't quoted properly, i.e. this is a duplicate of #10989. |
Updated by gbeutner on 2016-01-21 08:12:51 +00:00
|
This issue has been migrated from Redmine: https://dev.icinga.com/issues/10971
Created by pkcinna on 2016-01-14 13:59:58 +00:00
Assignee: pkcinna
Status: Rejected (closed on 2016-01-21 08:12:40 +00:00)
Target Version: (none)
Last Update: 2016-01-21 08:12:40 +00:00 (in Redmine)
Example below with name commented out works fine from satellite but if another icinga tries to sync it will cause a an invalid service name on master.
Config on satellite:
apply Service for ( svc in host.vars.training_service_paths) { import "check-svc-service" vars.tmo_platform = host.vars.tmo_platform vars.tmo_env = svc[0] groups += [ svc[0] + " " + svc[1] ] notes_url = "/check_service/notes.php?service_category=" + host.vars.tmo_platform + "&env=" + svc[0] + "&service=" + svc[1] + "&method=" + svc[2] //name = svc[0] + " - " + svc[1] + " " + svc[2] display_name = svc[0] + " - " + svc[1] + " " + svc[2] vars.tmo_service_paths = svc[1] + "/" + svc[2] assign where host.vars.tmo_platform == "training" }
Sync on master generates services names with lots of quotes:
sudo icinga2 node update-config sudo service icinga2 checkconfig
Attachments
Relations:
The text was updated successfully, but these errors were encountered: