[COMMIT LOGREPORT] service/all/script lr_vendor_cron.in,1.11,1.12
Joost van Baal
vanbaal at users.sourceforge.net
Thu Sep 1 17:26:22 CEST 2005
Update of /cvsroot/logreport/service/all/script
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18692
Modified Files:
lr_vendor_cron.in
Log Message:
allow to pass extra options to lr_log2mail. useful for specifying customized report template
Index: lr_vendor_cron.in
===================================================================
RCS file: /cvsroot/logreport/service/all/script/lr_vendor_cron.in,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- lr_vendor_cron.in 3 Sep 2004 02:11:47 -0000 1.11
+++ lr_vendor_cron.in 1 Sep 2005 15:26:20 -0000 1.12
@@ -64,6 +64,7 @@
logfile=
filter=
rotateperiod=
+ extraopts=
. $f
@@ -103,8 +104,7 @@
# better use sudo, if available?
eval "$filter" < $logfile | \
su - $LIREUSER -c \
- "lr_log2mail -s '$rotateperiod $service report from $logfile' $service root" 2>&1 | \
- logger -p $PRIORITY -t lire
+ "lr_log2mail -s '$rotateperiod $service report from $logfile' $extraopts $service root" 2>&1 | logger -p $PRIORITY -t lire
done
exit 0
@@ -131,14 +131,36 @@
B<lr_vendor_cron> reads files /etc/sysconfig/lire.d/*.cfg and
/etc/default/lire.d/*.cfg. For each log file, such a file should exist. The
-files should set shell variables `service' (a Lire service, e.g. sendmail),
-`logfile' (e.g. /var/log/mail.log.1.gz), `filter' (e.g. 'gzip -dc' or 'zcat |
-grep sendmail'), and `rotateperiod' (one of the supported lr_vendor_cron
-arguments).
-
-It then invokes lr_log2mail(1) on the `filter'ed log file. Reading and
-filtering the log is done as root, lr_log2mail is run as user lire, using
-su(1). Output is fed to logger(1).
+files should set the following shell variables:
+
+=over 4
+
+=item service
+
+a Lire service, e.g. sendmail,
+
+=item logfile
+
+e.g. /var/log/mail.log.1.gz,
+
+=item filter
+
+e.g. 'gzip -dc' or 'zcat | grep sendmail', and
+
+=item rotateperiod
+
+one of the supported lr_vendor_cron arguments.
+
+=item extraopts
+
+optional: extra options passed to lr_log2mail(1). Set this to e.g. '--template
+www_local'.
+
+=back
+
+After parsing the configuration files, B<lr_vendor_cron> invokes lr_log2mail(1)
+on the `filter'ed log file. Reading and filtering the log is done as root,
+lr_log2mail is run as user lire, using su(1). Output is fed to logger(1).
=head1 SECURITY
@@ -164,6 +186,7 @@
=head1 COPYRIGHT
Copyright (C) 2002, 2003 Stichting LogReport Foundation LogReport at LogReport.org
+Copyright (C) 2005 Joost van Baal
This program is part of Lire.
--
To UNSUBSCRIBE, email to commit-request at logreport.org with a subject of
"unsubscribe". Trouble? Send an email with subject "help" to
commit-request at logreport.org
More information about the Commit
mailing list