mirror of https://github.com/Icinga/icinga2.git
parent
240e047693
commit
1ada53dd57
|
@ -25,6 +25,9 @@
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
|
||||||
|
//TODO Make configurable and figure out a sane default
|
||||||
|
#define MAX_EVENTS 5000
|
||||||
|
|
||||||
REGISTER_TYPE(RedisWriter);
|
REGISTER_TYPE(RedisWriter);
|
||||||
|
|
||||||
RedisWriter::RedisWriter(void)
|
RedisWriter::RedisWriter(void)
|
||||||
|
@ -284,7 +287,10 @@ void RedisWriter::HandleEvent(const Dictionary::Ptr& event)
|
||||||
|
|
||||||
String body = JsonEncode(event);
|
String body = JsonEncode(event);
|
||||||
|
|
||||||
|
ExecuteQuery({ "MULTI" });
|
||||||
ExecuteQuery({ "LPUSH", "icinga:event:" + name, body });
|
ExecuteQuery({ "LPUSH", "icinga:event:" + name, body });
|
||||||
|
ExecuteQuery({ "LTRIM", "icinga:event:" + name, 0, MAX_EVENTS - 1 });
|
||||||
|
ExecuteQuery({ "EXEC" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue