Developers Documentation

×

Warning

0 error for file:https://clearos.com/dokuwiki2/lib/exe/css.php?t=dokuwiki&tseed=82873f9c9a1f5784b951644363f20ef8

User Tools

Site Tools


Setup Notification on MultiWAN State Changes

This guide will help you set up notification when your MultiWAN changes state and the number of interfaces in play. Please note that this is an internal process and at least 1 interface needs to remain operational for the system to be able to send the notification. If you want external notification, you should consider using the SDN to monitor services on your box using the System Monitor Service.

Prerequisites

This Howto requires that you are using MultiWAN on your system. In addition, you will need to have the local SMTP server running and working.

Install and test mutt

This method uses the 'mutt' command to send email to the local email server running on the box running MultiWAN. To install 'mutt', open a command prompt and run the following:

yum --enablerepo=clearos-core install mutt

Next, test 'mutt' by running the following (replacing the email address with your own):

echo "This is a test attachment" > /tmp/testmessage1.txt
echo "Testing mutt" | /usr/bin/mutt youraddress@example.com -a /tmp/testmessage1.txt -s "Test Message"
rm -rf /tmp/testmessage1.txt

You should get your test email. If this doesn't work, troubleshoot your email server and the 'mutt' command before proceeding.

Notifications

MultiWAN already has a facility for processing a script when a change in status even occurs. We will implement a script to do this. First, ensure that you don't already have one in place:

cat /usr/sbin/syswatch.local

This should return:

cat: /usr/sbin/syswatch.local: No such file or directory

Next, create the file and make it executable:

touch /usr/sbin/syswatch.local
chmod 700 /usr/sbin/syswatch.local

Now modify the file with the following (using your favorite editor like vi or nano):

#!/bin/bash
email=youraddress@example.com
/bin/grep "changing active WAN list" /var/log/syswatch | /usr/bin/tail -n 1 | /usr/bin/mutt $email -a /var/log/syswatch -s "MultiWAN active interfaces CHANGED `/bin/date`"
content/en_us/kb_o_setup_notification_on_multiwan_state_changes.txt · Last modified: 2016/07/20 09:09 by dloper

https://clearos.com/dokuwiki2/lib/exe/indexer.php?id=content%3Aen_us%3Akb_o_setup_notification_on_multiwan_state_changes&1569157340