-- -- (C) 2013-22 - ntop.org -- local dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path if((dirs.scriptdir ~= nil) and (dirs.scriptdir ~= "")) then package.path = dirs.scriptdir .. "/lua/modules/?.lua;" .. package.path end require "lua_utils" local page_utils = require("page_utils") local ts_utils = require("ts_utils") local script_manager = require("script_manager") local graph_utils = require("graph_utils") local influxdb_export_api = require "influxdb_export_api" sendHTTPContentTypeHeader('text/html') local charts_available = script_manager.systemTimeseriesEnabled() local page = _GET["page"] or "overview" local url = script_manager.getMonitorUrl("influxdb_monitor.lua") .. "?ifid=" .. interface.getId() page_utils.set_active_menu_entry(page_utils.menu_entries.influxdb_status) dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") page_utils.print_navbar("InfluxDB", url, { { active = page == "overview" or not page, page_name = "overview", label = "", }, { hidden = not charts_available, active = page == "historical", page_name = "historical", label = "", }, } ) -- ####################################################### if(page == "overview") then local fa_external = "" local tags = {ifid=getSystemInterfaceId()} print("\n") print("\n") print("") print("\n") print("") print("\n") if(influxdb_export_api.isInfluxdbChecksEnabled() == true) then local stats = influxdb_export_api.getExportStats() print("") print("\n") print("") print("\n") end print("\n") print[[ ]] print("
".. i18n("system_stats.health") .."
"..i18n("system_stats.short_desc_influxdb_health").."
Loading...
".. i18n("traffic_recording.storage_utilization") .."
"..i18n("system_stats.short_desc_influxdb_storage_utilization").."
") print(ternary(charts_available, "", "")) print("Loading...
".. i18n("about.ram_memory") .."
"..i18n("system_stats.short_desc_influxdb_ram_memory").."
") print(ternary(charts_available, "", "")) print("Loading...
".. i18n("system_stats.exports") .."
"..i18n("system_stats.short_desc_influxdb_exports").."
") print(ternary(charts_available, "", "")) print("".. formatValue(stats.exports) .."
".. i18n("system_stats.exported_points") .."
"..i18n("system_stats.short_desc_influxdb_exported_points").."
") print(ternary(charts_available, "", "")) print("".. formatValue(stats.points_exported) .."
".. i18n("system_stats.series_cardinality") .."
"..i18n("system_stats.short_desc_influxdb_cardinality").."
Loading...
\n") print(""..i18n("notes").."") print("") elseif(page == "historical" and charts_available) then local schema = _GET["ts_schema"] or "influxdb:storage_size" local selected_epoch = _GET["epoch"] or "" local tags = {ifid = getSystemInterfaceId()} url = url.."&page=historical" graph_utils.drawGraphs(getSystemInterfaceId(), schema, tags, _GET["zoom"], url, selected_epoch, { timeseries = { {schema="influxdb:storage_size", label=i18n("traffic_recording.storage_utilization")}, {schema="influxdb:memory_size", label=i18n("about.ram_memory")}, {schema="influxdb:write_successes", label=i18n("system_stats.write_througput")}, {schema="influxdb:exports", label=i18n("system_stats.exports_label"), value_formatter = {"NtopUtils.export_rate", "NtopUtils.exports_format"}, metrics_labels = {i18n("system_stats.exports_label")}}, {schema="influxdb:exported_points", label=i18n("system_stats.exported_points")}, {schema="influxdb:dropped_points", label=i18n("system_stats.dropped_points")}, {schema="custom:infludb_exported_vs_dropped_points", label=i18n("system_stats.exported_vs_dropped_points"), custom_schema = { bases = {"influxdb:exported_points", "influxdb:dropped_points"}, types = {"area", "line"}, axis = {1,2}, }, metrics_labels = {i18n("system_stats.exported_points"), i18n("system_stats.dropped_points")}, }, {schema="influxdb:rtt", label=i18n("graphs.num_ms_rtt")}, }}) end -- ####################################################### dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")