ConSol-Monitoring / snclient

SNClient+ - Cross platform monitoring agent
MIT License
48 stars 8 forks source link

Periodic config reload when remote source is included #149

Open deloid opened 3 weeks ago

deloid commented 3 weeks ago

EDIT: I have completely misinterpreted config & include inheritance and also the purpose of the INCLUDES MSI property (I interpreted any configuration specified in includes that was already specified in the parent, would be overwritten (ie. NRPEServer = enabled, tls min version = tls1.3, etc). I've since properly tested and it worked. I've struck out my original requests and left them here though and edited the original issue name to reflect my actual request.

Further to using a remote config included during installation, is there a periodic background config reload if the config has changed (hash compare)? https://nsclient.org/docs/settings/#http-settings.
I'm coming up blank in trying to find the settings reference, but I believe the periodic reload is handled by this:

[/settings/core]
settings maintenance interval=5m

I could be way off with that though. This is all I can find referring to the refresh and that above setting https://github.com/mickem/nscp/issues/378

Are there any plans to implement settings store configuration like NSClient's boot.ini to specify the config source during service start or the ability to change config sources via snclient.exe?

An installer option to specify a configuration source (ie. remote https) during installation would also be good. On Windows, it's the CONFIGURATION_TYPE property in the NSClient MSI - https://nsclient.org/docs/installing/#msi-options.

sni commented 2 weeks ago

right now there is no automatic reload of (remote) config includes. But there is a rest api endpoint to trigger a config reload. Would that help?

deloid commented 2 weeks ago

Yes, that does look like it will help in the meantime paired with a scheduled task or something. Thank you for the reply :)

Is a regular hash-check/similar and reload something that could be looked for a future release? It would very useful for on going configuration maintenance. In our case, we add external check script definitions to a remote config fairly regularly.

sni commented 2 weeks ago

right now it's not on the roadmap. But if someone wants to look into this...