[Logwatch-Devel] Patch- HTML update +misc fixes

Ross Becker ross at trapezenetworks.com
Mon Sep 17 03:01:24 MST 2007


Okay, 
   Here's my first patch. It's against the current CVS code.  


Fixups:
   - I updated the HTML output to be a little easier on the eyes. This
still could use a bunch more work, but it's significantly better
(subjectively to me) than it was. Various changes ranging from
font/color/table formatting to removing the "section begin" and "section
end" outputs, since the HTML table clearly delineates the service
beginnings and ends.
   - The case of HTML output with splithost on and multiemail off was
broken; The "Reporting on hosts:"  line would be emitted before the MIME
type and the HTML, completely breaking some HTML renderers.  I moved the
output of that to go under the "Logwatch summary" section.
   - In the case of splithost on and multiemail off, the hostname used
for the summary was not the host that logwatch was run on; it would pick
up one of the hosts for which it processed logfiles and use that. Fixed
the email subject to use ${hostname} instead of $config{'hostname'}
which was subject to change.


Still broken:
  Splithost on and multiemail off is badly broken.  In the case of HTML
format, the html header and footer will be emitted at the beginning and
end of each host.  The copyright/legal notice will be appended
repeatedly to a variable which is emitted at the end of each host.  The
section index accumulates with each successive host, and re-emitted at
the beginning of each host section, with each successive index having
the links for all the previous hosts as well as the current one.

Most of these are probably pretty easy to fix.  I'm guessing that nobody
ever tested this combination.  It's not what I intend to use in the long
term, but it would be good to get it basically working; would probably
mean the code was a bit cleaner ;)

Some other issues with HTML output in general-
   At some point in every run through logs I've tried, the output
function breaks- it starts treating calls where the type sent is "line"
as "header" type.  Not sure what's going on there, but it buggers up the
tail ends of all my HTML logwatch reports.

Several of the scripts emit blank lines, which turn into empty table
cells. Annoying, but only a cosmetic nitpick.



Lastly,  I'm having difficulty determining the appropriate way to set up
a central loghost.  From a syslog standpoint, it was easy.  I configured
syslog-ng to log everything from local stuff normally, but if things
came in from the network, they are punted to
/var/log/hosts/HOSTNAME.log.

For switches, that works fine, because I can associate the log for each
switch to it's logfile group pertaining to the service.  For hosts where
I want to run multiple services against a single logfile, I haven't yet
figured out if it's possible to make it work.  If someone could confirm
that logwatch doesn't do this, or tell me I'm an idiot and I need to
RTFM again,  I'd much appreciate it.

Cheers
  Ross

 

   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: logwatch.cvs.patch
Type: application/octet-stream
Size: 6109 bytes
Desc: logwatch.cvs.patch
Url : http://www2.list.logwatch.org:81/pipermail/logwatch-devel/attachments/20070917/e6f4daa2/attachment-0002.obj 


More information about the Logwatch-Devel mailing list