getting firewall logs via /etc/periodic/daily ?

2010-01-16 Thread Anton Shterenlikht
I'd like to receive the firewall logs together
with the usual /etc/periodic/daily email.
What's the easiest/safest way to achieve this?

Shall I add my own script under /etc/periodic/daily?
Shall I modify an existing script, e.g. 310.accounting?

Please advise

many thanks

-- 
Anton Shterenlikht
Room 2.6, Queen's Building
Mech Eng Dept
Bristol University
University Walk, Bristol BS8 1TR, UK
Tel: +44 (0)117 331 5944
Fax: +44 (0)117 929 4423
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: getting firewall logs via /etc/periodic/daily ?

2010-01-16 Thread Matthew Seaman

Anton Shterenlikht wrote:

I'd like to receive the firewall logs together
with the usual /etc/periodic/daily email.
What's the easiest/safest way to achieve this?

Shall I add my own script under /etc/periodic/daily?
Shall I modify an existing script, e.g. 310.accounting?


Sure -- you can add your own scripts to the periodic jobs.  For things that
aren't part of the base system, the usual place is 
/usr/local/etc/periodic/{daily,weekly,monthly,security}


If you decide to adapt one of the system scripts to do what you want, it's
best to copy it to /usr/local/periodic/whatever/ and change the prefix of the
configuration variables inside it.  When writing a periodic script, you
generally want the following boilerplate at the top of the file:

# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]
then
   . /etc/defaults/periodic.conf
   source_periodic_confs
fi

plus you should take care to set the return code of the script carefully:
0 means 'everything OK', 1 means 'you might want to look at this output',
2 means 'oops, you configured the script wrong' and 2 means 'it's all gone
a bit pear shaped'.  periodic(8) has more detail.

Cheers,

	Matthew 


--
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
 Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
 Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature