diff --git a/Dockerfile b/Dockerfile index 9f6978c..7e12e44 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,5 +54,5 @@ EXPOSE 5311 CMD cd /opt/surveil && \ ./setup.sh && \ - ((sleep 40 && surveil-init --influxdb --packs --mongodb) &) && \ + ((sleep 50 && surveil-init --influxdb --packs --mongodb) &) && \ surveil-api diff --git a/surveil/api/datamodel/config/host.py b/surveil/api/datamodel/config/host.py index 71b2d69..57fee63 100644 --- a/surveil/api/datamodel/config/host.py +++ b/surveil/api/datamodel/config/host.py @@ -53,6 +53,8 @@ class Host(types.Base): retry_interval = wsme.wsattr(int, mandatory=False) + passive_checks_enabled = wsme.wsattr(wtypes.text, mandatory=False) + # TODO(aviau): Custom fields starting without '_' should raise an error. custom_fields = wsme.wsattr( wtypes.DictType(wtypes.text, wtypes.text), diff --git a/surveil/api/storage/mongodb/config/host.py b/surveil/api/storage/mongodb/config/host.py index d9ce2c9..53aa50d 100644 --- a/surveil/api/storage/mongodb/config/host.py +++ b/surveil/api/storage/mongodb/config/host.py @@ -34,3 +34,4 @@ class Host(mongoengine.Document): check_interval = mongoengine.IntField() retry_interval = mongoengine.IntField() custom_fields = mongoengine.DictField() + passive_checks_enabled = mongoengine.StringField() diff --git a/surveil/cmd/init.py b/surveil/cmd/init.py index a15e6b8..14cc34e 100644 --- a/surveil/cmd/init.py +++ b/surveil/cmd/init.py @@ -133,6 +133,14 @@ def main(): service_description="check-ws-arbiter" ) + # Passive checks host + cli_surveil.config.hosts.create( + host_name='passive_check_host', + use=['generic-host'], + address='127.0.0.1', + passive_checks_enabled='1' + ) + # Linux-keystone template cli_surveil.config.hosts.create( host_name='test_keystone',