Skip to content

Commit

Permalink
Added nIndex version
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaderi committed Dec 19, 2018
1 parent cc6f791 commit 15efe2f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/NetworkInterface.h
Expand Up @@ -329,7 +329,7 @@ class NetworkInterface : public Checkpointable {
int dumpEsFlow(time_t when, Flow *f);
int dumpLsFlow(time_t when, Flow *f);
#if defined(HAVE_NINDEX) && defined(NTOPNG_PRO)
inline bool dumpnIndexFlow(time_t when, Flow *f) { return(db->dumpFlow(when, f, NULL)); };
inline bool dumpnIndexFlow(time_t when, Flow *f) { return(db ? db->dumpFlow(when, f, NULL) : false); };
#endif
int dumpLocalHosts2redis(bool disable_purge);
inline void incRetransmittedPkts(u_int32_t num) { tcpPacketStats.incRetr(num); };
Expand Down Expand Up @@ -579,7 +579,7 @@ class NetworkInterface : public Checkpointable {
#endif

void getFlowsStatus(lua_State *vm);
void startDBLoop() { if(db) db->startDBLoop(); };
void startDBLoop() { if(db) db->startDBLoop(); };
inline bool createDBSchema() { if(db) { return db->createDBSchema(); } return false; };
inline bool createNprobeDBView() { if(db) { return db->createNprobeDBView(); } return false; };
#ifdef NTOPNG_PRO
Expand Down
4 changes: 4 additions & 0 deletions scripts/lua/about.lua
Expand Up @@ -128,6 +128,10 @@ print("<tr><th><a href=\"http://twitter.github.io/\" target=\"_blank\"><i class=
print("<tr><th><a href=\"http://fortawesome.github.io/Font-Awesome/\" target=\"_blank\"><i class=\'fa fa-flag fa-lg'></i> Font Awesome</A></th><td>4.x</td></tr>\n")
print("<tr><th><a href=\"http://www.rrdtool.org/\" target=\"_blank\">RRDtool</A></th><td>"..info["version.rrd"].."</td></tr>\n")

if(info["version.nindex"] ~= nil) then
print("<tr><th>nIndex</th><td>"..info["version.nindex"].."</td></tr>\n")
end

local l7_resolution = "5m"

if ts_utils.getDriverName() == "influxdb" then
Expand Down
7 changes: 5 additions & 2 deletions src/LuaEngine.cpp
Expand Up @@ -5906,6 +5906,9 @@ static int ntop_get_info(lua_State* vm) {
lua_push_bool_table_entry(vm, "pro.out_of_maintenance", ntop->getPro()->is_out_of_maintenance());
lua_push_bool_table_entry(vm, "pro.use_redis_license", ntop->getPro()->use_redis_license());
lua_push_str_table_entry(vm, "pro.systemid", ntop->getPro()->get_system_id());
#if defined(HAVE_NINDEX)
lua_push_str_table_entry(vm, "version.nindex", nindex_version());
#endif
#endif
lua_push_uint64_table_entry(vm, "constants.max_num_host_pools", MAX_NUM_HOST_POOLS);
lua_push_uint64_table_entry(vm, "constants.max_num_pool_members", MAX_NUM_POOL_MEMBERS);
Expand Down Expand Up @@ -8046,8 +8049,8 @@ static const luaL_Reg ntop_interface_reg[] = {

#if defined(HAVE_NINDEX) && defined(NTOPNG_PRO)
/* nIndex */
{ "nIndexSelect", ntop_nindex_select },
{ "nIndexTopK", ntop_nindex_topk },
{ "nIndexSelect", ntop_nindex_select },
{ "nIndexTopK", ntop_nindex_topk },
#endif

/* Live Capture */
Expand Down

0 comments on commit 15efe2f

Please sign in to comment.