Simplicity is the ultimate sophistication

Time is a tangled web. Try not to dwell on all the loose ends..

Recieve Eamil Which Sent From the Raspberry Pi (Gmail)

Recieve eamil which sent from the Raspberry Pi (gmail)

Sometimes we just building a test machine, and run some simple jobs there. But some time after, the machine already responsible to delicated tasks, and we need to do the system monitoring on there.

What we can do? I think the first thing is install the logwatch, this will bring the system information to you everyday.

Here is how to install the logwatch.

And then, we need to bring the information to email box, following is the good reference to setup gmail as the mailbox.

exim4 installation

If got following Error Message when install exim4:

ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken

Try following command first:

sudo rm /var/log/exim4/paniclog
sudo /etc/init.d/exim4 restart

If still not work, maybe you can diable the IPv6 and try again:

sudo nano /etc/sysctl.conf

And add following at the end

# Disable IPv6
net.ipv6.conf.all.disable_ipv6 = 1

Then reboot the system, rm and check it again.

If still seeing the error message, check the exim4 log file:

cat /var/log/exim4/mainlog

if there has IPv6 socket creation failed: Address family not supported by protocol, we can change dc_local_interfaces='127.0.0.1 ; ::1' on sudo nano /etc/exim4/update-exim4.conf.conf to be dc_local_interfaces='127.0.0.1'.

and then sudo rm /var/log/exim4/paniclog and restart the service. suppose the error message gone, and now we can test the logwatch now, sudo /usr/sbin/logwatch, check the maile when the command done.