apt install monit
vi /etc/monit/conf-available/asterisk
check process asterisk with pidfile /var/run/asterisk.pid
group asterisk
start program = “/etc/init.d/asterisk start”
stop program = “/etc/init.d/asterisk stop”
if failed host 127.0.0.1 port 5038 then restart
if 8 restarts within 40 cycles then timeout
depend asterisk_bin
depend asterisk_rc
check file asterisk_bin with path /usr/sbin/asterisk
group asterisk
include /etc/monit/templates/rootbin
check file asterisk_rc with path /etc/init.d/asterisk
group asterisk
include /etc/monit/templates/rootbin
ln -s /etc/monit/conf-available/asterisk /etc/monit/conf-enabled/
systemctl restart monit
コメント