mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-20 17:29:13 +00:00
Implemented custom host script (WIP)
This commit is contained in:
parent
66a4e73f1e
commit
71fbbdbf58
21 changed files with 361 additions and 111 deletions
|
|
@ -53,8 +53,9 @@ LuaEngine* CustomFlowLuaScript::initVM() {
|
|||
try {
|
||||
lua = new LuaEngine(NULL);
|
||||
lua->load_script((char*)where, NULL /* NetworkInterface filled later via lua->setFlow(f); */);
|
||||
ntop->getTrace()->traceEvent(TRACE_NORMAL, "Loaded custom user script %s", where);
|
||||
} catch(std::bad_alloc& ba) {
|
||||
ntop->getTrace()->traceEvent(TRACE_ERROR, "[HTTP] Unable to start Lua interpreter.");
|
||||
ntop->getTrace()->traceEvent(TRACE_ERROR, "Unable to start Lua interpreter.");
|
||||
}
|
||||
|
||||
return(lua);
|
||||
|
|
@ -110,7 +111,7 @@ FlowAlert *CustomFlowLuaScript::buildAlert(Flow *f) {
|
|||
CustomFlowLuaScriptAlert *alert = new CustomFlowLuaScriptAlert(this, f);
|
||||
|
||||
alert->setAlertMessage(f->getCustomFlowAlertMessage());
|
||||
alert->setAlertValue(f->getCustomFlowAlertValue());
|
||||
alert->setAlertScore(f->getCustomFlowAlertScore());
|
||||
|
||||
return alert;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue