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

Is it possible to use Regex in Grafana Config #179

Closed
MarcusCaepio opened this issue Aug 20, 2018 · 2 comments
Closed

Is it possible to use Regex in Grafana Config #179

MarcusCaepio opened this issue Aug 20, 2018 · 2 comments

Comments

@MarcusCaepio
Copy link

Hi Carsten,
sorry that I have to open an Issue for this.
First, thanks for all the help, I am on a really good way right now. Everything looks shiny.
I am just struggeling with one situation.

For the service "disk: ...." I have 3 different check commands:

  • disk for icinga hosts
  • by_ssh for linux hosts
  • by_wmi for windows hosts
    For each check_command, there are 2 kind of services: "disk:all partitions", which is my default service, spreaded by an template and "disk:XYZ" which appears, when sb. defines an dictionary (this also disables the all partition check) in an host config. I have a grafana panel called "disk" which already shows all three kinds of check_commands, depending on the host I choose. What I now need, is a way to use sth. like "disk:*" in the module config to lead the module to my default dashboard with the disk panel.

E.G.: In the module config I set the graph with the name "disk:all partitons" to my def. dashboard with the panel id, the Icingaweb preview shows the right graph for the service "disk:all partitions". But if I want the preview of "disk:/var/lib" the module leads to the "icinga-default" dashboard as long as I set "disk:/var/lib" in the module config.
As I don't want to set every single possible mountpoint, I need sth. like "disk:*", which always leads to my default dashboard with the disk panel id.
This regex would fit everything. is that anyhow possible?

Cheers,
Marcus

@Mikesch-mp
Copy link
Owner

Hello @MarcusCaepio ,

iam sorry but thata would not be possible. Icingaweb2 uses Zendframework and there is no working solution to use regex to find a matching configuration in a ini file.

But you can use the custvarconfig option in your services/apply rules to tell the module which dashboard it should use. For example you have a graph configuration for your disks named my_disk_services then you can add to your service/apply rule this line and it will use the graph configuration you put into the custom variable no matter what service name/command name is used.

   vars.grafana_graph_config = "my_service_graphconfig"

The other option is to name your services with a space after "disk:" , then you would also need only 1 graph configuration for service names disk: * . It would match then all service names that start with "disk:"

Best regards,
Carsten

@MarcusCaepio
Copy link
Author

Thanks Carsten, will try it! :) 👍

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