surveil-init: now use python-surveilclient
Change-Id: I5c696cd2e0ef304f595358bb07a7efb446bacb26
This commit is contained in:
parent
2705b93b8d
commit
e5686e905b
@ -29,10 +29,6 @@ def main():
|
|||||||
# Drop the current shinken config
|
# Drop the current shinken config
|
||||||
mongo.drop_database('shinken')
|
mongo.drop_database('shinken')
|
||||||
|
|
||||||
mongo_shinken = mongo.shinken
|
|
||||||
mongo_hosts = mongo_shinken.hosts
|
|
||||||
mongo_services = mongo_shinken.services
|
|
||||||
|
|
||||||
# Load the shinken packs
|
# Load the shinken packs
|
||||||
subprocess.call(
|
subprocess.call(
|
||||||
[
|
[
|
||||||
@ -61,25 +57,35 @@ def main():
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
mongo_hosts.insert(
|
# Reload the surveil config
|
||||||
{"use": "generic-host", "contact_groups": "admins",
|
cli_surveil = sc.Client('http://localhost:8080/v2', version='2_0')
|
||||||
"host_name": "ws-arbiter", "address": "localhost"}
|
|
||||||
|
cli_surveil.config.hosts.create(
|
||||||
|
use="generic-host",
|
||||||
|
contact_groups="admins",
|
||||||
|
host_name="ws-arbiter",
|
||||||
|
address="localhost"
|
||||||
)
|
)
|
||||||
|
|
||||||
mongo_services.insert(
|
cli_surveil.config.services.create(
|
||||||
{"check_command": "check_tcp!7760", "check_interval": "5",
|
check_command="check_tcp!7760",
|
||||||
"check_period": "24x7", "contact_groups": "admins",
|
check_interval="5",
|
||||||
"contacts": "admin", "host_name": "ws-arbiter",
|
check_period="24x7",
|
||||||
"max_check_attempts": "5", "notification_interval": "30",
|
contact_groups="admins",
|
||||||
"notification_period": "24x7", "retry_interval": "3",
|
contacts="admin",
|
||||||
"service_description": "check-ws-arbiter"}
|
host_name="ws-arbiter",
|
||||||
|
max_check_attempts="5",
|
||||||
|
notification_interval="30",
|
||||||
|
notification_period="24x7",
|
||||||
|
retry_interval="3",
|
||||||
|
service_description="check-ws-arbiter"
|
||||||
)
|
)
|
||||||
|
|
||||||
mongo_hosts.insert(
|
cli_surveil.config.hosts.create(
|
||||||
{
|
host_name='test_keystone',
|
||||||
'host_name': 'test_keystone',
|
use='linux-keystone',
|
||||||
'use': 'linux-keystone',
|
address='127.0.0.1',
|
||||||
'address': '127.0.0.1',
|
custom_fields={
|
||||||
"_OS_AUTH_URL": "bla",
|
"_OS_AUTH_URL": "bla",
|
||||||
"_OS_USERNAME": "bli",
|
"_OS_USERNAME": "bli",
|
||||||
"_OS_PASSWORD": "blo",
|
"_OS_PASSWORD": "blo",
|
||||||
@ -89,6 +95,4 @@ def main():
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Reload the surveil config
|
cli_surveil.config.reload_config()
|
||||||
cli_surveil = sc.Client('http://localhost:8080/v1', version='1_0')
|
|
||||||
cli_surveil.reload_config()
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user