[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sr-users
Subject:    Re: [SR-Users] Trunk Utilization graphing using MI COMMANDS
From:       phillman25 <phillman25 () gmail ! com>
Date:       2012-08-28 11:26:38
Message-ID: CAEprJzLX=FUh1pR7NMbguFf6drrBsfGWeyFdGWA72BAdh-hqhA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Daniel

Sure i will prepare something and let you know.

Just brief info:
For current number of dialogs i used SNMPSTATS module on Kamailio, and use
snmpget function from a remote server (CACTI) to poll data i.e.

snmpget -v2c -c public xx.xx.xx.xx .1.3.6.1.4.1.34352.3.1.3.1.3.2.2.0 | cut
-b58-65

where .1.3.6.1.4.1.34352.3.1.3.1.3.2.2.0 corresponds to MIB
(openserCurNumDialogs.0)  and xx.xx.xx.xx is kamailio ip.

I then monitor calls per provider using dialog module and profile_get_size
function together with sercmd and ctl module to poll data into CACTI i.e.

sudo sercmd -s udp:xx.xx.xx.xx:3012 mi profile_get_size PROFILE WITH VALUE

I will write what i did in more detail though.

Regards
Phillip


On Mon, Aug 27, 2012 at 11:19 PM, Daniel-Constantin Mierla <
miconda@gmail.com> wrote:

> Hello,
> 
> 
> On 8/27/12 4:06 PM, phillman25 wrote:
> 
> Thanks Daniel i was able to implement what you advised below and am able
> to poll specific data into CACTI successfully.
> 
> great! Have you made it like a plugin? Maybe you can write few words about
> or make web page available for it, there is a similar plugin for munin,
> published by Inaki:
> 
> - http://dev.sipdoc.net/projects/sip-stuff/wiki/KamailioMuninPlugin
> 
> Cheers,
> Daniel
> 
> 
> 
> Thanks again!
> Phillip
> 
> 
> On Mon, Aug 27, 2012 at 1:08 PM, Daniel-Constantin Mierla <
> miconda@gmail.com> wrote:
> 
> > Hello,
> > 
> > I am not sure it supports right now sending from the same socket, but it
> > should send back to same ip and port from where it received the command. A
> > patch it might be required to get it like that, so far I don't remember
> > anyone willing to get such thing.
> > 
> > Btw, another alternative, you can eventually use sercmd with ctl module
> > -- it works also over tcp (as well as udp). You can run any MI command via
> > 'mi', like:
> > 
> > sercmd ... mi address_dump
> > 
> > Look at sercmd -h for the options.
> > 
> > So you don't need to build a script around nc.
> > 
> > Cheers,
> > Daniel
> > 
> > 
> > On 8/27/12 11:21 AM, phillman25 wrote:
> > 
> > Thanks for the info Daniel.
> > 
> > I have implemented mi_datagram module and defined it with the following
> > parameters:
> > 
> > modparam("mi_datagram", "socket_name", "udp:2.2.2.2:8033")
> > 
> > When i run the below command from a remote server:
> > 
> > echo -ne ":address_dump:\n\n" | nc -w 1 -u 2.2.2.2 8033
> > 
> > i don't receive an output, but when i monitor all traffic on the local
> > machine:
> > 
> > ngrep -q -t -P "" -W byline -d any host 2.2.2.2 and udp
> > 
> > i observe the output:
> > 
> > U 2012/08/27 12:41:36.735094 1.1.1.1:55621 -> 2.2.2.2:8033
> > > address_dump:
> > 
> > 
> > U 2012/08/27 12:41:36.735201 2.2.2.2:47024 -> 1.1.1.1:55621
> > 200 OK
> > 71 <1, xx.xx.xx.xx, 0> [1]
> > 72 <1, yy.yy.yy.yy, 0> [4]
> > 
> > 
> > Seems like the command is accepted from remote server and executed on
> > local machine but not relayed back to the remote server. Looks like
> > mi_datagram replies on different port other than 8033. Is there a way to
> > force the reply on source port 8033?
> > 
> > Thanks
> > Phillip
> > 
> > 
> > 
> > 
> > 
> > 
> > On Mon, Aug 27, 2012 at 9:58 AM, Daniel-Constantin Mierla <
> > miconda@gmail.com> wrote:
> > 
> > > Hello,
> > > 
> > > if you want to execute from a remote server, maybe it is better to use
> > > mi_datagram or xmlrpc modules to run MI/RPC commands.
> > > 
> > > Cheers,
> > > Daniel
> > > 
> > > 
> > > 
> > > On 8/22/12 12:02 PM, phillman25 wrote:
> > > 
> > > Dear List
> > > 
> > > I am trying to run the below command from a REMOTE server where i use
> > > Cacti to graph all my data. I am trying to graph on a per trunk basis.
> > > 
> > > kamctl fifo profile_get_size trunk | awk -F '=' '{print $4}'
> > > 
> > > This command yields an output on the local server.
> > > 
> > > Could someone perhaps point me in the right direction?
> > > 
> > > 
> > > Thanks!
> > > 
> > > 
> > > _______________________________________________
> > > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing \
> > > listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
> > >  
> > > 
> > > --
> > > Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - \
> > > http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 5-8, \
> > > 2012 - http://asipto.com/u/kat 
> > > 
> > 
> > --
> > Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - \
> > http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 5-8, \
> > 2012 - http://asipto.com/u/kat 
> > 
> 
> --
> Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - \
> http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 5-8, \
> 2012 - http://asipto.com/u/kat 
> 


[Attachment #5 (text/html)]

Hi Daniel<div><br></div><div>Sure i will prepare something and let you \
know.</div><div><br></div><div>Just brief info:</div><div>For current number of \
dialogs i used SNMPSTATS module on Kamailio, and use snmpget function from a remote \
server (CACTI) to poll data i.e.</div> <div><br></div><div>snmpget -v2c -c public \
xx.xx.xx.xx .1.3.6.1.4.1.34352.3.1.3.1.3.2.2.0 | cut \
-b58-65</div><div><br></div><div>where .1.3.6.1.4.1.34352.3.1.3.1.3.2.2.0 corresponds \
to MIB (openserCurNumDialogs.0)  and xx.xx.xx.xx is kamailio ip.</div> \
<div><br></div><div>I then monitor calls per provider using dialog module and \
profile_get_size function together with sercmd and ctl module to poll data into CACTI \
i.e.</div><div><br></div><div>sudo sercmd -s udp:xx.xx.xx.xx:3012 mi profile_get_size \
PROFILE WITH VALUE</div> <div><br></div><div>I will write what i did in more detail \
though.</div><div><br></div><div>Regards</div><div>Phillip</div><div><br></div><div><br><div \
class="gmail_quote">On Mon, Aug 27, 2012 at 11:19 PM, Daniel-Constantin Mierla <span \
dir="ltr">&lt;<a href="mailto:miconda@gmail.com" \
target="_blank">miconda@gmail.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hello,<div class="im"><br>
    <br>
    <div>On 8/27/12 4:06 PM, phillman25 wrote:<br>
    </div>
    <blockquote type="cite">Thanks Daniel i was able to implement what you advised
      below and am able to poll specific data into CACTI \
successfully.</blockquote></div>  great! Have you made it like a plugin? Maybe you \
can write few words  about or make web page available for it, there is a similar \
plugin  for munin, published by Inaki:<br>
    <br>
    - <a href="http://dev.sipdoc.net/projects/sip-stuff/wiki/KamailioMuninPlugin" \
target="_blank">http://dev.sipdoc.net/projects/sip-stuff/wiki/KamailioMuninPlugin</a><br>
  <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <br>
    <blockquote type="cite">
      <div><br>
      </div>
      <div>Thanks again!</div>
      <div>Phillip<br>
        <div> </div>
        <div><br>
          <div class="gmail_quote">On Mon, Aug 27, 2012 at 1:08 PM,
            Daniel-Constantin Mierla <span dir="ltr">&lt;<a \
href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span> \
                wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex">  <div bgcolor="#FFFFFF" text="#000000"> Hello,<br>
                <br>
                I am not sure it supports right now sending from the
                same socket, but it should send back to same ip and port
                from where it received the command. A patch it might be
                required to get it like that, so far I don&#39;t remember
                anyone willing to get such thing.<br>
                <br>
                Btw, another alternative, you can eventually use sercmd
                with ctl module -- it works also over tcp (as well as
                udp). You can run any MI command via &#39;mi&#39;, like:<br>
                <br>
                sercmd ... mi address_dump<br>
                <br>
                Look at sercmd -h for the options.<br>
                <br>
                So you don&#39;t need to build a script around nc.<br>
                <br>
                Cheers,<br>
                Daniel
                <div>
                  <div><br>
                    <br>
                    <div>On 8/27/12 11:21 AM, phillman25 wrote:<br>
                    </div>
                    <blockquote type="cite">Thanks for the info Daniel.
                      <div><br>
                      </div>
                      <div>I have implemented mi_datagram module and
                        defined it with the following parameters:</div>
                      <div><br>
                      </div>
                      <div>modparam(&quot;mi_datagram&quot;, &quot;socket_name&quot;, \
&quot;udp:<a href="http://2.2.2.2:8033" target="_blank">2.2.2.2:8033</a>&quot;)</div> \
<div><br>  </div>
                      <div>When i run the below command from a remote
                        server:</div>
                      <div><br>
                      </div>
                      <div>echo -ne &quot;:address_dump:\n\n&quot; | nc -w 1 -u
                        2.2.2.2 8033</div>
                      <div><br>
                      </div>
                      <div>i don&#39;t receive an output, but when i monitor
                        all traffic on the local machine:</div>
                      <div><br>
                      </div>
                      <div>ngrep -q -t -P &quot;&quot; -W byline -d any host
                        2.2.2.2 and udp</div>
                      <div><br>
                      </div>
                      <div>i observe the output:</div>
                      <div><br>
                      </div>
                      <div>
                        <div>U 2012/08/27 12:41:36.735094 <a \
                href="http://1.1.1.1:55621" target="_blank">1.1.1.1:55621</a>
                          -&gt; <a href="http://2.2.2.2:8033" \
target="_blank">2.2.2.2:8033</a></div>  <div>:address_dump:</div>
                        <div><br>
                        </div>
                        <div><br>
                        </div>
                        <div>U 2012/08/27 12:41:36.735201 <a \
                href="http://2.2.2.2:47024" target="_blank">2.2.2.2:47024</a>
                          -&gt; <a href="http://1.1.1.1:55621" \
target="_blank">1.1.1.1:55621</a></div>  <div>200 OK</div>
                        <div>  71 &lt;1, xx.xx.xx.xx, 0&gt; [1]</div>
                        <div>  72 &lt;1, yy.yy.yy.yy, 0&gt; [4]</div>
                      </div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div>Seems like the command is accepted from
                        remote server and executed on local machine but
                        not relayed back to the remote server. Looks
                        like mi_datagram replies on different port other
                        than 8033. Is there a way to force the reply on
                        source port 8033?</div>
                      <div><br>
                      </div>
                      <div>Thanks</div>
                      <div>Phillip</div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div><br>
                        <br>
                        <div class="gmail_quote">On Mon, Aug 27, 2012 at
                          9:58 AM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a \
href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span>  \
                wrote:<br>
                          <blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">  <div bgcolor="#FFFFFF" \
text="#000000">  Hello,<br>
                              <br>
                              if you want to execute from a remote
                              server, maybe it is better to use
                              mi_datagram or xmlrpc modules to run
                              MI/RPC commands.<br>
                              <br>
                              Cheers,<br>
                              Daniel
                              <div>
                                <div><br>
                                  <br>
                                  <br>
                                  <div>On 8/22/12 12:02 PM, phillman25
                                    wrote:<br>
                                  </div>
                                </div>
                              </div>
                              <blockquote type="cite">
                                <div>
                                  <div>Dear List
                                    <div><br>
                                    </div>
                                    <div>I am trying to run the below
                                      command from a REMOTE server where
                                      i use Cacti to graph all my data.
                                      I am trying to graph on a per
                                      trunk basis.<br>
                                      <div><br>
                                      </div>
                                      <div>kamctl fifo profile_get_size
                                        trunk | awk -F &#39;=&#39; &#39;{print \
$4}&#39;</div>  </div>
                                    <div><br>
                                    </div>
                                    <div>This command yields an output
                                      on the local server.</div>
                                    <div><br>
                                    </div>
                                    <div>Could someone perhaps point me
                                      in the right direction?</div>
                                    <div><br>
                                    </div>
                                    <div><br>
                                    </div>
                                    <div>Thanks!</div>
                                    <br>
                                    <fieldset></fieldset>
                                    <br>
                                  </div>
                                </div>
                                <pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" \
target="_blank">sr-users@lists.sip-router.org</a> <a \
href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" \
target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span><font \
color="#888888"> </font></span></pre>
                                <span><font color="#888888"> \
</font></span></blockquote>  <span><font color="#888888"> <br>
                                  <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" \
target="_blank">http://www.asipto.com</a> <a href="http://twitter.com/#%21/miconda" \
target="_blank">http://twitter.com/#!/miconda</a> - <a \
href="http://www.linkedin.com/in/miconda" \
target="_blank">http://www.linkedin.com/in/miconda</a> Kamailio Advanced Training, \
Berlin, Nov 5-8, 2012 - <a href="http://asipto.com/u/kat" \
target="_blank">http://asipto.com/u/kat</a></pre>  </font></span></div>
                          </blockquote>
                        </div>
                        <br>
                      </div>
                    </blockquote>
                    <br>
                    <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" \
target="_blank">http://www.asipto.com</a> <a href="http://twitter.com/#%21/miconda" \
target="_blank">http://twitter.com/#!/miconda</a> - <a \
href="http://www.linkedin.com/in/miconda" \
target="_blank">http://www.linkedin.com/in/miconda</a> Kamailio Advanced Training, \
Berlin, Nov 5-8, 2012 - <a href="http://asipto.com/u/kat" \
target="_blank">http://asipto.com/u/kat</a></pre>  </div>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" \
target="_blank">http://www.asipto.com</a> <a href="http://twitter.com/#!/miconda" \
target="_blank">http://twitter.com/#!/miconda</a> - <a \
href="http://www.linkedin.com/in/miconda" \
target="_blank">http://www.linkedin.com/in/miconda</a> Kamailio Advanced Training, \
Berlin, Nov 5-8, 2012 - <a href="http://asipto.com/u/kat" \
target="_blank">http://asipto.com/u/kat</a></pre>  </div></div></div>

</blockquote></div><br></div>



_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic