I was wondering if there is a Wildcard possible for services like in the apply rules.
Lets say you have a bunch of services on (Windows) hosts that all start with “Service”. Service1, Service2 etc. Now, a buch of Windows servers with a bunch of Services, different numbers of them.
Is it possible to check for Windows services like “All that start with Service” and alert if one of them is in a “not running” state?
No, the check itself. I want to have multiple services checked on hosts that all share a similar name, but can be a different number on different hosts. Like, Host A has 2 Services like that, Host B has 4 etc.
Host A
Service A
Service B
Host B
Service A
Service B
Service C
Now, how to define the check without refering to all of the services one by one?
Ah, I think I now understand what you’re trying to do, I missed that you mean actual Windows system services, not just Icinga services. So you basically want to automatically create Icinga service objects for Windows system services.
Icinga itself can’t read the list of Windows services and then use it to dynamically create services. You’d have to feed it this information yourself, either in the config or using the API (might be Icinga 2 API or Director API).
Another option would be to have a single Icinga 2 service that checks all services that match a pattern. This has to be supported by the check command plugin in use, I don’t know off the top of my head if any do, but I think it’s quite possible that the new PowerShell plugins for Windows do. Maybe someone else can jump in here with more information.