2019-02-25 14:48:22 +01:00
|
|
|
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
2014-10-17 19:44:31 +02:00
|
|
|
|
2014-05-25 16:23:35 +02:00
|
|
|
#include "db_ido/dbquery.hpp"
|
2015-08-15 20:28:05 +02:00
|
|
|
#include "base/configobject.hpp"
|
2013-10-26 09:41:45 +02:00
|
|
|
|
2015-08-04 14:47:44 +02:00
|
|
|
library db_ido;
|
|
|
|
|
2013-10-26 09:41:45 +02:00
|
|
|
namespace icinga
|
|
|
|
{
|
|
|
|
|
2015-08-15 20:28:05 +02:00
|
|
|
abstract class DbConnection : ConfigObject
|
2013-10-26 09:41:45 +02:00
|
|
|
{
|
|
|
|
[config] String table_prefix {
|
|
|
|
default {{{ return "icinga_"; }}}
|
|
|
|
};
|
|
|
|
|
2017-05-30 14:47:28 +02:00
|
|
|
[config, required] Dictionary::Ptr cleanup {
|
2014-11-08 21:17:16 +01:00
|
|
|
default {{{ return new Dictionary(); }}}
|
2013-10-26 09:41:45 +02:00
|
|
|
};
|
2013-10-29 16:08:52 +01:00
|
|
|
|
2017-05-10 14:31:34 +02:00
|
|
|
[config] Array::Ptr categories {
|
2013-10-29 16:08:52 +01:00
|
|
|
default {{{
|
2018-01-11 11:17:38 +01:00
|
|
|
return new Array({
|
|
|
|
"DbCatConfig",
|
|
|
|
"DbCatState",
|
|
|
|
"DbCatAcknowledgement",
|
|
|
|
"DbCatComment",
|
|
|
|
"DbCatDowntime",
|
|
|
|
"DbCatEventHandler",
|
|
|
|
"DbCatFlapping",
|
|
|
|
"DbCatNotification",
|
|
|
|
"DbCatProgramStatus",
|
|
|
|
"DbCatRetention",
|
|
|
|
"DbCatStateHistory"
|
|
|
|
});
|
2013-10-29 16:08:52 +01:00
|
|
|
}}}
|
|
|
|
};
|
2016-07-19 20:09:14 +02:00
|
|
|
[no_user_view, no_user_modify] int categories_filter_real (CategoryFilter);
|
2014-08-13 17:46:43 +02:00
|
|
|
|
|
|
|
[config] bool enable_ha {
|
|
|
|
default {{{ return true; }}}
|
|
|
|
};
|
2014-08-15 17:13:32 +02:00
|
|
|
|
|
|
|
[config] double failover_timeout {
|
2019-03-29 15:53:56 +01:00
|
|
|
default {{{ return 30; }}}
|
2014-08-15 17:13:32 +02:00
|
|
|
};
|
2015-03-12 09:39:53 +01:00
|
|
|
|
2019-03-29 15:53:56 +01:00
|
|
|
[state, no_user_modify] double last_failover;
|
|
|
|
|
2015-10-20 08:20:35 +02:00
|
|
|
[no_user_modify] String schema_version;
|
|
|
|
[no_user_modify] bool connected;
|
|
|
|
[no_user_modify] bool should_connect {
|
2015-03-12 09:39:53 +01:00
|
|
|
default {{{ return true; }}}
|
|
|
|
};
|
2013-10-26 09:41:45 +02:00
|
|
|
};
|
|
|
|
|
2014-11-30 23:32:13 +01:00
|
|
|
|
|
|
|
validator DbConnection {
|
|
|
|
Dictionary cleanup {
|
|
|
|
Number acknowledgements_age;
|
|
|
|
Number commenthistory_age;
|
|
|
|
Number contactnotifications_age;
|
|
|
|
Number contactnotificationmethods_age;
|
|
|
|
Number downtimehistory_age;
|
|
|
|
Number eventhandlers_age;
|
|
|
|
Number externalcommands_age;
|
|
|
|
Number flappinghistory_age;
|
|
|
|
Number hostchecks_age;
|
|
|
|
Number logentries_age;
|
|
|
|
Number notifications_age;
|
|
|
|
Number processevents_age;
|
|
|
|
Number statehistory_age;
|
|
|
|
Number servicechecks_age;
|
|
|
|
Number systemcommands_age;
|
|
|
|
};
|
2016-06-22 16:11:15 +02:00
|
|
|
|
|
|
|
Array categories {
|
|
|
|
String "*";
|
|
|
|
};
|
2014-11-30 23:32:13 +01:00
|
|
|
};
|
|
|
|
|
2013-10-29 16:08:52 +01:00
|
|
|
}
|