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