Difference between revisions of "Asterisk keepalive script"
(Created page with '=Description= Keepalive script sends OPTIONS packets to Asterisk. If Asterisk does not respond to these packets, script consider that Asterisk is not functioning properly and ac…') |
|||
Line 4: | Line 4: | ||
=Installation= | =Installation= | ||
rm -fr /usr/src/mor && svn co http://svn.kolmisoft.com/mor/install_script/trunk/ | rm -fr /usr/src/mor && svn co http://svn.kolmisoft.com/mor/install_script/trunk/ /usr/src/mor | ||
/usr/src/mor/x14/helpers/asterisk_keep_alive/install.sh | /usr/src/mor/x14/helpers/asterisk_keep_alive/install.sh | ||
Revision as of 09:30, 27 March 2019
Description
Keepalive script sends OPTIONS packets to Asterisk. If Asterisk does not respond to these packets, script consider that Asterisk is not functioning properly and acts according to configuration (possible actions are restart asterisk, send email, generate core dump).
Installation
rm -fr /usr/src/mor && svn co http://svn.kolmisoft.com/mor/install_script/trunk/ /usr/src/mor /usr/src/mor/x14/helpers/asterisk_keep_alive/install.sh
After installation, keepalive script will be located here:
/usr/local/mor/asterisk_keep_alive.sh
New cron will be added, which will execute script every minute:
/etc/cron.d/asterisk_keep_alive
Configuration
By default keepalive script will restart asterisk if it does not respond to OPTION packets. You can change/enable additional actions in script itself. Open script /usr/local/mor/asterisk_keep_alive.sh and change options as documented in script.
# 1 - Restart Asterisk, 0 - do not restart Asterisk RESTART=1 # 1 - Generate core dump, 0 - do not generate core dump GENERATE_CORE_DUMP=0 # 0 - Send email notification, 0 - do not send email notification # Email is sent using MOR SMPT server details from MOR GUI (if exist) SEND_EMAIL=0 # Email address to send notification, taken into account only if SEND_EMAIL = 1 EMAIL_ADDRESS=""
Asterisk keepalive log is available here:
/var/log/mor/mor_asterisk_keep_alive.log
Log entries are written only if Asterisk does not respond to OPTIONS packets. No log entries will be generated if Asterisk works properly.