當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。