Debian Codegraph @

masakarimonitors/conf/host.py

raw
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 from oslo_config import types
16
17 monitor_host_opts = [
18 cfg.StrOpt('monitoring_driver',
19 default='default',
20 help='Driver that hostmonitor uses for monitoring hosts.'),
21 cfg.IntOpt('monitoring_interval',
22 default=60,
23 help='Monitoring interval(in seconds) of node status.'),
24 cfg.IntOpt('monitoring_samples',
25 default=1,
26 help='''
27 Monitoring probes to collect before making the decision to send Masakari
28 notification about the node status. If and only if ``monitoring_samples``
29 consecutive reports have the same status, will the Masakari notification
30 be sent.
31 '''),
32 cfg.IntOpt('api_retry_max',
33 default=12,
34 help='Number of retries for send a notification in'
35 ' hostmonitor.'),
36 cfg.IntOpt('api_retry_interval',
37 default=10,
38 help='Trial interval of time of the notification processing'
39 ' is error(in seconds).'),
40 cfg.BoolOpt('disable_ipmi_check',
41 default=False,
42 help='''
43 Do not check whether the host is completely down.
44
45 Possible values:
46
47 * True: Do not check whether the host is completely down.
48 * False: Do check whether the host is completely down.
49
50 If ipmi RA is not set in pacemaker, this value should be set True.
51 '''),
52 cfg.BoolOpt('restrict_to_remotes',
53 default=False,
54 help='Only monitor pacemaker-remotes, ignore the status of'
55 ' full cluster members.'),
56 cfg.IntOpt('ipmi_timeout',
57 default=5,
58 help='Timeout value(in seconds) of the ipmitool command.'),
59 cfg.IntOpt('ipmi_retry_max',
60 default=3,
61 help='Number of ipmitool command retries.'),
62 cfg.IntOpt('ipmi_retry_interval',
63 default=10,
64 help='Retry interval(in seconds) of the ipmitool command.'),
65 cfg.IntOpt('stonith_wait',
66 default=30,
67 help='Standby time(in seconds) until activate STONITH.'),
68 cfg.IntOpt('tcpdump_timeout',
69 default=5,
70 help='Timeout value(in seconds) of the tcpdump command when'
71 ' monitors the corosync communication.'),
72 cfg.ListOpt('corosync_multicast_interfaces',
73 help='''
74 The name of interface that corosync is using for mutual communication
75 between hosts.
76 If there are multiple interfaces, specify them in comma-separated
77 like 'enp0s3,enp0s8'.
78 The number of interfaces you specify must be equal to the number of
79 corosync_multicast_ports values and must be in correct order with relevant
80 ports in corosync_multicast_ports.
81 '''),
82 cfg.ListOpt('corosync_multicast_ports',
83 item_type=types.Port(),
84 help='''
85 The port numbers that corosync is using for mutual communication
86 between hosts.
87 If there are multiple port numbers, specify them in comma-separated
88 like '5405,5406'.
89 The number of port numbers you specify must be equal to the number of
90 corosync_multicast_interfaces values and must be in correct order with
91 relevant interfaces in corosync_multicast_interfaces.
92 '''),
93 cfg.StrOpt('pacemaker_node_type',
94 default='autodetect',
95 choices=('autodetect', 'cluster', 'remote'),
96 help='''
97 Using this option, one can avoid systemd checks that would establish whether
98 this hostmonitor is running alongside Corosync and Pacemaker (the ``cluster``
99 stack) or Pacemaker Remote (the ``remote`` stack).
100
101 The default (``autodetect``) ensures backward compatibility and means systemd
102 is used to check the stack.
103 '''),
104 ]
105
106
107 def register_opts(conf):
108 conf.register_opts(monitor_host_opts, group='host')
109
110
111 def list_opts():
112 return {
113 'host': monitor_host_opts
114 }