summaryrefslogtreecommitdiffstats
path: root/lib/db_ido/dbconnection.ti
blob: ad02b4094503bc0a89944fb727a933f96508cf76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */

#include "db_ido/dbquery.hpp"
#include "base/configobject.hpp"

library db_ido;

namespace icinga
{

abstract class DbConnection : ConfigObject
{
	[config] String table_prefix {
		default {{{ return "icinga_"; }}}
	};

	[config, required] Dictionary::Ptr cleanup {
		default {{{ return new Dictionary(); }}}
	};

	[config] Array::Ptr categories {
		default {{{
			return new Array({
				"DbCatConfig",
				"DbCatState",
				"DbCatAcknowledgement",
				"DbCatComment",
				"DbCatDowntime",
				"DbCatEventHandler",
				"DbCatFlapping",
				"DbCatNotification",
				"DbCatProgramStatus",
				"DbCatRetention",
				"DbCatStateHistory"
			});
		}}}
	};
	[no_user_view, no_user_modify] int categories_filter_real (CategoryFilter);

	[config] bool enable_ha {
		default {{{ return true; }}}
	};

	[config] double failover_timeout {
		default {{{ return 30; }}}
	};

	[state, no_user_modify] double last_failover;

	[no_user_modify] String schema_version;
	[no_user_modify] bool connected;
	[no_user_modify] bool should_connect {
		default {{{ return true; }}}
	};
};


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;
	};

	Array categories {
		String "*";
	};
};

}