From 0de33748d6b213e319fd21bd72732fa8a73be61d Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Sat, 31 Oct 2015 19:04:15 +0000 Subject: Modify logfile to use common view --- openntpd-model.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'openntpd-model.lua') diff --git a/openntpd-model.lua b/openntpd-model.lua index f5607f5..5aec085 100644 --- a/openntpd-model.lua +++ b/openntpd-model.lua @@ -16,6 +16,8 @@ local processname = "ntpd" local function last_time_change() local cmdoutput = "(Have no data on updates)" + -- This works for busybox syslog, which always logs to /var/log/messages + -- FIXME to work with other syslog options local mess = fs.read_file_as_array("/var/log/messages") for i=table.maxn(mess),1,-1 do if string.find(mess[i], "ntpd.*adjusting") then @@ -162,4 +164,11 @@ function mymodule.update_filedetails(self, filedetails) return modelfunctions.setfiledetails(self, filedetails, {configfile}) end +function mymodule.get_logfile(self, clientdata) + local retval = cfe({ type="group", value={}, label="Log File Configuration" }) + retval.value.facility = cfe({value="daemon", label="Syslog Facility"}) + retval.value.grep = cfe({ value="ntpd", label="Grep" }) + return retval +end + return mymodule -- cgit v1.2.3