Enterprise Monitoring for Restcomm – Part 2

Restcomm_logo

In a previous post – http://www.telestax.com/enterprise-monitoring-for-restcomm-an-overview-of-the-apis-and-the-tools/ – we had an overview of what it means enterprise monitoring and Restcomm.

In this post, I will introduce you to the recent development of the the Monitoring Service of Restcomm. The Monitoring Service can be used to collect stats and monitor the health of a server.

Currently the Monitoring Service feature provides the following:

  • List of live calls
  • Status of the live calls

Next in the roadmap I have the following features:

  • list of live SMS or USSD sessions
  • Status of SMS or USSD sessions
  • Global stats, such as number of calls served up to now
  • Registration of remote supervisors – Restcomm will push stats to monitoring server for specific event.

For this blog post, I will use Graylog log management server – https://www.graylog.org/, from their web site:
“`Graylog is a fully integrated open source log management platform for collecting, indexing, and analyzing both structured and unstructured data from almost any source.“`

Grayog is great because we wont need any other external tools such as logstash, and on top they provide a docker image so we won’t bother to install and setup the application.

First we will have to get the Graylog docker image and run it:

$ docker pull graylog2/allinone
$ docker run -t -p 9000:9000 -p 12201:12201 graylog2/allinone

You can find more information here http://docs.graylog.org/en/latest/pages/installation/docker.html

The Restcomm binary with the Monitoring Service is available from here: https://mobicents.ci.cloudbees.com/view/RestComm/job/RestComm-JSR309-Monitoring/lastSuccessfulBuild/artifact/Mobicents-Restcomm-JBoss-AS7-7.4.0.6.zip.

After you download, unzip it and start Restcomm then we are ready to start monitoring.

Next step is to start Graylog. Using docker we need:

docker run -t -p 9000:9000 -p 12201:12201 graylog2/allinone

Now we need to instruct Graylog to collect from Restcomm. Go to System/Inputs -> Inputs choose “JSON path from HTTP API” and press Launch.

First provide something meaningful for the title.
Important is the “Additional HTTP headers” where you have to specify the following:

“`Accept: application/json, Authorization: Basic XXXXXXXXXX“`

The Authorization: Basic token is the administrators password encoded, its the same when using the REST API, for example using the Restcomm Admin UI (hint, start Wireshark capture and login to Admin UI, then check the Authorization header at the HTTP request)

JSON path is a great project that is used to extract elements of a JSON message in a similar way to the XPATH project, you can find more information here: http://goessner.net/articles/JsonPath/

For the tutorial here we will need the following JSON Path expression:

“`$.LiveCalls“`

Last, the URI for JSON resource should be:

“`http://ACae6e420f425248d6a26948c17a9e2acf:YOUR_AUTH_TOKEN@RESTCOMM_IP_ADDRESS:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Supervisor.json/livecalls“`

Screenshot from 2015-08-07 19:40:13

When the input is ready you save and you can check the received messages, it should look something like this:

Screenshot from 2015-08-07 19:40:21

The screenshot here, shows that Restcomm at that point has 1 live call.

Expand the “result” filed and press to generate a chart:

Screenshot from 2015-08-07 19:42:32

Then you can add the generated chart to a dashboard (you have to create one first).

Screenshot from 2015-08-07 19:53:38

On the screenshot above you can see that at some point we had maximum 2 live calls.

More metrics and features for the Monitoring Service are in the roadmap so stay tuned and make sure you subscribe to Telestax newsletter and follow us on Twitter so you miss nothing.

You can use the Restcomm public forum – https://groups.google.com/forum/?fromgroups#!forum/restcomm – to send any suggestion, feature request or questions.

– George