Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

[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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants