<div dir="ltr">Just counting how many is probably a good solution and very very simple.<div><br></div><div>Thanks =)</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 20, 2017 at 7:00 AM, Carlos Oliva <span dir="ltr"><<a href="mailto:carlos.oliva@numintec.com" target="_blank">carlos.oliva@numintec.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi Daniel!<br><br></div>I made a little php script for Nagios some years ago that may help you.<br><br></div>It is intented to use on opensips machine (where media dispatcher is running)<br><br></div>You pass as argument the number of mediaproxy relay machines you expected to have and it returnks Ok and the list of your relays or error if the number of relays is not what you expect.<br><br></div>It's very simple but works well, we've been using it for years. This is the script:<br><br><br>#!/usr/bin/php<br><?php<br>$errno="";<br>$errstr="";<br>$fp=fsockopen('127.0.0.1','<wbr>25061',$errno,$errstr,'2');<br>fputs($fp, "summary\r\n");<br>$line  = fgets($fp);<br>fclose($fp);<br>$decoded=json_decode($line);<br>$num_relays=0;<br>$str_salida="";<br>foreach($decoded as $relay)<br>{<br>        if($relay->status=="active")<br>        {<br>                $num_relays++;<br>                $str_salida.=" ".$relay->ip;<br>        }<br>}<br>if($num_relays==$argv[1])<br>{<br>        echo "OK IPs de Relays RTP: ".$str_salida."\n";<br>        exit(0);<br>}<br>else<br>{<br>        echo "ERROR faltan Relays. IPs de Relays RTP: ".$str_salida."\n";<br>        exit(2);<br>}<br><br>?><br><br></div>Best regards,<br><br></div>Carlos Oliva<div><div class="h5"><br><div><div><br><div class="gmail_extra"><br clear="all"><div><div class="m_765144469892497897gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">    <br></div><table width="1" height="7" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td width="1%" valign="top"> </td><td width="33%" valign="top" align="center"><br><br>            </td><td width="2%" valign="top" align="left"><br></td><td width="71%" valign="top"><br></td></tr></tbody></table></div></div></div></div></div></div><br><div class="gmail_quote">2017-03-17 18:57 GMT+01:00 Daniel Zanutti <span dir="ltr"><<a href="mailto:daniel.zanutti@gmail.com" target="_blank">daniel.zanutti@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Understood.<div><br></div><div>Thanks for explanation.</div><div><br></div><div>Regards</div></div><div class="m_765144469892497897gmail-HOEnZb"><div class="m_765144469892497897gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 17, 2017 at 2:47 PM, Dan Pascu <span dir="ltr"><<a href="mailto:dan@ag-projects.com" target="_blank">dan@ag-projects.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span><br>
On 16 Mar 2017, at 15:58, Daniel Zanutti wrote:<br>
<br>
> Hi Dan<br>
><br>
> This is exactly how I'm monitoring but looking to the dispatcher it's kind hard on a Nagios like system, because I'm monitoring Relay A, B and C, but the status will be on dispatcher machine D. But ok, if it's the only way.<br>
<br>
</span>The relay doesn't listen for network connections, you cannot connect directly to a relay. A relay will only connect to all configured dispatchers. The dispatcher on the other hand has a control port where you can connect and give commands, including fetching statistics from relays over the connections the relay already established with the dispatcher.<br>
<div class="m_765144469892497897gmail-m_1159606159421859472HOEnZb"><div class="m_765144469892497897gmail-m_1159606159421859472h5"><br>
--<br>
Dan<br>
<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div></div></div></div></div></div>
<br>______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>