<HTML><HEAD>
<META content="text/html; charset=iso-8859-15" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16625"></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Segoe UI">
<DIV>Hi, </DIV>
<DIV>Please help me , <SPAN id=result_box class=short_text><SPAN title="">I'm in big trouble</SPAN></SPAN></DIV>
<DIV> </DIV>
<DIV>I must create a opensips HA cluster,</DIV>
<DIV>I use debian and heartbeat with pacemaker,(I use this guide : <A href="http://anders.com/cms/259">http://anders.com/cms/259</A> ) but there is a problem , Opensips_status not function with sipsak.</DIV>
<DIV>I have modify a Opensips_status with another type of check( i see this mail list),</DIV>
<DIV> </DIV>
<DIV>The switch from primary to secondary is ok and vice versa, but if the secondary lose connection, when the primary is up , the secondary cannot start opensips service, </DIV>
<DIV> </DIV>
<DIV>Note: Primary ---> cludeb1 --->10.100.100.146</DIV>
<DIV> Secondary--->cludeb2---->10.100.100.147</DIV>
<DIV> Virtual Ip --->10.100.100.151</DIV>
<DIV> Gateway ----> 10.100.100.251</DIV>
<DIV> </DIV>
<DIV>Thanks</DIV>
<DIV> </DIV>
<DIV>below my cib.xml</DIV>
<DIV><BR><cib validate-with="pacemaker-1.0" crm_feature_set="3.0.1" have-quorum="1" admin_epoch="0" epoch="173" dc-uuid="3525d964-57a0-4355-ad19-14261c5071ba" num_updates="0" cib-last-written="Tue Sep 28 10:11:30 2010"><BR> <configuration><BR> <crm_config><BR> <cluster_property_set id="cib-bootstrap-options"><BR> <nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="1.0.9-74392a28b7f31d7ddc86689598bd23114f58978b"/><BR> <nvpair id="cib-bootstrap-options-cluster-infrastructure" name="cluster-infrastructure" value="Heartbeat"/><BR> <nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="false"/><BR> <nvpair id="cib-bootstrap-options-stonith-enable" name="stonith-enable" value="false"/><BR> <nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="ignore"/><BR> </cluster_property_set><BR> </crm_config><BR> <nodes><BR> <node id="14e57269-7187-42da-8a09-05923520586b" type="normal" uname="cludeb1"/><BR> <node id="3525d964-57a0-4355-ad19-14261c5071ba" type="normal" uname="cludeb2"/><BR> </nodes><BR> <resources><BR> <group id="cluster"><BR> <primitive class="ocf" id="cluster-ip" provider="heartbeat" type="IPaddr2"><BR> <instance_attributes id="cluster-ip-instance_attributes"><BR> <nvpair id="cluster-ip-instance_attributes-ip" name="ip" value="10.100.100.151"/><BR> <nvpair id="cluster-ip-instance_attributes-nic" name="nic" value="eth0"/><BR> </instance_attributes><BR> <operations><BR> <op id="cluster-ip-monitor-10s" interval="10s" name="monitor" timeout="20s"/><BR> <op id="cluster-ip-start-0" interval="0" name="start" timeout="20s"/><BR> <op id="cluster-ip-stop-0" interval="0" name="stop" timeout="20s"/><BR> </operations><BR> </primitive><BR> <primitive class="ocf" id="opensips" provider="opensips" type="opensips"><BR> <operations><BR> <op id="opensips-start-0" interval="0" name="start" timeout="30s"/><BR> <op id="opensips-stop-0" interval="0" name="stop" timeout="30s"/><BR> <op id="opensips-monitor-10s" interval="10s" name="monitor" timeout="30s"><BR> <instance_attributes id="opensips-monitor-10s-instance_attributes"><BR> <nvpair id="opensips-monitor-10s-instance_attributes-ip" name="ip" value="127.0.0.1"/><BR> </instance_attributes><BR> </op><BR> </operations><BR> <meta_attributes id="opensips-meta_attributes"><BR> <nvpair id="opensips-meta_attributes-target-role" name="target-role" value="Started"/><BR> </meta_attributes><BR> </primitive><BR> </group><BR> <clone id="ping_clone"><BR> <meta_attributes id="ping_clone-meta_attributes"><BR> <nvpair id="ping_clone-meta_attributes-globally-unique" name="globally-unique" value="false"/><BR> </meta_attributes><BR> <primitive class="ocf" id="ping" provider="pacemaker" type="ping"><BR> <instance_attributes id="ping-instance_attributes"><BR> <nvpair id="ping-instance_attributes-host_list" name="host_list" value="10.100.100.251"/><BR> <nvpair id="ping-instance_attributes-name" name="name" value="ping"/><BR> </instance_attributes><BR> <operations><BR> <op id="ping-monitor-10s" interval="10s" name="monitor" timeout="60s"/><BR> <op id="ping-start-0" interval="0" name="start" timeout="60s"/><BR> <op id="ping-stop-0" interval="0" name="stop" timeout="60s"/><BR> </operations><BR> </primitive><BR> </clone><BR> </resources><BR> <constraints><BR> <rsc_location id="cluster_resource2" rsc="cluster"><BR> <rule id="cluster_resource2-rule" score="100"><BR> <expression attribute="#uname" id="cluster_resource2-expression" operation="eq" value="cludeb1"/><BR> </rule><BR> </rsc_location><BR> <rsc_location id="cluster_resource" rsc="cluster"><BR> <rule id="cluster_resource-rule" score="50"><BR> <expression attribute="#uname" id="cluster_resource-expression" operation="eq" value="cludeb2"/><BR> </rule><BR> </rsc_location><BR> <rsc_location id="cluster_on_connected_node" rsc="cluster"><BR> <rule boolean-op="or" id="cluster_on_connected_node-rule" score="-INFINITY"><BR> <expression attribute="ping" id="cluster_on_connected_node-expression" operation="not_defined"/><BR> <expression attribute="ping" id="cluster_on_connected_node-expression-0" operation="lte" value="0"/><BR> </rule><BR> </rsc_location><BR> </constraints><BR> <rsc_defaults/><BR> <op_defaults/><BR> </configuration><BR></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Opensips OCF File:</DIV>
<DIV> </DIV>
<DIV>#!/bin/sh</DIV>
<DIV> </DIV>
<DIV># Initialization:</DIV>
<DIV> </DIV>
<DIV>#. ${OCF_ROOT}/usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs<BR>. /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs</DIV>
<DIV> </DIV>
<DIV>usage() {<BR>cat <<-!<BR>usage: $0 {start|stop|status|monitor|meta-data|validate-all}<BR>!<BR>}</DIV>
<DIV> </DIV>
<DIV>meta_data() {<BR>cat <<END<BR><?xml version="1.0"?><BR><!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd"><BR><resource-agent name="OpenSIPS"><BR><version>1.0</version></DIV>
<DIV> </DIV>
<DIV><longdesc lang="en"><BR>Resource Agent for the OpenSIPS SIP Proxy.<BR></longdesc><BR><shortdesc lang="en">OpenSIPS resource agent</shortdesc></DIV>
<DIV> </DIV>
<DIV><parameters><BR><parameter name="ip" unique="0" required="1"><BR><longdesc lang="en"><BR>IP Address of the OpenSIPS Instance. This is only used for monitoring.<BR></longdesc><BR><shortdesc lang="en">IP Address</shortdesc><BR><content type="string" default="" /><BR></parameter></DIV>
<DIV> </DIV>
<DIV><parameter name="port" unique="0" required="1"><BR><longdesc lang="en"><BR>Port of the OpenSIPS Instance. This is only used for monitoring.<BR></longdesc><BR><shortdesc lang="en">Port</shortdesc><BR><content type="string" default="5060" /><BR></parameter><BR></parameters></DIV>
<DIV> </DIV>
<DIV><actions><BR><action name="start" timeout="30" /><BR><action name="stop" timeout="30" /><BR><action name="status" depth="0" timeout="30" interval="10" start-delay="30" /><BR><action name="monitor" depth="0" timeout="30" interval="10" start-delay="30" /><BR><action name="meta-data" timeout="5" /><BR><action name="validate-all" timeout="5" /><BR><action name="notify" timeout="5" /><BR><action name="promote" timeout="5" /><BR><action name="demote" timeout="5" /><BR></actions><BR></resource-agent><BR>END<BR>}</DIV>
<DIV> </DIV>
<DIV>OpenSIPS_Status() {</DIV>
<DIV> </DIV>
<DIV>#/etc/init.d/opensips status > /dev/null<BR>#rc=$?<BR>#if<BR>#[ $rc -ne 0 ]<BR>#then<BR>#return $OCF_NOT_RUNNING<BR>#else<BR>#/etc/init.d/opensips reload<BR>#return $OCF_SUCCESS<BR>#fi</DIV>
<DIV> </DIV>
<DIV>ipaddr2=10.100.100.151<BR> </DIV>
<DIV> </DIV>
<DIV>if [ "$OCF_RESKEY_ip" = "$ipaddr2" ]; then<BR> check=(`netstat -tapn | grep opensips | cut -d" " -f16 | cut -d":" -f1 <BR>| tr "\n" " "`)<BR> <BR> <BR> if [ ${check[0]} = $ipaddr2 -o ${check[1]} = $ipaddr2 ]; then<BR> /etc/init.d/opensips status > /dev/null<BR> rc=$?<BR> if [ $rc -ne 0 ]; then<BR> return $OCF_NOT_RUNNING<BR> else<BR> return $OCF_SUCCESS<BR> fi</DIV>
<DIV> </DIV>
<DIV> else<BR> /etc/init.d/opensips restart<BR> return $OCF_SUCCESS<BR> fi<BR>else<BR> <BR> /etc/init.d/opensips status > /dev/null<BR> rc=$?<BR> if [ $rc -ne 0 ]; then<BR> return $OCF_NOT_RUNNING<BR> else<BR> return $OCF_SUCCESS<BR> fi<BR>fi</DIV>
<DIV> </DIV>
<DIV><BR>}</DIV>
<DIV> </DIV>
<DIV>OpenSIPS_Monitor() {<BR> <BR> OpenSIPS_Status<BR>}</DIV>
<DIV> </DIV>
<DIV>OpenSIPS_Start() {</DIV>
<DIV> </DIV>
<DIV><BR> if OpenSIPS_Status ; then<BR> return $OCF_SUCCESS<BR> else<BR> /etc/init.d/opensips start > /dev/null<BR> rc=$?<BR> if [ $rc -ne 0 ]; then<BR> return $OCF_ERR_PERM<BR> else<BR> return $OCF_SUCCESS<BR> fi<BR> fi<BR>}</DIV>
<DIV> </DIV>
<DIV>OpenSIPS_Stop() {</DIV>
<DIV> </DIV>
<DIV> /etc/init.d/opensips stop > /dev/null<BR> return $OCF_SUCCESS<BR>}</DIV>
<DIV> </DIV>
<DIV>OpenSIPS_Validate_All() {</DIV>
<DIV> </DIV>
<DIV> return $OCF_SUCCESS<BR>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>if [ $# -ne 1 ]; then<BR> usage<BR> exit $OCF_ERR_ARGS<BR>fi</DIV>
<DIV> </DIV>
<DIV>case $1 in<BR> meta-data) meta_data<BR> exit $OCF_SUCCESS<BR>;;<BR> start) OpenSIPS_Start<BR>;;<BR> stop) OpenSIPS_Stop<BR>;;<BR> monitor) OpenSIPS_Monitor<BR>;;<BR> status) OpenSIPS_Status<BR>;;<BR> validate-all) OpenSIPS_Validate_All<BR>;;<BR> notify) exit $OCF_SUCCESS<BR>;;<BR> promote) exit $OCF_SUCCESS<BR>;;<BR> demote) exit $OCF_SUCCESS<BR>;;<BR> usage) usage<BR> exit $OCF_SUCCESS<BR>;;<BR> *) usage<BR> exit $OCF_ERR_ARGS<BR>;;<BR>esac</DIV>
<DIV> </DIV>
<DIV>exit $?</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thanks </DIV>
<DIV>Grazie</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>-------------------------<BR>Giuseppe De Vivo <BR>Divisione Sistemi</DIV>
<DIV> </DIV>
<DIV>GRUPPOMEGA S.P.A.<BR>Partner: <BR>CISCO, ISS, NOVELL, STONEVOICE, CITRIX</DIV>
<DIV> </DIV>
<DIV>S.S.114 Contrada Biggemi <BR>96010 Priolo Gargallo (SR) - Italy</DIV>
<DIV> </DIV>
<DIV>+39 347 9623589 | Mobile<BR>+39 0931 774953 | Office<BR>+39 0931 412770 | Fax<BR><A href="mailto:gdevivo@gruppomega.it">gdevivo@gruppomega.it</A> </DIV>
<DIV> </DIV>
<DIV><A href="http://www.gruppomega.it">http://www.gruppomega.it</A>| Web<BR>-------------------------<BR></DIV></BODY></HTML>