How Can I Set GWAVA to Restart Itself if Mail is not Flowing and Notify Me?

  • 7020458
  • 07-May-2014
  • 07-Aug-2017

Environment


GWAVA 6+
Using SMTP Scanner
Running on Linux

Situation

If there is a problem with GWAVA which make it so mail isn't flowing, is there a way for GWAVA to detect this, restart itself and notify me?

Resolution


If you are seeing a problem with GWAVA, the best thing to do is to contact support. If they are already aware of this issue and you are waiting for a fix from development, then you can run a script to have GWAVA restart itself when a module goes down or a specified port is unreachable. Do the following:

1) Using Winscp edit /opt/beginfinite/gwava/assets/scripts/appliance_chk.sh and make the following changes:
a) Change the recipient to the email address you would like to be notified when something is down, under:

# email info
SUBJECT="ALERT GWAVA problem detected"
RCPT="user4@domain.com"

b) Change the gwvsmtp bind IP address to your server's IP, here:

#gwvsmtp bind IP address
IP="10.1.1.109"

c) Remove two ports 49284 and 49286, as they are no longer used, from this section:

# Check if GWAVA bound correctly to the ports
for i in 49282 49283 49285 49287 25

d) Save and close the file.

2) Make sure the TCP/IP Bind address (listen address) is set to the actual server IP, rather then the default of 0.0.0.0. This setting is located in the GWAVA Management web page | server/interface management | server | manage interfaces | smtp interface name | interface settings | TCP/IP bind address (listen address).


Note: If you had to change the IP address GWVSMTP needs to be restarted. You can do that by typing from a prompt:

rcgwavaman stop gwvsmtp

then:

rcgwavaman start gwvsmtp

3) Set up a cronjob to run the script in Step 1, every 10 minutes by doing the following:

a) Edit /etc/crontab.

b) Add the following string to the bottom:

*/10 * * * * root /opt/beginifinite/gwava/assets/scripts/appliance_chk.sh > /dev/null 2>$1

Note: You can change the '10' to the desired number of minutes you would like this script to run.

c) Save and close the file.

Now every 10 minutes the GWAVA modules will be checked to ensure they are running and the ports needed are reachable.

Additional Information

This article was originally published in the GWAVA knowledgebase as article ID 2285.