initial commit of file from CVS for e-smith-viewlogfiles on Wed 12 Jul 09:12:02 BST 2023

master 2.6.0
Brian Read 10 months ago
parent 1ef117a658
commit f5ebdcc806

4
.gitignore vendored

@ -0,0 +1,4 @@
*.rpm
*.log
*spec-20*
*.tar.xz

@ -0,0 +1,21 @@
# Makefile for source rpm: e-smith-viewlogfiles
# $Id: Makefile,v 1.1 2016/02/05 16:50:06 stephdl Exp $
NAME := e-smith-viewlogfiles
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

@ -1,3 +1,17 @@
# e-smith-viewlogfiles
# <img src="https://www.koozali.org/images/koozali/Logo/Png/Koozali_logo_2016.png" width="25%" vertical="auto" style="vertical-align:bottom"> e-smith-viewlogfiles
SMEServer Koozali developed git repo for e-smith-viewlogfiles smeserver
SMEServer Koozali developed git repo for e-smith-viewlogfiles smeserver
## Wiki
<br />https://wiki.koozali.org/
## Bugzilla
Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=e-smith-viewlogfiles&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
## Description
<br />*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*
*Once it has been checked, then this comment will be deleted*
<br />
e-smith-viewlogfiles is a web interface software that allows users to quickly and easily view and analyze logfiles on their e-smith server. It is a great tool for troubleshooting problems and analyzing web server activity. It offers an intuitive graphical interface, with options for sorting, filtering, and searching through logfiles. With e-smith-viewlogfiles, users can easily identify potential issues and take the necessary steps to correct them. Additionally, the software can help users detect any malicious activities taking place on their server and take corrective action. Overall, e-smith-viewlogfiles provides a powerful and user-friendly way to monitor and analyze logfiles on their e-smith server.

