-- -- (C) 2014-15 - ntop.org -- -- This file contains the description of all functions -- used to trigger host alerts local verbose = false -- notify ntopng upon preference changes function notifyNtopng(key) if key == nil then return end -- notify runtime ntopng configuration changes if string.starts(key, 'nagios') then if verbose then io.write('notifying ntopng upon nagios pref change\n') end ntop.reloadNagiosConfig() end end -- ############################################ -- Runtime preference function prefsInputField(label, comment, key, value) if(_GET[key] ~= nil) then k = "ntopng.prefs."..key v_s = _GET[key] v = tonumber(v_s) if(v ~= nil and (v > 0) and (v <= 86400)) then ntop.setCache(k, tostring(v)) value = v elseif (v_s ~= nil) then ntop.setCache(k, v_s) value = v_s end -- least but not last we ascynchronously notify the runtime ntopng instance for changes notifyNtopng(key) end print('
'..comment..'
'..comment..'