当前位置: 首页>>代码示例>>Python>>正文


Python nrpe.copy_nrpe_checks方法代码示例

本文整理汇总了Python中charmhelpers.contrib.charmsupport.nrpe.copy_nrpe_checks方法的典型用法代码示例。如果您正苦于以下问题:Python nrpe.copy_nrpe_checks方法的具体用法?Python nrpe.copy_nrpe_checks怎么用?Python nrpe.copy_nrpe_checks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在charmhelpers.contrib.charmsupport.nrpe的用法示例。


在下文中一共展示了nrpe.copy_nrpe_checks方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: update_nrpe_config

# 需要导入模块: from charmhelpers.contrib.charmsupport import nrpe [as 别名]
# 或者: from charmhelpers.contrib.charmsupport.nrpe import copy_nrpe_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() 
开发者ID:openstack,项目名称:charm-swift-proxy,代码行数:21,代码来源:swift_hooks.py

示例2: update_nrpe_config

# 需要导入模块: from charmhelpers.contrib.charmsupport import nrpe [as 别名]
# 或者: from charmhelpers.contrib.charmsupport.nrpe import copy_nrpe_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() 
开发者ID:openstack,项目名称:charm-openstack-dashboard,代码行数:20,代码来源:horizon_hooks.py

示例3: update_nrpe_config

# 需要导入模块: from charmhelpers.contrib.charmsupport import nrpe [as 别名]
# 或者: from charmhelpers.contrib.charmsupport.nrpe import copy_nrpe_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() 
开发者ID:openstack,项目名称:charm-keystone,代码行数:17,代码来源:keystone_hooks.py

示例4: update_nrpe_config

# 需要导入模块: from charmhelpers.contrib.charmsupport import nrpe [as 别名]
# 或者: from charmhelpers.contrib.charmsupport.nrpe import copy_nrpe_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() 
开发者ID:openstack,项目名称:charm-nova-cloud-controller,代码行数:12,代码来源:nova_cc_hooks.py

示例5: update_nrpe_config

# 需要导入模块: from charmhelpers.contrib.charmsupport import nrpe [as 别名]
# 或者: from charmhelpers.contrib.charmsupport.nrpe import copy_nrpe_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() 
开发者ID:openstack,项目名称:charm-neutron-api,代码行数:13,代码来源:neutron_api_hooks.py


注:本文中的charmhelpers.contrib.charmsupport.nrpe.copy_nrpe_checks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。