Bering-uClibc 4.x - User Guide - Basic Configuration - Email Alerts
|Basic Configuration - Email Alerts|
|Prev||Bering-uClibc 4.x - User Guide||Next|
Bering-uClibc 4.x includes some basic functionality for checking system status and sending email alerts to an Administrator if something needs attention. The standard checks include:
- Low free space on a disk partition.
- Ping failure for one of a defined list of hosts.
This functionality relies on BusyBox sendmail (installed as
/usr/sbin/sendmail) which is very much cut-down compared to "normal" sendmail and is effectively just a simple mail client rather than a full Mail Transfer Agent (MTA).
It is necessary to configure the mail client to connect directly to an SMTP server running elsewhere on the network.
Note that BusyBox sendmail has different command-line arguments from standard sendmail.
Much of the complexity of configuring email alerts is driven by the demands of the SMTP server selected, in particular whether it demands Authentication.
The configuration described below assumes a mail server running on the Internal network.
If Shorewall is running, the sending of email from the firewall itself will not be permitted by the default firewall rules so a new entry needs to be added to
/etc/shorewall/rules - something like the following:
# Allow SMTP traffic from firewall to internal zone mail server SMTP(ACCEPT) fw loc
It is best to check the connection with the selected mail server manually before configuring automatic alerts. Run the following command as a test, substituting my_mailserver (hostname or IP address) and my_administrator_email_address (email address) with correct values for your site:
sendmail -S my_mailserver -f root@firewall my_administrator_email_address
then enter one or more lines of email text, terminating with ^D.
In the event of problems, add the "-v" argument for verbose output to aid debugging.
Configuration of the email alerts is controlled via file
Either edit this file directly or, if using the LEAF configuration menu, select option "2) System configuration" then option "1) Master LRP settings".
Configuration variable lrp_MAIL_ADMIN is used to specify the email address to which email alerts should be sent. If this variable is not set no alerts are sent.
Refer to the comments in
/etc/lrp.conf for further details.
The script which does the work of actually running the checks and sending email alerts is
/etc/multicron-p which is run every 15 minutes (by default) according to the settings in file
Review the code and comments in
/etc/multicron-p for further details.
A good way to test that everything is working is to specify an "invalid" IP address as the value for variable lrp_PING_HOSTS - i.e. an IP address which is not currently assigned to a running host. Note however that this will keep trying for (by default) 3 minutes before concluding that the target host is indeed not responding.
If that doesn't work then try running script
/etc/multicron-p manually, from the command line.