Thursday, February 23, 2012

Configuring Alerts and Notifications

There are several ways get your mail alerts to work:

  • Install and configure the MTA like Sendmail, Postfix, QMail or Exim;
  • Install and configure SSMTP instead of standard MTA;
After you are done with this you can use mail command to send email:
[root@system ~]# echo "This is a test mail" | mail -s "Test mail" <reciever-email>
 

Alerting by Email

It is often useful to be notified by E-mail when a specific event occurs with VPN tunnel especially for Site-to-Site VPN tunnel.

Logon into the vpnttgdb database:

[root@system ~]# export PGPASSWORD=vpnttgpass
[root@system ~]# psql vpnttgdb -h 127.0.0.1 -U vpnttg
psql (8.4.4)
Type "help" for help.

vpnttgdb=#
Activate E-mail alert:
vpnttgdb=# UPDATE lantolanpeers SET email = '<email>' WHERE peerid = '<peerid>';
UPDATE 1
vpnttgdb=#
Deactivate E-mail alert:
vpnttgdb=# UPDATE lantolanpeers SET email = NULL WHERE peerid = '<peerid>';
UPDATE 1
vpnttgdb=#
Logout from the vpnttgdb database:
vpnttgdb=# \q