Open phantium opened 7 years ago
I think you need to add a Service-Template first. Go to Icinga-Director -> Services -> Service Templates and add at least one Service. Maybe ping4 or something that you know you will need. A fresh install does not include any configured services but you need to have at least one before creating a Host-Template. This is (probably) because you can define the same service, or rather check, with different Options like "Check-Interval" and so on. I hope this could help you.
I have recently done that, but had not checked if adding a service would now work. But indeed this resolves the issue, thank you.
Perhaps it would be better to show an explanation if no service template is available yet, rather than "crashing".
I totally agree. This was my first time installing Icinga2 and I don't think this is explained/documented anywhere in the official documentation. I might be wrong though because I tend to just scroll through tutorials. If I am right, it might be worth considering adding this to the documentation or, as you said, a explanation/unique error messsage.
Same problem here, definitely need some sort of message. Interestingly, I don't have a service template or a service sets, yet when i do to add service set i don't get an error.
By the way, adding a service to an actual host (not a template) produces the same error.
I'm unable to reproduce this with a random Director instance. Does this only happen with a fresh new Director installation with no Service Templates defined at all?
Confirmed.
Thanks @Al2Klimov!
Interesting this but is still open, still happens on recent version of Icinga. The least improvement that can be done is to show a readible error, like : 'A service template needs to be defined to add a service here' or something more specific.
Someone that is familiar with this part of the code probably knows if that can be a one on one change or that the error can mean other things. Would be nice to see it fixed, thank you!
Adding service to host template results in display group error
Expected Behavior
Current Behavior
Possible Solution
Steps to Reproduce (for bugs)
Context
Your Environment
icinga2 --version
): 2.7.1-1