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

[dev.icinga.com #12994] icinga2_checkcommand LWRP does not seem to manage command arrays properly #238

Open
icinga-migration opened this issue Oct 27, 2016 · 0 comments
Assignees
Labels

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/12994

Created by Kwisatx on 2016-10-27 14:35:35 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-10-27 14:35:35 +00:00 (in Redmine)


Hello,

I've been trying to use the icinga2_checkcommand LWRP, and I've run across an issue with the generated CheckCommand object.

icinga2_checkcommand 'check_redis_memory' do
  command ["\"#{node['icinga2']['custom_plugins_dir']}/check_redis\"", "\"used_memory\""]
  arguments "-H" => "$address$", "-p" => "$port$"
end

will generate an object with a missing comma:

object CheckCommand "check_redis_memory" {
  import "plugin-check-command"
  command = [
    "/opt/icinga2_custom_plugins/check_redis" << There should be a comma here according to icinga2
    "used_memory"
  ]
  arguments = {
    "-H" = "$address$"
    "-p" = "$port$"
  }
}

From what I can see, this is the behavior coded in https://github.com/Icinga/chef-icinga2/blob/master/templates/default/object.checkcommand.conf.erb.
Am I missing something, or should we be adding commas when treating options['command']?

I've worked around the issue by taking advantage of the fact that a layer of quotation marks is stripped from the command to add the comma in the first layer of quotation marks (["\"#{node['icinga2']['custom_plugins_dir']}/check_redis\",", "\"used_memory\""]) but this does not seem ideal.

Thanks!

@vkhatri vkhatri self-assigned this Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants