I have a provisioning system setting up new hosts to be in the domain test.domain.local, i.e. client44.test.domain.local
, and I have an Icinga server which I would like to automatically monitor all these hosts using regex, like *.test.domain.local
.
All the clients will get nagios-nrpe-server
(version. 2.13-3) package, which is also configured to allow the icinga-server to fetch data from them, and this has been verified to be working.
We're just for now going to monitor services/things we know all the nodes will have, for example SSH, response to ping etc.
I have looked at this link but I don't quite the relationship between hosts, hostgroups and service classes?
Both the Icinga server and all the clients run Debian.
Best Answer
I've been working with fredmu on this problem, and came up with a working solution inspired by Tim Brigham's answer.
Using the default
generic-host
definition this could be solved using script that automatically generates host configuration files based off a template. Optionally it could be done as a cronjob to generate these file on a routinely basis.generate_host_cfg.sh
template_icinga.cfg
Resulting in files like these: