– Kamailio SIP Server –

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
install:configure-initd-script [2006/12/19 10:51]
81.180.83.75
install:configure-initd-script [2007/01/29 01:00] (current)
Line 1: Line 1:
 +===== Make OpenSER init scipt working with monit =====
 +
 +Requires monit - a daemon monitoring tool
 +
 +Info: http://​www.tildeslash.com/​monit
 +
 +  cp <openser src>/​etc/​openser.init /​etc/​init.d/​openser
 +  chmod 755 /​etc/​init.d/​openser
 +  wget http://​www.tildeslash.com/​monit/​dist/​monit-4.8.2.tar.gz
 +  tar -zxvf monit-4.8.2.tar.gz
 +  cd monit-4.8.2
 +  ./configure
 +  make
 +  make install
 +  vi /​usr/​local/​etc/​monitrc
 +
 +This is about the most basic config you need to get monit with openser.init working.
 +<​code>​
 +###############################################################################​
 +## Global section
 +###############################################################################​
 +##
 +## Start monit in background (run as daemon) and check the services at 2-minute
 +## intervals. ​
 +#
 +set daemon ​ 120
 +## Set syslog logging with the '​daemon'​ facility. If the FACILITY option is
 +## omited, monit will use '​user'​ facility by default. You can specify the
 +## path to the file for monit native logging. ​
 +#
 +set logfile syslog facility log_daemon
 +#
 +## Monit has an embedded webserver, which can be used to view the
 +## configuration,​ actual services parameters or manage the services using the
 +## web interface.
 +#
 +set httpd port 2812 and use the address 127.0.0.1
 +      allow 127.0.0.1
 +###############################################################################​
 +## Services
 +############################################################################### ​
 +#
 +check process openser with pidfile /​var/​run/​openser.pid
 +   group openser
 +   start program = "/​etc/​init.d/​openser openserstart"​
 +   ​stop ​ program = "/​etc/​init.d/​openser openserstop"​
 +   if 2 restarts within 3 cycles then timeout
 +#
 +</​code>​
 +
 +Change permissions on monitrc
 +<​code>​
 +chmod 700 /​usr/​local/​etc/​monitrc
 +</​code>​
 +
 +Monit can run and be controlled from init. If monit should crash, init will re-spawn a new monit process.
 +To setup monit to run from init, you can use the 'set init' statement in monit'​s control file
 +
 +<​code>​
 +vi /​etc/​inittab
 +</​code>​
 +Add:
 +<​code>​
 +# Run monit in standard run-levels
 +mo:​2345:​respawn:/​usr/​local/​bin/​monit -Ic /​usr/​local/​etc/​monitrc
 +</​code>​
 +
 +restart inittab
 +<​code>  ​
 +telinit q
 +</​code>​
 +
 +At this point anytime 120 sec if /​var/​run/​openser.pid doesn'​t exist it will restart openser and if 2 restarts within 3 cycles then it will stop trying.
 +
 +This is Just scratching the surface of what monit can do. 
 +
 +The info in this document may not be the best but at least seems like a start!!!!
 +
 +===== Installation Stuff =====
 +
 +{{indexmenu>​install|js}}