Skip to content
This repository has been archived by the owner on Apr 16, 2018. It is now read-only.

[dev.icinga.com #11358] Allow nicer names for display_name instead of only $name #347

Open
icinga-migration opened this issue Mar 10, 2016 · 1 comment

Comments

@icinga-migration
Copy link

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

Created by pregopresto on 2016-03-10 22:18:20 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-03-20 21:59:30 +00:00 (in Redmine)


For services it is nice to have speaking services names. This is often a prefix like $name, followed by a variable. For example if I have a check_procs, I possibly don't only want to see "procs" but "procs-apache2", "procs-openvpn" and so on. Another example would be to monitor Apache vhosts and instead of "http" I would like to see "http-example.net", "http-foobar.com"

Currently the apply_service.pp sets the default value of display_name to "$name" and in the apply_service.conf.erb the variable is put into "". This doesn't allow to work with variables because they are not resolved by icinga2 later. I think something like the logic at CheckCommand for cmd_path is needed here to allow a mixture of strings and variables.

@icinga-migration
Copy link
Author

Updated by pregopresto on 2016-03-20 21:59:30 +00:00

I looked again into it and I think the solution is to have only name (no $) as default value for display_name. The desired output should be:

display_name = name

This solution is currently not possible though, because the template puts the display_name always into brackets:

  <%- if @display_name -%>
  display_name = "<%= @display_name -%>"
  <%- end -%>

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

No branches or pull requests

1 participant