| 1 |
# Copyright(c) 2016 Nippon Telegraph and Telephone Corporation |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
# See the License for the specific language governing permissions and |
| 13 |
# limitations under the License. |
| 14 |
from oslo_config import cfg |
| 15 |
|
| 16 |
|
| 17 |
monitor_process_opts = [ |
| 18 |
cfg.IntOpt('check_interval', |
| 19 |
default=5, |
| 20 |
help='Interval in seconds for checking a process.'), |
| 21 |
cfg.IntOpt('restart_retries', |
| 22 |
default=3, |
| 23 |
help='Number of retries when the failure of restarting a' |
| 24 |
' process.'), |
| 25 |
cfg.IntOpt('restart_interval', |
| 26 |
default=5, |
| 27 |
help='Interval in seconds for restarting a process.'), |
| 28 |
cfg.IntOpt('api_retry_max', |
| 29 |
default=12, |
| 30 |
help='Number of retries for send a notification in' |
| 31 |
' processmonitor.'), |
| 32 |
cfg.IntOpt('api_retry_interval', |
| 33 |
default=10, |
| 34 |
help='Interval between re-sending a notification in' |
| 35 |
' processmonitor(in seconds).'), |
| 36 |
cfg.StrOpt('process_list_path', |
| 37 |
default='/etc/masakarimonitors/process_list.yaml', |
| 38 |
help='The file path of process list.'), |
| 39 |
] |
| 40 |
|
| 41 |
|
| 42 |
def register_opts(conf): |
| 43 |
conf.register_opts(monitor_process_opts, group='process') |
| 44 |
|
| 45 |
|
| 46 |
def list_opts(): |
| 47 |
return { |
| 48 |
'process': monitor_process_opts |
| 49 |
} |