diff options
Diffstat (limited to 'snort-model.lua')
-rw-r--r-- | snort-model.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/snort-model.lua b/snort-model.lua index c8c7d83..6c633a3 100644 --- a/snort-model.lua +++ b/snort-model.lua @@ -1,5 +1,5 @@ -- acf model for displaying logfiles recusivly -module (..., package.seeall) +local mymodule = {} -- Load libraries modelfunctions = require("modelfunctions") @@ -17,19 +17,19 @@ local alertfile = "/var/log/snort/alert" -- ################################################################################ -- PUBLIC FUNCTIONS -function getstatus() +function mymodule.getstatus() return modelfunctions.getstatus(processname, packagename, "Snort Status") end -function get_startstop(self, clientdata) +function mymodule.get_startstop(self, clientdata) return modelfunctions.get_startstop(processname) end -function startstop_service(self, startstop, action) +function mymodule.startstop_service(self, startstop, action) return modelfunctions.startstop_service(startstop, action) end -function read_alert() +function mymodule.read_alert() local alertpriority = {} local liboutput = fs.read_file_as_array(alertfile) if (liboutput) then @@ -77,10 +77,12 @@ function read_alert() return cfe({ type="structure", value=sorted_table, label="Snort Alerts" }) end -function get_filedetails() +function mymodule.get_filedetails() return modelfunctions.getfiledetails(configfile) end -function update_filedetails(self, filedetails) +function mymodule.update_filedetails(self, filedetails) return modelfunctions.setfiledetails(self, filedetails, {configfile}) end + +return mymodule |