[SR-Users] Need useful graphics ideas

Karsten Horsmann khorsmann at gmail.com
Thu Mar 15 17:22:30 CET 2018


Hello List,
Hello Joel,


i have now the time to implement this idea.

How you got  $var(metrics_json)  filed with the kamailio stats / whatever
internal informations?

btw i use kamailio 5.0.6 at this moment.

Thanks!



2017-12-06 18:11 GMT+01:00 Joel Serrano <joel at gogii.net>:

> I use a mix of the above...
>
> With kamailio I export that stats I want via http:
>
>
> event_route[xhttp:request] {
>     # Verify request come from localhost
>     if(src_ip!=127.0.0.1) {
>         xhttp_reply("403", "Forbidden", "text/html",
> "<html><body>Forbidden</body></html>");
>         xlog("L_WARN", "[HTTP] Unauthorized access from: $si\n");
>         exit;
>     }
>
>     # Metrics endpoint
>     if ($hu =~ "^/statistics") {
>
>         ... build a $var(metrics_json) with the metrics you want, must be
> JSON format ...
>
>         }
>         xhttp_reply("200", "OK", "application/json", "$var(metrics_json)");
>     }
>     return;
> }
>
>
> Then in telegraf I use the httpjson module to gather the metrics:
>
> ...
> [[inputs.httpjson]]
>   name_override = "kamailio"
>   servers = [ "http://127.0.0.1/statistics" ]
>   method = "GET"
> ...
>
>
>
> This is an example:
>
> joel at sbc-dev:~$ curl -q http://127.0.0.1/statistics 2> /dev/null | python
> -m json.tool
> {
>     "core-bad_URIs_rcvd": 0,
> [cut some output
>     "tmx-rpl_received": 436444,
>     "tmx-rpl_relayed": 379358,
>     "tmx-rpl_sent": 489589,
>     "usrloc-registered_users": 0
> }
> joel at sbc-dev:~$
>
>
> We have all those metrics available now in influxdb, then, as others have
> stated, Grafana is your best friend to make those metrics look nice.
>
>
> Hope these little snippets help you and anyone else getting started with
> Kamailio metrics.
>
>
> Cheers,
> Joel.
>
> On Wed, Dec 6, 2017 at 1:20 AM, Daniel-Constantin Mierla <
> miconda at gmail.com> wrote:
>
>> Hello,
>>
>> have you seen the article posted at:
>>
>>   - https://www.kamailio.org/w/2015/03/kamailio-statsd-best-practices/
>>
>> Eloy had a blog about it linked from above page.
>>
>> Cheers,
>> Daniel
>>
>> On 06.12.17 08:54, Karsten Horsmann wrote:
>>
>> Hello List,
>>
>> I thought about some kind of Kamailio stats source (like registered
>> users, calls active and some other things) to collect them into influx dB
>> and draw them with grafana.
>>
>> How do you solved that?
>>
>> Timer based routes or statsd or whatever?
>>
>> Kind regards
>> Karsten Horsmann
>>
>>
>> _______________________________________________
>> Kamailio (SER) - Users Mailing Listsr-users at lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>> --
>> Daniel-Constantin Mierlawww.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Kamailio Advanced Training - www.asipto.com
>> Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com
>>
>>
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> sr-users at lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>


-- 
Kind Regards
*Karsten Horsmann*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180315/e3019a34/attachment.html>


More information about the sr-users mailing list