diff options
| author | onefang | 2019-11-05 17:30:08 +1000 |
|---|---|---|
| committer | onefang | 2019-11-05 17:30:08 +1000 |
| commit | 99a7271471c1fb01df5dc7d6bb8ddf1f42aefffd (patch) | |
| tree | 10ad826455349e705288f07ade4bd61329dae32b /apt-panopticon.lua | |
| parent | Whitespace clean up. (diff) | |
| download | apt-panopticon-99a7271471c1fb01df5dc7d6bb8ddf1f42aefffd.zip apt-panopticon-99a7271471c1fb01df5dc7d6bb8ddf1f42aefffd.tar.gz apt-panopticon-99a7271471c1fb01df5dc7d6bb8ddf1f42aefffd.tar.bz2 apt-panopticon-99a7271471c1fb01df5dc7d6bb8ddf1f42aefffd.tar.xz | |
Generic reports, including a dumb example.
Diffstat (limited to '')
| -rwxr-xr-x | apt-panopticon.lua | 26 |
1 files changed, 26 insertions, 0 deletions
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 = | |||
| 48 | -- "Updated", | 48 | -- "Updated", |
| 49 | }, | 49 | }, |
| 50 | }, | 50 | }, |
| 51 | reports = | ||
| 52 | { | ||
| 53 | typ = "table", | ||
| 54 | help = "", | ||
| 55 | value = | ||
| 56 | { | ||
| 57 | "DNS", | ||
| 58 | "email", | ||
| 59 | -- "Nagios", | ||
| 60 | "Prometheus", | ||
| 61 | -- "RRD", | ||
| 62 | "web", | ||
| 63 | }, | ||
| 64 | }, | ||
| 51 | } | 65 | } |
| 52 | 66 | ||
| 53 | local defaultURL = {scheme = "http"} | 67 | local defaultURL = {scheme = "http"} |
| @@ -630,5 +644,17 @@ else | |||
| 630 | while 0 < checkExes(downloadLock) do os.execute("sleep 10") end | 644 | while 0 < checkExes(downloadLock) do os.execute("sleep 10") end |
| 631 | end | 645 | end |
| 632 | os.execute("rm -f results/*.check") | 646 | os.execute("rm -f results/*.check") |
| 647 | |||
| 648 | -- Create the reports. | ||
| 649 | for n, r in pairs(options.reports.value) do | ||
| 650 | local report = "apt-panopticon-report-" .. r .. ".lua" | ||
| 651 | local rfile, e = io.open(report, "r") | ||
| 652 | if nil == rfile then C("opening " .. report .. " file - " .. e) else | ||
| 653 | rfile:close() | ||
| 654 | I("Creating " .. report .. " report.") | ||
| 655 | execute("./" .. report .. " &") | ||
| 656 | end | ||
| 657 | end | ||
| 658 | |||
| 633 | logFile:close() | 659 | logFile:close() |
| 634 | end | 660 | end |
