|
| 1 | +# |
| 2 | +# There are two ways to get started with the supervisord check. |
| 3 | +# |
| 4 | +# You can configure inet_http_server in /etc/supervisord.conf. Below is an |
| 5 | +# example inet_http_server configuration: |
| 6 | +# |
| 7 | +# [inet_http_server] |
| 8 | +# port:localhost:9001 |
| 9 | +# username:user # optional |
| 10 | +# password:pass # optional |
| 11 | +# |
| 12 | +# OR, you can use supervisorctl socket to communicate with supervisor. |
| 13 | +# If supervisor is running as root, make sure chmod property is set |
| 14 | +# to a permission accessible to non-root users. See the example below: |
| 15 | +# |
| 16 | +# [supervisorctl] |
| 17 | +# serverurl=unix:///var/run//supervisor.sock |
| 18 | +# |
| 19 | +# [unix_http_server] |
| 20 | +# file=/var/run/supervisor.sock |
| 21 | +# chmod=777 |
| 22 | +# |
| 23 | +# Reload supervisor, specify the inet or unix socket server information |
| 24 | +# in this yaml file along with an optional list of the processes you want |
| 25 | +# to monitor per instance, and you're good to go! |
| 26 | +# |
| 27 | +# See http://supervisord.org/configuration.html for more information on |
| 28 | +# configuring supervisord sockets and inet http servers. |
| 29 | +# |
| 30 | + |
| 31 | +# - name: server0 # Required. An arbitrary name to identify the supervisord server |
| 32 | +# host: localhost # Optional. Defaults to localhost. The host where supervisord server is running |
| 33 | +# port: 9001 # Optional. Defaults to 9001. The port number. |
| 34 | +# user: user # Optional. Required only if a username is configured. |
| 35 | +# pass: pass # Optional. Required only if a password is configured. |
| 36 | +# proc_regex: # Optional. Regex pattern[s] matching the names of processes to monitor |
| 37 | +# - 'myprocess-\d\d$' |
| 38 | +# proc_names: # Optional. The process to monitor within this supervisord instance. |
| 39 | +# - apache2 # If not specified, the check will monitor all processes. |
| 40 | +# - webapp |
| 41 | +# - java |
| 42 | +# - name: server1 |
| 43 | +# host: localhost |
| 44 | +# port: 9002 |
| 45 | +# - name: server2 |
| 46 | +# socket: unix:///var/run//supervisor.sock |
| 47 | +# host: http://127.0.0.1 # Optional. Defaults to http://127.0.0.1 |
| 48 | + |
| 49 | + |
| 50 | +init_config: |
| 51 | + |
| 52 | +instances: |
| 53 | +<%- (Array(@instances)).each do |instance| -%> |
| 54 | + - name: <%= instance['servername'] %> |
| 55 | +<% if instance['socket'] -%> |
| 56 | + socket: <%= instance['socket'] %> |
| 57 | +<% end -%> |
| 58 | +<% if instance['hostname'] -%> |
| 59 | + host: <%= instance['hostname'] %> |
| 60 | +<% end -%> |
| 61 | +<% if instance['port'] -%> |
| 62 | + port: <%= instance['port'] %> |
| 63 | +<% end -%> |
| 64 | +<% if instance['username'] -%> |
| 65 | + user: <%= instance['username'] %> |
| 66 | +<% end -%> |
| 67 | +<% if instance['password'] -%> |
| 68 | + pass: <%= instance['password'] %> |
| 69 | +<% end -%> |
| 70 | +<% if instance['proc_names'] and ! instance['proc_names'].empty? -%> |
| 71 | + proc_names: |
| 72 | + <%- Array(instance['proc_names']).each do |proc_name| -%> |
| 73 | + <%- if proc_name != '' -%> |
| 74 | + - <%= proc_name %> |
| 75 | + <%- end -%> |
| 76 | + <%- end -%> |
| 77 | +<% end -%> |
| 78 | +<% if instance['server_check'] -%> |
| 79 | + server_check: <%= instance['server_check'] %> |
| 80 | +<% end -%> |
| 81 | +<% end -%> |
0 commit comments