sni / Thruk

Thruk is a multibackend monitoring webinterface for Naemon, Nagios, Icinga and Shinken using the Livestatus API.
http://www.thruk.org
Other
408 stars 147 forks source link

Configuration variable for Host Name in different pages #1087

Open Muletia opened 3 years ago

Muletia commented 3 years ago

I've looked through the options but could not see anything that would do this for us. I've also had a search through all issues and could not see anything like being reported.

We have recently started migrated from Checmk Raw to to Checkmk Enterprise and have noticed that if we have an alias configured this value is populated into the display_name livestatus field which Thruk uses for displaying in the various pages.

It would be nice if a configuration option was added to allow us to override which column we use in the various pages, eg:

I looked through the template files and found a few places where I could update entries to make it display the correct value but it will take a bit of work to figure it all out and to create a patch we can apply when upgrading. Having a config option would be infinitely more useful.

A work around would be to delete all our alias fields as that forces Livestatus to default to the hostname if no alias is defined, however we use this field to supplement our alerting with the devices role so we can send this through as part of our alerting.

We use Thruk because we've found there are some places where it's much better and more useable than the native Checkmk interface and would like to continue with it as the primary interface our support teams use.

sni commented 3 years ago

As you already noticed, it will be quite some work to do this. A configuration option is quickly added, but you need to change all templates which use the host/servicename in some way and thats more or less almost all of them. I would add a wrapper function in the lib/Thruk/Utils/Filter.pm which could then decide which name to use. For example add a function hostname() which returns the configured host name. Then do the same for service descriptions. There is a similar thing for peer names already: https://github.com/sni/Thruk/blob/master/lib/Thruk/Utils/Filter.pm#L1257

Muletia commented 3 years ago

Good idea. I'll take a look at the code you've pointed to and see if I can follow it. Cheers for the feedback.