[Asterisk-Users] example Monit control file

Brancaleoni Matteo mbrancaleoni at espia.it
Thu Nov 4 23:51:43 MST 2004


Hi,

Il ven, 2004-11-05 alle 05:44, David Harris ha scritto:
> Can someone who is using monit to monitor asterisk post an example control
> file ?

something like:

check process asterisk with pidfile /var/run/asterisk.pid
   start program = "/etc/init.d/asterisk start"
   stop  program = "/etc/init.d/asterisk stop"
   if 5 restarts within 5 cycles then timeout
   alert hostmaster at mydomainhidden.it

you can also like a tcp monitor, if you want, like:

check process asterisk with pidfile /var/run/asterisk.pid
   start program = "/etc/init.d/asterisk start"
   stop  program = "/etc/init.d/asterisk stop"
   if failed port 5038 then restart
   if 5 restarts within 5 cycles then timeout
   alert hostmaster at mydomainhidden.it

the general section of monit can be:

set daemon  60           # Poll at 1-minute intervals
set logfile syslog facility log_daemon 
set mailserver localhost
set mail-format           
  { from: monit-do-not-reply at mymonitoredhost.it }  
set httpd port 2828 and   
     allow administrator:somepasswordhere     

and on inittab file:
# monit
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc

so spawning from init make you sure that monit never dies.

Also you will want to add checks for other services,
I currently use it to monitor also apache, mysql,
crond, sendmail, etc etc ect

matteo.
-- 
Brancaleoni Matteo <mbrancaleoni at espia.it>
Espia Srl




More information about the asterisk-users mailing list