2

I just migrate from Nagios to Icinga2 and have a question. For example I have bunch of hosts related to group by their functional for example "web". But I want to check temperature for that group with different thresholds. For example for host1 60C is normally but for host2 I want to set threshold not more then 55C.

What is best strategy to organize hosts should I make separate groups like "web_low_temp", "web_high_temp" and etc and bind separate check commands for that groups or maybe is anyone know better solution?

p.s I'm fairly new with Icinga2 please share your experience.

3

I wouldn't depend on hostgroups for that - they can be used to group hosts for external user interfaces and help as a basis, but I would recomment looking into alternate apply rule match conditions such as

  • custom attributes as strings, numbers, boolean, arrays or (nested) dictionaries
  • name pattern match with wildcards/regex
  • match on object attributes, such as ip address subnets

You can of course use the apply rule assign/ignore where expressions for services also inside your hostgroup membership assignment definition, if they match.

Another cool thing you can do with Icinga 2 - use apply for rules and grnerate services based on host custom attributes as array or dictionary. That way you'll pass the entire check information from the host to the service apply rules if you want to.

Look at the docs for a detailed explaination and example: http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#using-apply-for

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.