Autoconfiguration of m/monit with set httpd use address

Issue #695 closed
S created an issue

It appears impossible to maintain the functionality of the local monit cli (which expects to connect over localhost) in tandem with autoconfiguration of m/monit (which uses the stanza in "use address" to communication back to the instance).

For example, this configuration will properly autoconfigure m/monit, but breaks the CLI:

set httpd
  port 2812
  use address my-public-address.domain.com
  allow mmonit-host.domain.com
  allow user:pass

This configuration allows the CLI to work, but then m/monit cannot communicate without a manual override (as m/monit believes its public address is 0.0.0.0 when it is clearly not):

set httpd
  port 2812
  use address 0.0.0.0
  allow mmonit-host.domain.com
  allow user:pass

Any suggestions?

Comments (2)

  1. Tildeslash repo owner

    Just comment-out the "use address" option completely - it's not necessary, monit will listen on any interface without this option (will work for both CLI and M/Monit).

    The "use address" option is used only when you want Monit to listen on specific interface only.

  2. S reporter

    Thanks. So it appears that if you specify it at all, that gets sent to m/monit - possibly a bug, no, since it can send "0.0.0.0" which is guaranteed to be useless to m/monit? It might be useful to specify it this way if you are overriding a previous config file (imagine cascading config through a config management or provisioning system).

    And thanks - refactoring our code to remove all uses of use address when we want this control fixed the issue.

  3. Log in to comment