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

Optional use host_display_name instead of host_name in call to Grafana #133

Closed
idMaxCZ opened this issue Mar 16, 2018 · 4 comments
Closed

Comments

@idMaxCZ
Copy link

idMaxCZ commented Mar 16, 2018

Feature request:

Please add combobox option to Module configuration for optional change var-hostname source. In present version of module is everytime used host_name host variable for call grafana. I suggest two options - host_name as default and host_display_name as optional way.

We have stored data in influx under display_names because host_name are humen unreadable strings from our configuration management database.

Example current:
.../dashboard-solo/db/icinga2-default?var-hostname=srv154848754878&var-serv...

Expected state:
.../dashboard-solo/db/icinga2-default?var-hostname=testmachine_displayname&var-serv...

Icinga host object:
object Host "srv154848754878" {
import "generic-host"
display_name = "testmachine_displayname"
address = "8.8.8.8"
}

Thank you

@Mikesch-mp
Copy link
Owner

Hello @idMaxCZ ,
in short: no!
The problem is that in icinga2 host_names have to be unique and display_name you can have hundreds of the same. If you need to display the display_name in your graphs, just get it via templating (as query) or set it via the customvar option of the module and then use it.

if you want to set it via customvar option you have to create a custom var that points to the display_name like

vars.displayname = display_name

then for the graph configuration set custom variables like this

&var-displayname=$displayname$

@idMaxCZ
Copy link
Author

idMaxCZ commented Mar 19, 2018

Thank you for your answer. I understand there can be problem with duplicates, this is reason why i recommend this as optional option in module configuration. Default as host_name with possibility change to display_name.

I am little bit stacked now, because I have named measurements by display_name and host_name is not present in my influxDB. I already updated Grapher.php for this, but its my hack and every version of plugin I have update this file again.

FYI: We have controlled Icinga hosts by CMDB and there is protection mechanism for duplicates. This is reason, why I am not afraid

@dnsmichi
Copy link
Collaborator

Going for display_name is dangerous here, as you cannot guarantee the correctly selected graph for it. I don‘t think that such a special case should be handled with yet another config option either. Imho the module already has too many config settings and behaviours, impossible to test them all to endure stable releases.

@idMaxCZ
Copy link
Author

idMaxCZ commented Mar 20, 2018

I totally understand, our environment is probably specific.
Closing this feature request. Thank you for your opinions and suggestions.

@idMaxCZ idMaxCZ closed this as completed Mar 20, 2018
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

3 participants