mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 06:34:42 +02:00
Implement data processing options (DbConnection::categories).
Refs #4782
This commit is contained in:
parent
f39eff323e
commit
8c5bff3f75
@ -407,6 +407,9 @@ void IdoMysqlConnection::ExecuteQuery(const DbQuery& query)
|
|||||||
|
|
||||||
ASSERT(query.Category != DbCatInvalid);
|
ASSERT(query.Category != DbCatInvalid);
|
||||||
|
|
||||||
|
if ((query.Category & GetCategories()) == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!m_Connected)
|
if (!m_Connected)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ void DbConnection::ProgramStatusHandler(void)
|
|||||||
DbQuery query1;
|
DbQuery query1;
|
||||||
query1.Table = "programstatus";
|
query1.Table = "programstatus";
|
||||||
query1.Type = DbQueryDelete;
|
query1.Type = DbQueryDelete;
|
||||||
query1.Type = DbCatProgramStatus;
|
query1.Category = DbCatProgramStatus;
|
||||||
query1.WhereCriteria = boost::make_shared<Dictionary>();
|
query1.WhereCriteria = boost::make_shared<Dictionary>();
|
||||||
query1.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
query1.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||||
DbObject::OnQuery(query1);
|
DbObject::OnQuery(query1);
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include "db_ido/dbquery.h"
|
||||||
#include "base/dynamicobject.h"
|
#include "base/dynamicobject.h"
|
||||||
#include <boost/smart_ptr/make_shared.hpp>
|
#include <boost/smart_ptr/make_shared.hpp>
|
||||||
|
|
||||||
@ -13,6 +14,14 @@ class DbConnection : DynamicObject
|
|||||||
[config] Dictionary::Ptr cleanup {
|
[config] Dictionary::Ptr cleanup {
|
||||||
default {{{ return boost::make_shared<Dictionary>(); }}}
|
default {{{ return boost::make_shared<Dictionary>(); }}}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[config] int categories {
|
||||||
|
default {{{
|
||||||
|
return DbCatConfig | DbCatState | DbCatAcknowledgement |
|
||||||
|
DbCatComment | DbCatDowntime | DbCatEventHandler | DbCatExternalCommand | DbCatFlapping |
|
||||||
|
DbCatLog | DbCatNotification | DbCatProgramStatus | DbCatRetention | DbCatStateHistory;
|
||||||
|
}}}
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user