Need help understanding how automation and API(s) can be used

This forum was archived to /woltlab and is now in read-only mode.
  • Hello, I'm interested in replacing our Nagios architecture with Icinga. I have some questions regarding automation and the API(s).


    • When using the API to add/remove objects, is a "reload" required for the changes to be applied?
      • Or is a reload done automatically and changes applied?
    • As I understand it, there are 2 APIs?
      • A "standard" one that listens on 5665 (by default) and one provided by the Director module that listens on 80/443?
    • If an API is used, all configs need to be managed via API?
      • For something trivial as changing a threshold, the API needs to be used to do this?
      • Apply rules need to be managed by API?
    • It's problematic to mix API(s) and manual configs?


    Any help would be greatly appreciated.

  • hey,


    it depends on what you want to achieve.

    The API is great for adapting things when needed. the default configuration should either be done manually or via the Director.

    Depending on your environment you can automate most of the things, e.g. create a new container -> api call to add to monitoring

    Personally I would create the default templates via Director and then call the API to use those templates.

    Linux is dead, long live Linux


    Remember to NEVER EVER use git repositories in a productive environment if you CAN NOT control them

  • 1) Object creation is live at runtime, no reload required

    2) Icinga 2 provides a programmatic API, the Icinga Director is an optional tool installed as Icinga Web 2 module and exposes its own config management API

    3) apply rules can be managed via config package as static configuration DSL. changing a threshold could be done as POST modify request

    4) Mixing things is not recommended as it may produce duplicated objects or any other unwanted behaviour.

  • Thanks Kevin.Honka and dnsmichi .


    Quote

    1) Object creation is live at runtime, no reload required

    Would this be for deletes and other changes? I think so but would like to confirm.


    Quote

    3) apply rules can be managed via config package as static configuration DSL. changing a threshold could be done as POST modify request


    "config package as static configuration DSL" can you elaborate more on this? Also which API are you saying to use?



    If possible can you provide recommended workflows focused on automation and API?


    -thanks again

  • I can only speak for Icinga 2's API, I have never used the Director API. Config packages, creates, modifies, deletes are documented very well. Config packages are basically a bundle of configuration files where you can just write configuration into it, as you would put into zones.d or conf.d.


    Before continuing theoretically I'd suggest to fire up a Vagrant box and play with it.