Ejemplo n.º 1
0
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()
Ejemplo n.º 2
0
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()
Ejemplo n.º 3
0
def upgrade_charm():
    apt_install(filter_installed_packages(determine_packages()),
                fatal=True)
    packages_removed = remove_old_packages()
    for rel_id in relation_ids('amqp'):
        amqp_joined(relation_id=rel_id)
    update_nrpe_config()
    scrub_old_style_ceph()
    if packages_removed:
        juju_log("Package purge detected, restarting services")
        for s in services():
            service_restart(s)
Ejemplo n.º 4
0
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)
    if service_enabled('api'):
        nrpe.add_haproxy_checks(nrpe_setup, current_unit)
    else:
        nrpe.remove_deprecated_check(nrpe_setup,
                                     ["haproxy_servers", "haproxy_queue"])
    nrpe_setup.write()
Ejemplo n.º 5
0
def upgrade_charm():
    apt_install(filter_installed_packages(determine_packages()), fatal=True)
    packages_removed = remove_old_packages()
    for rel_id in relation_ids('amqp'):
        amqp_joined(relation_id=rel_id)
    update_nrpe_config()
    scrub_old_style_ceph()
    if packages_removed:
        juju_log("Package purge detected, restarting services")
        for s in services():
            service_restart(s)
    # call the policy overrides handler which will install any policy overrides
    maybe_do_policyd_overrides(
        os_release('cinder-common'),
        'cinder',
        restart_handler=lambda: service_restart('cinder-api'))
Ejemplo n.º 6
0
 def test_services(self, restart_map):
     restart_map.return_value = OrderedDict([
         ('test_conf1', ['svc1']),
         ('test_conf2', ['svc2', 'svc3', 'svc1']),
     ])
     self.assertEquals(cinder_utils.services(), ['svc2', 'svc3', 'svc1'])
Ejemplo n.º 7
0
 def test_services(self, restart_map):
     restart_map.return_value = OrderedDict([
         ('test_conf1', ['svc1']),
         ('test_conf2', ['svc2', 'svc3', 'svc1']),
     ])
     self.assertEqual(cinder_utils.services(), ['svc1', 'svc2', 'svc3'])