Closed bjornfro closed 3 years ago
Hi Bjorn, I'm not actively developing on histou any more. If you are using OMD with Thruk then there should be a link for each service in the UI, which creates dynamic dashboards. If you are not using this setup, you have to configure everything on your own which is tricky ;) So I would recommend to use OMD with Thruk. Best regards, Philip
Sure, not demanding any support here, for sure ;-) Also, I have the setup working, just like I assume it's done in OMD. That is not the issue. This was just a question around how you use the histou templates. To for example create a dashboard for all hosts having a specific service, like CPU.
Tried to find some docs for it. Maybe I can figure it out, with some time.
Regards, Bjorn
You can do this with grafana alone. Create dashboard variables and iterate over them, see https://grafana.com/docs/grafana/latest/variables/variable-examples/ Purpose of histou is to provide standard volatile dashboards.
We have done something like what you want (if I understand you correctly).
First we "select" all Hosts/Services that we want to have on the Graph using the RESTapi of Thruk into an array (host_services).
GET https://<nagioshost>/thruk/r/hosts?columns=name,services&name[regex]=^abcdef
host_services is an array of host_service objects with the properties host and service
Then we iterate over results and create a "histou-target" for each entry.
$dashboard = \histou\grafana\dashboard\DashboardFactory::generateDashboard($titel);
$row = new \histou\grafana\Row($titel);
$panel = \histou\grafana\graphpanel\GraphPanelFactory::generatePanel($titel);
foreach ($host_services as $host_service) {
$target = $panel->genTargetSimple($host_service->host, $host_service->service, 'service', $key, Colors::color($i++), $host_service->host);
$panel->addTarget($target);
$panel->fillBelowLine($host_service->host, 5);
$panel->stack($host_service->host);
}
This is the called using a specially "crafted" url.
Regards, Dan
Thanks guys. Now I know it's possible and can spend/waste some time on it!
First of all, thanks for the great effort doing this work!
Not an issue with Histou but a question:
I don't get how I can graph e.g. 100 CPU load graphs. Meaning the same service in Naemon in one Grafana dashboard. What would be the histou URL for that? Do I need to create a specific histou template for it? How is that addressed exactly?
Regards, Bjorn