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

var-hostname with newest files from repo not working with graphite #204

Closed
christianuhlmann opened this issue Mar 3, 2019 · 5 comments
Closed

Comments

@christianuhlmann
Copy link

with the newest changes from the repo the graphs are not show if you using icinga2 with graphite.
i am using https://hub.docker.com/r/jordan/icinga2/ with some custom enhancement to integrate https://github.com/Mikesch-mp/icingaweb2-module-grafana/ as described in the documentation (https://github.com/Mikesch-mp/icingaweb2-module-grafana/blob/master/doc/02-installation.md)

Dockerfile:

FROM jordan/icinga2
RUN apt-get update && apt-get install -y
apt-transport-https
libcrypt-des-perl
libdigest-hmac-perl
libmonitoring-plugin-perl
libnet-snmp-perl
git
netbase
COPY custom_run /opt/custom_run

custom_run:

#!/bin/bash
ICINGAWEB_MODULEPATH="/usr/local/share/icingaweb2/modules/"
REPO_URL="https://github.com/Mikesch-mp/icingaweb2-module-grafana"
TARGET_DIR="${ICINGAWEB_MODULEPATH}/grafana"
git clone "${REPO_URL}" "${TARGET_DIR}"

Expected Behavior

with the release v1.3.4 the var-hostname for the grafana graphs (and urls) are generated with a replacement of all . to _ (the hosts . are replaced by _ in graphite)

Current Behavior

with the latest version from the repo, this replacement will no longer be performed.

Possible Solution

sorry, I can not provide a possible solution, but I think the changes were made by this commit 323e79f

Steps to Reproduce (for bugs)

  1. build and start the docker as provided (or an other fresh install from icinga with graphite and the grafana modul
  2. configure the grafana modul
  3. setup an host with an fqdn hostname like test.domain.com
  4. after a while check the graphs

Context

no further information on the context

Your Environment

  • Icinga Web 2 Grafana version (System - About): 1.3.5
  • Icinga Web 2 version and modules (System - About): 2.6.2
  • Version used (icinga2 --version): r2.10.2-1
  • Operating System and version: System information: Debian, Platform version: 9 (stretch), Kernel version: 4.19.0-2-amd64, Architecture: x86_64
  • Enabled features (icinga2 feature list): api checker command compatlog debuglog graphite ido-mysql livestatus mainlog notification
  • Config validation (icinga2 daemon -C):
    [2019-03-03 22:59:27 +0000] information/cli: Icinga application loader (version: r2.10.2-1) [2019-03-03 22:59:27 +0000] information/cli: Loading configuration file(s). [2019-03-03 22:59:27 +0000] information/ConfigItem: Committing config item(s). [2019-03-03 22:59:27 +0000] information/ApiListener: My API identity: host.domain.local [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 230 Services. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 1 LivestatusListener. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 1 IcingaApplication. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 33 Hosts. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 2 FileLoggers. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 1 NotificationComponent. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 8 HostGroups. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 1 ApiListener. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 1 GraphiteWriter. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 1 CheckerComponent. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 25 Zones. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 1 ExternalCommandListener. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 23 Endpoints. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 2 ApiUsers. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 1 CompatLogger. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 1 IdoMysqlConnection. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 228 CheckCommands. [2019-03-03 22:59:27 +0000] information/ConfigItem: Instantiated 16 ServiceGroups. [2019-03-03 22:59:27 +0000] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars' [2019-03-03 22:59:27 +0000] information/cli: Finished validating the configuration file(s).
@Mikesch-mp
Copy link
Owner

Does it still change servicenames?

@christianuhlmann
Copy link
Author

Does it still change servicenames?

yes, points are also replaced by underscores

@Mikesch-mp
Copy link
Owner

i fixed a typo. please test latest master.

@christianuhlmann
Copy link
Author

@Mikesch-mp

Thank you for the quick solution.

var-hostname now works as expected.

in my test service with dot (.) in the name, the substitution does not work with an underscore.
This is not a problem for me, my services have no points, but I point out, since you have explicitly asked for it.

@christianuhlmann
Copy link
Author

sorry my mistake, the service var are correct
the command with an . are not changed, so i will close the issue, nobody need a command name with a . :)

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

2 participants