本文整理汇总了Python中charmhelpers.contrib.charmsupport.nrpe.add_haproxy_checks方法的典型用法代码示例。如果您正苦于以下问题:Python nrpe.add_haproxy_checks方法的具体用法?Python nrpe.add_haproxy_checks怎么用?Python nrpe.add_haproxy_checks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类charmhelpers.contrib.charmsupport.nrpe
的用法示例。
在下文中一共展示了nrpe.add_haproxy_checks方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_nrpe_config
# 需要导入模块: from charmhelpers.contrib.charmsupport import nrpe [as 别名]
# 或者: from charmhelpers.contrib.charmsupport.nrpe import add_haproxy_checks [as 别名]
def update_nrpe_config():
# python-dbus is used by check_upstart_job
apt_install('python-dbus')
hostname = nrpe.get_nagios_hostname()
current_unit = nrpe.get_nagios_unit_name()
nrpe_setup = nrpe.NRPE(hostname=hostname)
nrpe.copy_nrpe_checks()
nrpe.add_init_service_checks(nrpe_setup, services(), current_unit)
nrpe.add_haproxy_checks(nrpe_setup, current_unit)
api_port = determine_api_port(config('bind-port'),
singlenode_mode=True)
nrpe_setup.add_check(
shortname="swift-proxy-healthcheck",
description="Check Swift Proxy Healthcheck",
check_cmd="/usr/lib/nagios/plugins/check_http \
-I localhost -u /healthcheck -p {} \
-e \"OK\"".format(api_port)
)
nrpe_setup.write()
示例2: update_nrpe_config
# 需要导入模块: from charmhelpers.contrib.charmsupport import nrpe [as 别名]
# 或者: from charmhelpers.contrib.charmsupport.nrpe import add_haproxy_checks [as 别名]
def update_nrpe_config():
# python-dbus is used by check_upstart_job
apt_install('python-dbus')
hostname = nrpe.get_nagios_hostname()
current_unit = nrpe.get_nagios_unit_name()
nrpe_setup = nrpe.NRPE(hostname=hostname)
nrpe.copy_nrpe_checks()
nrpe.add_init_service_checks(nrpe_setup, services(), current_unit)
nrpe.add_haproxy_checks(nrpe_setup, current_unit)
conf = nrpe_setup.config
check_http_params = conf.get('nagios_check_http_params')
if check_http_params:
nrpe_setup.add_check(
shortname='vhost',
description='Check Virtual Host {%s}' % current_unit,
check_cmd='check_http %s' % check_http_params
)
nrpe_setup.write()
示例3: update_nrpe_config
# 需要导入模块: from charmhelpers.contrib.charmsupport import nrpe [as 别名]
# 或者: from charmhelpers.contrib.charmsupport.nrpe import add_haproxy_checks [as 别名]
def update_nrpe_config():
# python-dbus is used by check_upstart_job
apt_install('python-dbus')
hostname = nrpe.get_nagios_hostname()
current_unit = nrpe.get_nagios_unit_name()
nrpe_setup = nrpe.NRPE(hostname=hostname)
nrpe.copy_nrpe_checks()
_services = []
for service in services():
if service.startswith('snap.'):
service = service.split('.')[1]
_services.append(service)
nrpe.add_init_service_checks(nrpe_setup, _services, current_unit)
nrpe.add_haproxy_checks(nrpe_setup, current_unit)
nrpe_setup.write()
示例4: update_nrpe_config
# 需要导入模块: from charmhelpers.contrib.charmsupport import nrpe [as 别名]
# 或者: from charmhelpers.contrib.charmsupport.nrpe import add_haproxy_checks [as 别名]
def update_nrpe_config():
# python-dbus is used by check_upstart_job
apt_install('python-dbus')
hostname = nrpe.get_nagios_hostname()
current_unit = nrpe.get_nagios_unit_name()
nrpe_setup = nrpe.NRPE(hostname=hostname)
nrpe.copy_nrpe_checks()
nrpe.add_init_service_checks(nrpe_setup, services(), current_unit)
nrpe.add_haproxy_checks(nrpe_setup, current_unit)
nrpe_setup.write()
示例5: update_nrpe_config
# 需要导入模块: from charmhelpers.contrib.charmsupport import nrpe [as 别名]
# 或者: from charmhelpers.contrib.charmsupport.nrpe import add_haproxy_checks [as 别名]
def update_nrpe_config():
# python-dbus is used by check_upstart_job
apt_install('python-dbus')
hostname = nrpe.get_nagios_hostname()
current_unit = nrpe.get_nagios_unit_name()
nrpe_setup = nrpe.NRPE(hostname=hostname)
nrpe.copy_nrpe_checks()
nrpe.add_init_service_checks(nrpe_setup, services(), current_unit)
nrpe.add_haproxy_checks(nrpe_setup, current_unit)
nrpe_setup.write()