Changes

From Amahi Wiki
Jump to: navigation, search
no edit summary
This will provide the capability to receive system logs via e-mail. There are many customizable features , but this will only identify the basic ones.
REF'''NOTE:''' You need to have email capability set up on your server. One way is using your [http://wiki.amahi.org/index.php/Gmail_As_Relay_On_Ubuntu Gmail account]. Reference: [https://help.ubuntu.com/community/Logwatch LogwatchTutorial]
* First, open a terminal window and become '''root'''. Enter the following to install:
<blockquote>{{Code|<pre>sudo apt-get install logwatch}}</pre></blockquote>
* There are some additional steps needed for Ubuntu to work correctly:
<blockquote>{{Code|<pre>sudo mkdir /var/cache/logwatchsudo cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/}}</pre></blockquote>
* You can customize the settings by adding options to '''''/etc/logwatch/conf/logwatch.conf'''''. If you want the log in email vs screen output, change this line read:
<blockquote>{{Text|<pre>Output <nowiki>=</nowiki> mail}}</pre></blockquote>
* By default it sends the daily logwatch email to the local root mail box. To change it, edit this line (change user@yourisp.com to desired email address) to read:
<blockquote>{{Text|<pre>MailTo <nowiki>=</nowiki> user@yourisp.com}}</pre></blockquote>
* If you want the email in html vs text, change this line to read:
<blockquote>{{Text|<pre>Format <nowiki>=</nowiki> html}}</pre></blockquote>
* To test, enter the command '''''logwatch''''' and go check your email.
<blockquote>{{Code|<pre>sudo logwatch}}</pre></blockquote>
* Ensure sendmail or postfix is running (rerun command and change '''''status''''' to '''''start''''' if not):
<blockquote>{{Code|<pre>service sendmail status}}</pre>
or
{{Code|<pre>service postfix status}}</pre></blockquote>
'''Optional:'''
12,424

edits