From 99a7271471c1fb01df5dc7d6bb8ddf1f42aefffd Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 5 Nov 2019 17:30:08 +1000 Subject: Generic reports, including a dumb example. --- apt-panopticon.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'apt-panopticon.lua') diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 2a9631b..788d72c 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -48,6 +48,20 @@ options = -- "Updated", }, }, + reports = + { + typ = "table", + help = "", + value = + { + "DNS", + "email", +-- "Nagios", + "Prometheus", +-- "RRD", + "web", + }, + }, } local defaultURL = {scheme = "http"} @@ -630,5 +644,17 @@ else while 0 < checkExes(downloadLock) do os.execute("sleep 10") end end os.execute("rm -f results/*.check") + + -- Create the reports. + for n, r in pairs(options.reports.value) do + local report = "apt-panopticon-report-" .. r .. ".lua" + local rfile, e = io.open(report, "r") + if nil == rfile then C("opening " .. report .. " file - " .. e) else + rfile:close() + I("Creating " .. report .. " report.") + execute("./" .. report .. " &") + end + end + logFile:close() end -- cgit v1.1