[OpenSIPS-Users] Monit error under OpenSIPS 1.6.3 and Opensips-cp 4

Deon Vermeulen vermeulen.deon at gmail.com
Wed Sep 8 10:41:36 CEST 2010


Hi Everyone

I've successfully installed Opensips-cp 4 and got the Statistics  
monitoring to work, but I'm unable to get Monit to work.

I've been all over google and tested recommendations, but with no luck.

This is the procedure I followed to install Monit:

Step 1: Install Monit:
apt-get install monit

Step 2: Once installed, you'll find the main configuration file.
vi /etc/monit/monitrc
set daemon  120
set logfile syslog facility log_daemon
set alert root at localhost
set httpd port 2812 and
use address yourdomain.com
allow localhost       	# allow localhost to connect to the server and
allow youripaddress    # allow 192.168.1.2 to connect to the server,    
###(What IP should this be? The IP of the this Box or where I am  
connecting from?)
                       			# You can give only one per entry
allow admin:monit        # user name and password for authentication.   
###(I guess the Username and Password will be admin:admin if my login  
to Opensips-cp ios admin:admin)
check process opensips with pidfile /var/run/opensips.pid

###(For Some Reason this does not work. Had to comment all).
#Below is actions taken by monit when service got stuck.
start program = "/etc/init.d/opensips start"
stop program  = "/etc/init.d/opensips stop"
# Admin will notify by mail if below of the condition satisfied.
if cpu is greater than 70% for 2 cycles then alert
if cpu > 90% for 5 cycles then restart

Step 3: After modifying the configuration file, you should check for  
the syntax to
make sure that everything is correct. To do this, run:
# monit -t   (When I run this I get syntax OK)

Step 4: Edit the /etc/default/monit file and change the parameters as  
follows:
# You must set this variable to for 1 monit to start
startup=1
# To change the intervals which monit should run uncomment
# and change this variable.
# CHECK_INTERVALS=180


Configuring OpenSIPS Control Panel

Step 1: Configure the database access parameters. Edit the db.inc.php  
file, which is
valid for all modules. You may change the database parameters for a  
single module
inside the module configuration section.
For example:
cd /var/www/opensips-cp/config
vi db.inc.php
//database host
$config->db_host = "localhost";
//database port - leave empty for default
$config->db_port = "";
//database connection user
$config->db_user = "root";
//database connection password
$config->db_pass = "opensips";
//database name
$config->db_name = "opensips";
if ($config->db_port != "")$config->db_host=$config->db_host":"
$config->db_port;

Step 2: Configure the FIFO access in the boxes.global.inc.php file:
cd /var/www/opensips-cp/config/
vi boxes.global.inc.php
$box_id=0;
// mi host:port pair || fifo_file
$boxes[$box_id]['mi']['conn']="127.0.0.1:8000";  # (I added this line,  
as per recommendation I found searching Google).
$boxes[$box_id]['mi']['conn']="/tmp/opensips_fifo";
// monit host:port
$boxes[$box_id]['monit']['conn']="127.0.0.1:2812";
$boxes[$box_id]['monit']['user']="admin";
$boxes[$box_id]['monit']['pass']="monit";
$boxes[$box_id]['monit']['has_ssl']=0;
// description (appears in mi , monit )
$boxes[$box_id]['desc']="primary SIP server";
$boxes[$box_id]['assoc_id']=1;
// enable local smonitor charts on this box : 0=disabled 1=enabled
// (cron)
$boxes[$box_id]['smonitor']['charts']=1;


I added modparam("mi_fifo", "fifo_mode", 0666) to /etc/opensips/ 
opensips.cfg


Restart apache



This i what I did to get Statistics Monitor working:
Setup Smonitor Tables
1. Copy tables.mysql

cp /var/www/opensips-cp/config/tools/system/smonitor/tables.mysql /var/ 
www/opensips-cp/web/tools/system/smonitor/tables.mysql

mysql -p opensips < tables.mysql


Thanks in advance for the help.

Regards
Deon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100908/37e5eda5/attachment-0001.htm 


More information about the Users mailing list