@ -0,0 +1,310 @@
Summary: Web manager panel to provide view access to log files
%define name e-smith-viewlogfiles
Name: %{name}
%define version 1.7.2
%define release 01
Version: %{version}
Release: %{release}
License: GPL
Vendor: Mitel Networks Corporation
Group: Networking/Daemons
Source: %{name}-%{version}.tar.gz
Packager: e-smith developers <bugs@e-smith.com>
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
BuildRequires: e-smith-devtools
BuildArchitectures: noarch
Requires: e-smith-base
Requires: e-smith-lib >= 1.13.1-58
Requires: perl
Requires: perl(CGI::FormMagick)
Requires: perl(Time::TAI64)
AutoReqProv: no
%changelog
* Fri Oct 14 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.7.2-01]
- Remove L10Ns from base packages [SF: 1309520]
* Fri Oct 14 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.7.1-01]
- New dev stream before relocating L10Ns
* Fri Sep 30 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.7.0-11]
- Added Italian L10N - Thanks Filippo Carletti [SF: 1309266]
* Mon Sep 26 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.7.0-10]
- Added German L10N - Thanks Dietmar Berteld [SF: 1293325]
* Thu Aug 25 2005 Charlie Brady <charlieb@e-smith.com>
- [1.7.0-09]
- Take II at chomp fix. [SF: 1264596]
* Thu Aug 25 2005 Gordon Rowell <gordonr@gormand.com.au>
- [1.7.0-08]
- Fix call to chomp, and save a temporary assign [SF: 1264596]
* Mon Aug 22 2005 Charlie Brady <charlieb@e-smith.com>
- [1.7.0-07]
- Fix typo in last change, and double spacing problem. [SF: 1264596]
* Tue Aug 16 2005 Charlie Brady <charlieb@e-smith.com>
- [1.7.0-06]
- Use Time::TAI64 module to convert multilog timestamps, rather than
external invocation of tia64nlocal.
* Thu Jul 28 2005 Charlie Brady <charlieb@e-smith.com>
- [1.7.0-05]
- Remove false "fix" from previous change. [SF: 1227604]
- Replace deprecated "Copyright" header with "License" header.
* Thu Jul 28 2005 Charlie Brady <charlieb@e-smith.com>
- [1.7.0-04]
- Fix "uninitialized value" warnings from viewlogfiles CGI. [SF: 1227604]
- Replace all uses of the deprecated esmith::config and db_ APIs.
* Thu Sep 16 2004 Michael Soulier <msoulier@e-smith.com>
- [1.7.0-03]
- Updated requires with new perl dependencies. [msoulier MN00040240]
- Fixed Content disposition. [msoulier MN00049326]
* Fri Aug 27 2004 Michael Soulier <msoulier@e-smith.com>
- [1.7.0-02]
- Added resolution of multilog timestamps in logfile download.
[msoulier MN00033909]
* Fri Aug 27 2004 Michael Soulier <msoulier@e-smith.com>
- [1.7.0-01]
- rolling to dev - 1.7.0
* Tue Jan 6 2004 Michael Soulier <msoulier@e-smith.com>
- [1.6.0-03]
- Fixed escaping of HTML entities via HTML::Entities::encode_entities().
[msoulier 10418]
* Wed Jul 9 2003 Michael Soulier <msoulier@e-smith.com>
- [1.6.0-02]
- Fixed odd FormMagick caching WSOD by removing intermediate page in log
download. [msoulier 9223]
* Thu Jun 26 2003 Charlie Brady <charlieb@e-smith.com>
- [1.6.0-01]
- Changing version to stable stream number - 1.6.0
* Tue Jun 24 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-17]
- Spanish nav bar entries [gordonr 9153]
* Thu Jun 19 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-16]
- Added recognition of Mac clients, and made the .log extension unconditional.
[msoulier 8634]
* Thu Jun 19 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-15]
- Added handling of filenames with additional subdirectories.
[msoulier 8634]
* Thu Jun 19 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-14]
- Added detection of windows client via the user-agent string, so .log
extension is only added in that case. Additionally, in that case, CR/LF
conversion is performed on the logfile. [msoulier 8634]
* Wed Jun 18 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-13]
- Added a .log extension to all logfiles to work around the fact that Windows
ignores http response directives. [msoulier 8634]
* Wed May 14 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-12]
- Added French and Spanish lexicon. [msoulier 8634]
* Fri May 9 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-11]
- Minor Spanish update from Alejandro [gordonr 8634]
* Fri May 9 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-10]
- Minor French/Spanish lexicon updates [gordonr 8634]
* Tue May 6 2003 Lijie Deng <lijied@e-smith.com>
- [1.5.0-09]
- Add Spanish lexicon for viewlogfiles [lijied 3793]
* Tue May 6 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-08]
- Added the operation parameter to the refresh option to maintain the default
in the configuration database. [msoulier 8634]
* Tue May 6 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-07]
- Changed the operation selection widget to being generated by the backend
code, so we can control the default. [msoulier 8634]
- Now caching the default choice in the configuration database.
[msoulier 8634]
* Tue May 6 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-06]
- Updated dependencies for the download logfile feature. [msoulier 8634]
- Added download logfile feature. [msoulier 8634]
* Tue May 6 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-05]
- Added a "Refresh" log button. [msoulier 6935]
- Added lexicon changes for refresh feature. [msoulier 6935]
* Fri Apr 11 2003 Lijie Deng <lijied@e-smith.com>
- [1.5.0-04]
- Removed Mitel Networks branding [lijied 8016]
* Mon Mar 31 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-03]
- Make use of esmith::Tai64n to display multilog filenames and contents
in local time [gordonr 6930]
- Use a hash instead of an array for the filename list and let
FM do the sorting for us, which allows the displayed name and the filename
to differ [gordonr 6930]
* Mon Mar 31 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-02]
- Split out en-us lexicon [gordonr 4030]
* Mon Mar 31 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-01]
- dev stream to 1.5.0
* Fri Mar 28 2003 Lijie Deng <lijied@e-smith.com>
- [1.4.0-05]
- Modified French lexicon to use lang="fr", rename the lexicon
directory to fr [lijied 6787]
* Tue Mar 25 2003 Mark Knox <markk@e-smith.com>
- [1.4.0-04]
- Use localised date in report header [markk 3599]
* Thu Mar 6 2003 Lijie Deng <lijied@e-smith.com>
- [1.4.0-03]
- Modified viewlogfiles panel order [lijied 7356]
* Mon Mar 3 2003 Lijie Deng <lijied@e-smith.com>
- [1.4.0-02]
- Added French lexicon for viewlogfiles [lijied 5003]
* Fri Jan 24 2003 Michael Soulier <msoulier@e-smith.com>
- [1.4.0-01]
- rolling to delivery stream to 1.4.0
* Thu Nov 7 2002 Charlie Brady <charlieb@e-smith.com>
- [1.3.0-02]
- Fix warning about @logfiles variable [charlieb 4613]
- Allow log files containing spaces in filename to be viewed [charlieb 5588]
- Filter all logfiles using tai64nlocal, so that dates are in
human readable form. [charlieb 5334]
* Thu Nov 7 2002 Charlie Brady <charlieb@e-smith.com>
- [1.3.0-01]
- Roll development stream to 1.3.0
* Sat Oct 12 2002 Charlie Brady <charlieb@e-smith.com>
- [1.2.0-01]
- Roll to maintained version number to 1.2.0
* Wed Jul 24 2002 Gordon Rowell <gordonr@e-smith.com>
- [1.1.2-01]
- Removed stray e-smith-viewlogfiles-0.0.1 directory [gordonr 4466]
* Wed Jul 24 2002 Mark Knox <markk@e-smith.com>
- [1.1.1-01]
- Escape HTML chars even when not highlighting [markk 4466]
* Wed Jun 5 2002 Charlie Brady <charlieb@e-smith.com>
- [1.1.0-01]
- Changing version to maintained stream number to 1.1.0
* Thu May 23 2002 Gordon Rowell <gordonr@e-smith.com>
- [1.0.5-01]
- RPM rebuild forced by cvsroot2rpm
* Wed May 1 2002 Gordon Rowell <gordonr@e-smith.com>
- [1.0.4-01]
- esmith::AccountDB -> esmith::AccountsDB [schwern 3287]
* Tue Apr 16 2002 Adrian Chung <adrianc@e-smith.com>
- [1.0.3-01]
- Conversion of viewlogfiles panel to FormMagick. [mac #3175]
* Tue Apr 16 2002 Adrian Chung <adrianc@e-smith.com>
- [1.0.2-01]
- Initial CVS version.
* Tue Apr 16 2002 Adrian Chung <mac@e-smith.com>
- [1.0.1-01]
- rollRPM: Rolled version number to 1.0.1-01. Includes patches up to 1.0.0-03.
* Wed Nov 07 2001 Tony Clayton <tonyc@e-smith.com>
- [1.0.0-03]
- rebranding to Mitel Networks
* Tue Aug 21 2001 Charlie Brady <charlieb@e-smith.com>
- [1.0.0-02]
- Distinguish between empty file and no matching lines in output.
* Mon Aug 20 2001 Gordon Rowell <gordonr@e-smith.com>
- [1.0.0-01]
- Rolled version number to 1.0.0-01. Includes patches upto 0.0.1-05.
* Mon Aug 20 2001 Gordon Rowell <gordonr@e-smith.com>
- [0.0.1-05]
- Display name of logfile and patterns applied in output
* Mon Aug 20 2001 Gordon Rowell <gordonr@e-smith.com>
- [0.0.1-04]
- Disabled custom sort order - I find it non-intuitive
- Display "No lines displayed" if this is true
- Expanded text, describing filters in more depth
- Display filename of viewed log file
* Sat Aug 18 2001 Charlie Brady <charlieb@e-smith.com>
- [0.0.1-03]
- Introduce custom sort order, with messages at top and rotated logs at end.
- Add feature to display gzipped files.
* Fri Aug 17 2001 Charlie Brady <charlieb@e-smith.com>
- [0.0.1-02]
- Replace fixed log file list with one generated at run time
- Filter out known non-log files from the generated list
- Clean more of the environment (although I don't think it matters)
- Add brief text to explain the entry boxes
* Fri Aug 17 2001 Charlie Brady <charlieb@e-smith.com>
- [0.0.1-01]
- initial release
%description
Insert an e-smith-manager web panel to allow log files to be viewed.
%prep
%setup
%build
perl createlinks
%install
rm -rf $RPM_BUILD_ROOT
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
rm -f %{name}-%{version}-%{release}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
> %{name}-%{version}-%{release}-filelist
%clean
rm -rf $RPM_BUILD_ROOT
%pre
%preun
%post
%postun
%files -f %{name}-%{version}-%{release}-filelist
%defattr(-,root,root)

@ -0,0 +1 @@
sme10

@ -0,0 +1,5 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
panel_link("viewlogfiles", "manager");

@ -0,0 +1,378 @@
# $Id: e-smith-viewlogfiles.spec,v 1.4 2021/01/05 21:25:18 jpp Exp $
Summary: Web manager panel to provide view access to log files
%define name e-smith-viewlogfiles
Name: %{name}
%define version 2.6.0
%define release 5
Version: %{version}
Release: %{release}%{?dist}
License: GPL
Group: Networking/Daemons
Source: %{name}-%{version}.tar.xz
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
BuildRequires: e-smith-devtools
BuildArchitectures: noarch
Requires: e-smith-base
Requires: e-smith-lib >= 1.13.1-58
Requires: perl
Requires: perl(CGI::FormMagick)
Requires: e-smith-formmagick >= 1.4.0-12
Requires: perl(Time::TAI64)
AutoReqProv: no
%changelog
* Wed Jul 12 2023 cvs2git.sh aka Brian Read <brianr@koozali.org> 2.6.0-5.sme
- Roll up patches and move to git repo [SME: 12338]
* Wed Jul 12 2023 BogusDateBot
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
by assuming the date is correct and changing the weekday.
* Tue Jan 05 2021 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-4.sme
- create an empty e-smith-viewlogfiles-update event [SME: 11160]
* Thu May 12 2016 Daniel Berteaud <daniel@firewall-services.com> 2.6.0-3.sme
- Use CreateLinks instead of local functions so panel links point on the
wrapper [SME: 9393]
* Thu May 12 2016 Daniel Berteaud <daniel@firewall-services.com> 2.6.0-2.sme
- Rebuild for [SME: 9393]
* Fri Feb 05 2016 stephane de Labrusse <stephdl@de-labrusse.fr> 2.6.0-1.sme
- Initial release to sme10
* Wed Feb 13 2013 Shad L. Lords <slords@mail.com> 2.4.0-1.sme
- Roll new stream for sme9
* Tue Oct 7 2008 Shad L. Lords <slords@mail.com> 2.2.0-1.sme
- Roll new stream to separate sme7/sme8 trees [SME: 4633]
* Sun Apr 27 2008 Jonathan Martens <smeserver-contribs@snetram.nl> 1.8.0-11
- Add common <base> tags to e-smith-formmagick's general [SME: 4281]
* Wed Mar 12 2008 Shad L. Lords <slords@mail.com> 1.8.0-10
- Remove tests for removed FORM_TITLE's [SME: 4050]
* Wed Feb 13 2008 Stephen Noble <support@dungog.net> 1.8.0-9
- Remove <base> tags now in general [SME: 3916]
* Sun Feb 10 2008 Stephen Noble <support@dungog.net> 1.8.0-8
- Remove duplicate <base> entries [SME: 3891]
* Wed Jan 09 2008 Stephen Noble <support@dungog.net> 1.8.0-7
- show log filename on panel [SME: 2770]
* Mon Dec 24 2007 Stephen Noble <support@dungog.net> 1.8.0-6
- remove viewlogfile.orig [SME: 3647]
* Wed Oct 31 2007 Charlie Brady <charlie_brady@mitel.com> 1.8.0-5
- Exclude svlogd config and btmp files. [SME: 3486]
* Mon Oct 01 2007 Charlie Brady <charlie_brady@mitel.com> 1.8.0-4
- Allow viewing of qpsmtpd/state. [SME: 3416]
* Sat Sep 29 2007 Charlie Brady <charlie_brady@mitel.com> 1.8.0-3
- Convert squid log timestamps to localtime. [SME: 3432]
* Sun Apr 29 2007 Shad L. Lords <slords@mail.com>
- Clean up spec so package can be built by koji/plague
* Thu Dec 07 2006 Shad L. Lords <slords@mail.com>
- Update to new release naming. No functional changes.
- Make Packager generic
* Wed Mar 15 2006 Charlie Brady <charlie_brady@mitel.com> 1.8.0-01
- Roll stable stream version. [SME: 1016]
* Wed Nov 30 2005 Gordon Rowell <gordonr@gormand.com.au> 1.7.2-03
- Bump release number only
* Thu Oct 27 2005 Charlie Brady <charlieb@e-smith.com>
- [1.7.2-02]
- Avoid uninitialized variable warnings in logfile when highlistPattern is
unset. [SF: 1227604]
* Fri Oct 14 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.7.2-01]
- Remove L10Ns from base packages [SF: 1309520]
* Fri Oct 14 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.7.1-01]
- New dev stream before relocating L10Ns
* Fri Sep 30 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.7.0-11]
- Added Italian L10N - Thanks Filippo Carletti [SF: 1309266]
* Mon Sep 26 2005 Gordon Rowell <gordonr@e-smith.com>
- [1.7.0-10]
- Added German L10N - Thanks Dietmar Berteld [SF: 1293325]
* Thu Aug 25 2005 Charlie Brady <charlieb@e-smith.com>
- [1.7.0-09]
- Take II at chomp fix. [SF: 1264596]
* Thu Aug 25 2005 Gordon Rowell <gordonr@gormand.com.au>
- [1.7.0-08]
- Fix call to chomp, and save a temporary assign [SF: 1264596]
* Mon Aug 22 2005 Charlie Brady <charlieb@e-smith.com>
- [1.7.0-07]
- Fix typo in last change, and double spacing problem. [SF: 1264596]
* Tue Aug 16 2005 Charlie Brady <charlieb@e-smith.com>
- [1.7.0-06]
- Use Time::TAI64 module to convert multilog timestamps, rather than
external invocation of tia64nlocal.
* Thu Jul 28 2005 Charlie Brady <charlieb@e-smith.com>
- [1.7.0-05]
- Remove false "fix" from previous change. [SF: 1227604]
- Replace deprecated "Copyright" header with "License" header.
* Thu Jul 28 2005 Charlie Brady <charlieb@e-smith.com>
- [1.7.0-04]
- Fix "uninitialized value" warnings from viewlogfiles CGI. [SF: 1227604]
- Replace all uses of the deprecated esmith::config and db_ APIs.
* Thu Sep 16 2004 Michael Soulier <msoulier@e-smith.com>
- [1.7.0-03]
- Updated requires with new perl dependencies. [msoulier MN00040240]
- Fixed Content disposition. [msoulier MN00049326]
* Fri Aug 27 2004 Michael Soulier <msoulier@e-smith.com>
- [1.7.0-02]
- Added resolution of multilog timestamps in logfile download.
[msoulier MN00033909]
* Fri Aug 27 2004 Michael Soulier <msoulier@e-smith.com>
- [1.7.0-01]
- rolling to dev - 1.7.0
* Tue Jan 6 2004 Michael Soulier <msoulier@e-smith.com>
- [1.6.0-03]
- Fixed escaping of HTML entities via HTML::Entities::encode_entities().
[msoulier 10418]
* Wed Jul 9 2003 Michael Soulier <msoulier@e-smith.com>
- [1.6.0-02]
- Fixed odd FormMagick caching WSOD by removing intermediate page in log
download. [msoulier 9223]
* Thu Jun 26 2003 Charlie Brady <charlieb@e-smith.com>
- [1.6.0-01]
- Changing version to stable stream number - 1.6.0
* Tue Jun 24 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-17]
- Spanish nav bar entries [gordonr 9153]
* Thu Jun 19 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-16]
- Added recognition of Mac clients, and made the .log extension unconditional.
[msoulier 8634]
* Thu Jun 19 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-15]
- Added handling of filenames with additional subdirectories.
[msoulier 8634]
* Thu Jun 19 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-14]
- Added detection of windows client via the user-agent string, so .log
extension is only added in that case. Additionally, in that case, CR/LF
conversion is performed on the logfile. [msoulier 8634]
* Wed Jun 18 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-13]
- Added a .log extension to all logfiles to work around the fact that Windows
ignores http response directives. [msoulier 8634]
* Wed May 14 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-12]
- Added French and Spanish lexicon. [msoulier 8634]
* Fri May 9 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-11]
- Minor Spanish update from Alejandro [gordonr 8634]
* Fri May 9 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-10]
- Minor French/Spanish lexicon updates [gordonr 8634]
* Tue May 6 2003 Lijie Deng <lijied@e-smith.com>
- [1.5.0-09]
- Add Spanish lexicon for viewlogfiles [lijied 3793]
* Tue May 6 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-08]
- Added the operation parameter to the refresh option to maintain the default
in the configuration database. [msoulier 8634]
* Tue May 6 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-07]
- Changed the operation selection widget to being generated by the backend
code, so we can control the default. [msoulier 8634]
- Now caching the default choice in the configuration database.
[msoulier 8634]
* Tue May 6 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-06]
- Updated dependencies for the download logfile feature. [msoulier 8634]
- Added download logfile feature. [msoulier 8634]
* Tue May 6 2003 Michael Soulier <msoulier@e-smith.com>
- [1.5.0-05]
- Added a "Refresh" log button. [msoulier 6935]
- Added lexicon changes for refresh feature. [msoulier 6935]
* Fri Apr 11 2003 Lijie Deng <lijied@e-smith.com>
- [1.5.0-04]
- Removed Mitel Networks branding [lijied 8016]
* Mon Mar 31 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-03]
- Make use of esmith::Tai64n to display multilog filenames and contents
in local time [gordonr 6930]
- Use a hash instead of an array for the filename list and let
FM do the sorting for us, which allows the displayed name and the filename
to differ [gordonr 6930]
* Mon Mar 31 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-02]
- Split out en-us lexicon [gordonr 4030]
* Mon Mar 31 2003 Gordon Rowell <gordonr@e-smith.com>
- [1.5.0-01]
- dev stream to 1.5.0
* Fri Mar 28 2003 Lijie Deng <lijied@e-smith.com>
- [1.4.0-05]
- Modified French lexicon to use lang="fr", rename the lexicon
directory to fr [lijied 6787]
* Tue Mar 25 2003 Mark Knox <markk@e-smith.com>
- [1.4.0-04]
- Use localised date in report header [markk 3599]
* Thu Mar 6 2003 Lijie Deng <lijied@e-smith.com>
- [1.4.0-03]
- Modified viewlogfiles panel order [lijied 7356]
* Mon Mar 3 2003 Lijie Deng <lijied@e-smith.com>
- [1.4.0-02]
- Added French lexicon for viewlogfiles [lijied 5003]
* Fri Jan 24 2003 Michael Soulier <msoulier@e-smith.com>
- [1.4.0-01]
- rolling to delivery stream to 1.4.0
* Thu Nov 7 2002 Charlie Brady <charlieb@e-smith.com>
- [1.3.0-02]
- Fix warning about @logfiles variable [charlieb 4613]
- Allow log files containing spaces in filename to be viewed [charlieb 5588]
- Filter all logfiles using tai64nlocal, so that dates are in
human readable form. [charlieb 5334]
* Thu Nov 7 2002 Charlie Brady <charlieb@e-smith.com>
- [1.3.0-01]
- Roll development stream to 1.3.0
* Sat Oct 12 2002 Charlie Brady <charlieb@e-smith.com>
- [1.2.0-01]
- Roll to maintained version number to 1.2.0
* Wed Jul 24 2002 Gordon Rowell <gordonr@e-smith.com>
- [1.1.2-01]
- Removed stray e-smith-viewlogfiles-0.0.1 directory [gordonr 4466]
* Wed Jul 24 2002 Mark Knox <markk@e-smith.com>
- [1.1.1-01]
- Escape HTML chars even when not highlighting [markk 4466]
* Wed Jun 5 2002 Charlie Brady <charlieb@e-smith.com>
- [1.1.0-01]
- Changing version to maintained stream number to 1.1.0
* Thu May 23 2002 Gordon Rowell <gordonr@e-smith.com>
- [1.0.5-01]
- RPM rebuild forced by cvsroot2rpm
* Wed May 1 2002 Gordon Rowell <gordonr@e-smith.com>
- [1.0.4-01]
- esmith::AccountDB -> esmith::AccountsDB [schwern 3287]
* Tue Apr 16 2002 Adrian Chung <adrianc@e-smith.com>
- [1.0.3-01]
- Conversion of viewlogfiles panel to FormMagick. [mac #3175]
* Tue Apr 16 2002 Adrian Chung <adrianc@e-smith.com>
- [1.0.2-01]
- Initial CVS version.
* Tue Apr 16 2002 Adrian Chung <mac@e-smith.com>
- [1.0.1-01]
- rollRPM: Rolled version number to 1.0.1-01. Includes patches up to 1.0.0-03.
* Wed Nov 07 2001 Tony Clayton <tonyc@e-smith.com>
- [1.0.0-03]
- rebranding to Mitel Networks
* Tue Aug 21 2001 Charlie Brady <charlieb@e-smith.com>
- [1.0.0-02]
- Distinguish between empty file and no matching lines in output.
* Mon Aug 20 2001 Gordon Rowell <gordonr@e-smith.com>
- [1.0.0-01]
- Rolled version number to 1.0.0-01. Includes patches upto 0.0.1-05.
* Mon Aug 20 2001 Gordon Rowell <gordonr@e-smith.com>
- [0.0.1-05]
- Display name of logfile and patterns applied in output
* Mon Aug 20 2001 Gordon Rowell <gordonr@e-smith.com>
- [0.0.1-04]
- Disabled custom sort order - I find it non-intuitive
- Display "No lines displayed" if this is true
- Expanded text, describing filters in more depth
- Display filename of viewed log file
* Sat Aug 18 2001 Charlie Brady <charlieb@e-smith.com>
- [0.0.1-03]
- Introduce custom sort order, with messages at top and rotated logs at end.
- Add feature to display gzipped files.
* Fri Aug 17 2001 Charlie Brady <charlieb@e-smith.com>
- [0.0.1-02]
- Replace fixed log file list with one generated at run time
- Filter out known non-log files from the generated list
- Clean more of the environment (although I don't think it matters)
- Add brief text to explain the entry boxes
* Fri Aug 17 2001 Charlie Brady <charlieb@e-smith.com>
- [0.0.1-01]
- initial release
%description
Insert an e-smith-manager web panel to allow log files to be viewed.
%prep
%setup
mkdir -p root/etc/e-smith/events/e-smith-viewlogfiles-update
%build
perl createlinks
%install
rm -rf $RPM_BUILD_ROOT
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
rm -f %{name}-%{version}-%{release}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
> %{name}-%{version}-%{release}-filelist
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{name}-%{version}-%{release}-filelist
%defattr(-,root,root)

@ -0,0 +1,127 @@
<!-- vim: ft=xml ts=8 sw=4 noet:
-->
<lexicon lang="en-us">
<entry>
<base>View log files</base>
<trans>View log files</trans>
</entry>
<entry>
<base>FIRSTPAGE_DESC</base>
<trans>
<![CDATA[
This panel allows you to view or download the log files generated
by the services running on your server.
]]>
</trans>
</entry>
<entry>
<base>LOG_FILE_SELECT_DESC</base>
<trans>Choose a log file to view</trans>
</entry>
<entry>
<base>FILTER_PATTERN_DESC</base>
<trans>
<![CDATA[
<p>You may optionally specify a filter pattern to display only the
lines from the log file which match this pattern. If you leave
this field blank, all available lines of the log file will be
displayed. Note that this option is not used if you download the
logfile.</p>
]]>
</trans>
</entry>
<entry>
<base>FILTER_PATTERN_LABEL</base>
<trans>Filter Pattern (optional)</trans>
</entry>
<entry>
<base>MATCH_PATTERN_DESC</base>
<trans>
<![CDATA[
<p>You may also optionally specify a highlight pattern to mark in bold
any lines from the log file which match the highlight pattern. The
highlight pattern is applied to any lines which have already
matched the filter pattern. Note that this option is not used if
you download the logfile.</p>
]]>
</trans>
</entry>
<entry>
<base>MATCH_PATTERN_LABEL</base>
<trans>Highlight Pattern (optional)</trans>
</entry>
<entry>
<base>END_DESC</base>
<trans>
Please note that it may take quite some time to generate these
reports.
</trans>
</entry>
<entry>
<base>VIEW</base>
<trans>View log file</trans>
</entry>
<entry>
<base>LOG_FILE_EMPTY</base>
<trans>Log file "{$filename}" is empty!</trans>
</entry>
<entry>
<base>VIEWING_TIME</base>
<trans>Viewed at {$time}.</trans>
</entry>
<entry>
<base>MATCH_HEADER</base>
<trans>Displaying lines matching: "{$matchPattern}".</trans>
</entry>
<entry>
<base>HIGHLIGHT_HEADER</base>
<trans>Highlighting lines matching: "{$highlightPattern}".</trans>
</entry>
<entry>
<base>NO_MATCHING_LINES</base>
<trans>No matching lines displayed.</trans>
</entry>
<entry>
<base>FILENAME_ERROR</base>
<trans>
<![CDATA[
<p>Error while specifying log file name.</p>
<p>Invalid report type "{$filename}".</p>
]]>
</trans>
</entry>
<entry>
<base>REFRESH</base>
<trans>Refresh this logfile</trans>
</entry>
<entry>
<base>OP_DESC</base>
<trans><![CDATA[
<p>You must choose between viewing the logfile in your browser, or
downloading the logfile to your computer. If the logfile is
particularly large, you may wish to download it instead of
attempting to open it in your browser, as this is a problem for
some web browsers.</p>
]]>
</trans>
</entry>
<entry>
<base>OP_LABEL</base>
<trans>Operation</trans>
</entry>
<entry>
<base>DOWNLOAD_PAGE_DESC</base>
<trans><![CDATA[
<p>Your logfile download is now prepared. It will proceed as soon
as you click on the &quot;Next&quot; button below, and instruct
your browser to accept the download via the pop-up window that
will appear.</p>
]]>
</trans>
</entry>
<entry>
<base>DOWNLOAD_FILE</base>
<trans>Preparing to download the logfile {$logfile}.</trans>
</entry>
</lexicon>

@ -0,0 +1,477 @@
#! /usr/bin/perl -wT
#----------------------------------------------------------------------
# heading : Administration
# description : View log files
# navigation : 4000 4400
#
# $Id: viewlogfiles,v 1.31 2005/08/25 21:08:41 charlieb Exp $
#----------------------------------------------------------------------
# copyright (C) 1999-2007 Mitel Networks Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#----------------------------------------------------------------------
use strict;
use esmith::FormMagick;
use esmith::ConfigDB;
use esmith::cgi;
use Time::TAI64;
use File::Basename;
use HTML::Entities;
use CGI;
use constant TRUE => 1;
use constant FALSE => 0;
my $viewlogfiles = esmith::ConfigDB->open->get('viewlogfiles');
my $fm = esmith::FormMagick->new();
my $q = CGI->new();
# Save this operation preference for later.
my $operation = $q->param('operation');
$viewlogfiles->merge_props('DefaultOperation', $operation)
if $operation;
if ($operation and $operation eq 'download')
{
perform_download($fm, $q);
}
else
{
#$fm->debug(1);
$fm->display();
}
=pod
=head1 NAME
viewlogfiles -- An interface to system log files, allowing for pattern
filtering and highlighting.
=head2 DESCRIPTION
This screen allows the administrator to flexibly view various system log files.
=begin testing
use esmith::FormMagick::Tester;
use esmith::TestUtils;
use esmith::ConfigDB;
use esmith::AccountsDB;
my $panel = $Original_File;
my $ua = esmith::FormMagick::Tester->new();
my $c = esmith::ConfigDB->open();
my $a = esmith::AccountsDB->open();
is (mode($panel), '4755', "Check permissions on script");
ok ($ua->get_panel($panel), "ABOUT TO RUN L10N TESTS");
is ($ua->{status}, 200, "200 OK");
ok ($ua->set_language("en-us"), "Set language to English");
ok ($ua->get_panel($panel), "Get panel");
is ($ua->{status}, 200, "200 OK");
like($ua->{content}, qr/View log files/, "Saw translated form title");
# View the messages log:
$ua->field("filename" => "messages");
$ua->field(highlightPattern => "");
$ua->field(matchPattern => "");
ok ($ua->click("View log file"), "Click View log file");
is ($ua->{status}, 200, "200 OK");
like($ua->{content}, qr/Viewed at/, "Saw validation messages");
# View the messages log and filter all output:
ok ($ua->get_panel($panel), "Get panel");
$ua->field("filename" => "messages");
$ua->field(highlightPattern => "gibberish-gibberish");
$ua->field(matchPattern => "gibberish-gibberish");
ok ($ua->click("View log file"), "Click View log file");
is ($ua->{status}, 200, "200 OK");
like($ua->{content}, qr/No matching lines/, "Saw validation messages");
=end testing
=cut
#------------------------------------------------------------
# subroutine to display initial form
#------------------------------------------------------------
our %logfiles = ();
sub timestamp2local
{
$_ = shift;
if (/^(\@[0-9a-f]{24})(.*)/s)
{
return Time::TAI64::tai64nlocal($1) . $2;
}
elsif (/^([0-9]{10}\.[0-9]{3})(.*)/s)
{
return localtime($1) . $2;
}
return $_;
}
sub findlogFiles
{
my $fm = shift;
my $q = $fm->{cgi};
use File::Find;
sub findlogfiles
{
my $path = $File::Find::name;
if (-f)
{
# Remove leading /var/log/messages
$path =~ s:^/var/log/::;
# don't bother to collect files known to be non-text
# or not log files
foreach (qw(
lastlog
btmp$
wtmp
lock
(?<!qpsmtpd/)state
httpd/ssl_mutex.\d*
httpd/ssl_scache.pag
httpd/ssl_scache.dir
\/config$
))
{
return if $path =~ /$_/;
}
my ($file_base, $file_path, $file_type) = fileparse($path);
if ( $file_base =~ /@.*/ )
{
$logfiles{$path} = $file_path . timestamp2local($file_base);
}
else
{
$logfiles{$path} = $path;
}
}
}
# Now go and find all the files under /var/log
find({wanted => \&findlogfiles, no_chdir => 1}, '/var/log');
return \%logfiles;
}
#------------------------------------------------------------
# subroutine to perform actions and display result
#------------------------------------------------------------
sub performAndShowResult ($)
{
my $fm = shift;
my $q = $fm->{cgi};
#------------------------------------------------------------
# Verify the arguments and untaint the variables (see Camel
# book, "Detecting and laundering tainted data", pg. 358)
#------------------------------------------------------------
my $filename = $q->param ('filename');
if ($filename =~ /^([\S\s]+)$/)
{
$filename = $1;
}
elsif ($filename =~ /^$/)
{
$filename = "messages";
}
else
{
print $fm->localise("FILENAME_ERROR", { filename => "$filename" } );
return;
}
my $matchPattern = $q->param ('matchPattern');
if ($matchPattern =~ /^(\S+)$/)
{
$matchPattern = $1;
}
else
{
$matchPattern = ".";
}
my $highlightPattern = $q->param ('highlightPattern');
if ($highlightPattern =~ /^(\S+)$/)
{
$highlightPattern = $1;
}
else
{
$highlightPattern = '';
}
#------------------------------------------------------------
# Looks good; go ahead and generate the report.
#------------------------------------------------------------
my $fullpath = "/var/log/$filename";
if (-z $fullpath)
{
print $fm->localise("LOG_FILE_EMPTY", { filename => "$filename" } );
return;
}
print "$fullpath: \n";
print $fm->localise("VIEWING_TIME",
{ time => $fm->gen_locale_date_string() } );
unless ( $matchPattern eq '.' )
{
print "<p>\n";
print $fm->localise("MATCH_HEADER", { matchPattern => "$matchPattern" } );
}
if ( $highlightPattern )
{
print "<p>\n";
print $fm->localise("HIGHLIGHT_HEADER", { highlightPattern => "$highlightPattern" } );
}
if ($filename =~ /\.gz$/)
{
my $pid = open(LOGFILE, "-|");
die "Couldn't fork: $!" unless defined $pid;
unless ($pid)
{
# Child
exec("/bin/zcat", $fullpath)
|| die "Can't exec zcat: $!";
# NOTREACHED
}
}
else
{
open(LOGFILE, "$fullpath");
}
my $somethingMatched = 0;
my $fileEmpty = 1;
print "<PRE>";
while(<LOGFILE>)
{
$fileEmpty = 0;
next unless /$matchPattern/;
$somethingMatched = 1;
$_ = timestamp2local($_);
$_ = HTML::Entities::encode_entities($_);
($highlightPattern && /$highlightPattern/)
? print "<b>$_</b>"
: print;
}
print "</PRE>";
if ($fileEmpty)
{
print "<p>\n";
print $fm->localise("LOG_FILE_EMPTY");
}
else
{
unless ($somethingMatched)
{
print "<p>\n";
print $fm->localise("NO_MATCHING_LINES");
}
}
close LOGFILE;
print $q->table({-width => '100%'},
$q->Tr($q->th({-class => 'sme-layout'},
$q->a( { -href => "viewlogfiles?page=0&Next=viewLog" .
"&filename=$filename&matchPattern=$matchPattern" .
"&highlightPattern=$highlightPattern" .
"&operation=view",
-class => 'button-like'},
$fm->localise('REFRESH')))));
return;
}
sub print_viewlog_buttons
{
my $self = shift;
my $q = $self->{cgi};
my $filename = $q->param('filename');
my $matchPattern = $q->param('matchPattern');
my $highlightPattern = $q->param('highlightPattern');
print $q->table({-width => '100%'},
$q->Tr({-valign => 'center'},
$q->th({-class => 'sme-layout', -valign => 'center'},
$q->a( { -href => "viewlogfiles?page=0&Next=viewLog" .
"&filename=$filename&matchPattern=$matchPattern" .
"&highlightPattern=$highlightPattern" .
"&skip_header=1",
-class => 'button-like'},
$self->localise('DOWNLOAD')),
$q->submit( {-value => $self->localise('VIEW') } ))));
return undef;
}
sub perform_download
{
my $fm = shift;
my $q = shift;
my $filename = $q->param("filename");
my $fullpath = "/var/log/$filename";
# Save this information for later.
my $operation = $q->param('operation');
$viewlogfiles->merge_props('DefaultOperation', $operation);
# If the client is on windows, we must handle this a little differently.
my $win32 = FALSE;
my $mac = FALSE;
my $agent = $ENV{HTTP_USER_AGENT} || "";
if ($agent =~ /win32|windows/i)
{
$win32 = TRUE;
}
elsif ($agent =~ /mac/i)
{
$mac = TRUE;
}
# Check for errors first. Once we start sending the file it's too late to
# report them.
my $error = "";
unless (-f $fullpath)
{
$error = $fm->localise("ERR_NOEXIST_FILE");
}
local *FILE;
open(FILE, "<$fullpath")
or $error = $fm->localise("ERR_NOOPEN_FILE");
# Put other error checking here.
if ($error)
{
# FIXME: Add the header and footer template references here.
print <<"EOF";
Content-Type: text/html
$error
EOF
return undef;
}
# Fix the filename, as it might have a directory prefixed to it.
if ($filename =~ m#/#)
{
$filename = (split /\//, $filename)[-1];
}
# Otherwise, send the file. Start with the headers.
# Note: The Content-disposition must be attachment, or IE will view the
# file inline like it's told. It ignores the Content-type, but it likes
# the Content-disposition (an officially unsupported header) for some
# reason. Yay Microsoft.
print <<"EOF";
Expires: 0
Content-type: application/octet-stream
Content-disposition: attachment; filename=$filename
EOF
# And send the file.
my $nl = "\n";
if ($win32) { $nl = "\r\n" }
elsif ($mac) { $nl = "\r" }
while (my $line = <FILE>)
{
chomp $line;
print timestamp2local($line) . $nl;
}
close(FILE);
return undef;
}
sub show_operation_widget
{
my $self = shift;
my $q = $self->{cgi};
my $description = $self->localise('OP_DESC');
my $label = $self->localise('OP_LABEL');
my $defaultop = $viewlogfiles->prop('DefaultOperation');
my $select = '<select name="operation" size="1">' . "\n";
if ($defaultop eq 'view')
{
$select .= '<option value="view" selected>' .
$self->localise("VIEW") . '</option>' . "\n";
$select .= '<option value="download">' .
$self->localise("DOWNLOAD") . '</option>' . "\n";
}
else
{
$select .= '<option value="view">' .
$self->localise("VIEW") . '</option>' . "\n";
$select .= '<option value="download" selected>' .
$self->localise("DOWNLOAD") . '</option>' . "\n";
}
$select .= '</select>' . "\n";
print $q->Tr($q->td({-colspan => 2}, $description));
print $q->Tr($q->td({-class => 'sme-noborders-label'}, $label),
$q->td({-class => 'sme-noborders-content'}, $select));
return undef;
}
__DATA__
<form title="View log files" header="/etc/e-smith/web/common/head.tmpl" footer="/etc/e-smith/web/common/foot.tmpl">
<page name="Initial"
pre-event="print_status_message()">
<description>FIRSTPAGE_DESC</description>
<field type="select" id="filename" options="findlogFiles()"
value="messages">
<label>LOG_FILE_SELECT_DESC</label>
</field>
<field type="text" id="matchPattern">
<description>FILTER_PATTERN_DESC</description>
<label>FILTER_PATTERN_LABEL</label>
</field>
<field type="text" id="highlightPattern">
<description>MATCH_PATTERN_DESC</description>
<label>MATCH_PATTERN_LABEL</label>
</field>
<subroutine src="show_operation_widget()" />
<field type="literal">
<description>END_DESC</description>
</field>
<subroutine src="print_button('NEXT')" />
</page>
<page name="viewLog" pre-event="turn_off_buttons()">
<subroutine src="performAndShowResult()" />
</page>
</form>
Loading…
Cancel
Save