Monitoring Icinga 2 features

I’d…

  • get_objects and use the array’s length instead of requiring a particular object name (see also IDO master - set prefered host)
  • look at the feature names from icinga2 feature list, require them as $component_type$ and map them via a variable inside the CheckCommand (dummy_text and dummy_state would have to be () use (...) => { ... }) to the DSL types
  • $component_type$ => $feature_name$ (as command name is “feature”)
  • don’t compute stuff als long as you don’t know you need it, at best return ... ? ... : ...
  • put repeating stuff into a function inside the CheckCommand (dummy_text and dummy_state would have to be () use (...) => { ... })
  • avoid the variable mycomponent
  • have a more precise look at whitespaces, indents and empty lines (latter for readability)
  • actually open a PR and continue the discussion there
  • consider my like and not the amount of these bullets as your grade :wink:
2 Likes