How to divide hosts by groups in Icinga2 properly?

6,858

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

Share:
6,858

Related videos on Youtube

Denis
Author by

Denis

Updated on September 18, 2022

Comments

  • Denis
    Denis almost 2 years

    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.