Online Training
Q4 2024

Nov 19 to Dec 10

11.00 AM EST: USA, UK, Canada, Mexico and Europe

06.00 AM GMT: MiddleEast, Asia and Australia

Register Now

Plugin for Monitoring Twilio Usage

Gain kwledge on the total SMS count and the voice calls made to ensure continued functionality of the Twilio platform.

Start 30-day free trial Try now, sign up in 30 seconds

Twilio enables the programmatic delivery/reception of phone calls and text messages using its web service APIs. Twilio monitoring makes sure you kw what's happening within your wide spectrum of communication capabilities.

This document details how to configure the Site24x7 Twilio plugin and the monitoring metrics for providing in-depth visibility into the performance, availability and usage stats of Twilio.

Twilio usage monitoring metrics:

The Twilio plugin informs you on the number of calls, messages or when the total price for the current day exceeds the threshold.

Various out-of-the-box metrics we support are:

Number of inbound/outbound calls and its usage

The calls_inbound_count and calls_outbound_count detes the total number of inbound and outbound voice calls to mobile, toll-free and local numbers respectively. The calls_inbound_usage and calls_outbound_usage is the inbound and outbound call minutes (duration) respectively

Number of inbound/outbound SIP calls and its usage

Programmable voice SIP routes the voice calls with global reach to any landline phone, mobile phone, browser, mobile app, or any other SIP end point. The calls_sip_inbound_count and calls_sip_outbound_count is the total number of inbound and outbound SIP calls respectively. The duration of these calls is given by calls_sip_inbound_usage and calls_sip_outbound_usage

Number of Twilio Client calls and its usage

Twilio Client is to make voice calls from your browser or native mobile applications. The calls_client_count gives the total number of calls made/received using Twilio Client. The minutes of these Twilio Client voice calls is tracked by calls_client_usage

Total number of messages

The sms_count is the total number of all SMS messages, both inbound and outbound

Total usage price

The totalprice_usage gives the total usage made by your Twilio account during any time period and by any usage category

How it works?

  • Log-in to your Site24x7 account. Sign up here if you don't have one
  • Download and install the latest version of Site24x7 Linux agent or the Windows agent
  • Install the Twilio plugin extension
  • The agent will execute the Twilio plugin extension and push the data to the Site24x7 server

Prerequisites:

  • Site24X7 Twilio plugin uses Python's "Twilio" package to collect metrics
  • sudo pip install twilio
    or
    sudo easy_install twilio

Twilio plugin installation:

For Linux:

  • Create a directory with the name "twiliomon", under Site24x7 Linux agent plugin directory - /opt/site24x7/monagent/plugins/
    sudo mkdir twiliomon
  • Download the twiliomon.py from our GitHub repository and place it under the "twiliomon" directory
    sudo wget https://raw.githubusercontent.com/site24x7/plugins/master/twiliomon/twiliomon.py
  • The default python path given in the plugin script is #!/usr/bin/python. If you wish to provide an alternate python path, replace the existing one preceded by the shebang character "#!".
  • Change the values of ACCOUNT_SID and AUTH_TOKEN from the Twilio console to match your configuration
  • The server agent will report stats on the performance of Twilio under the Plugins tab in the Site24x7 web client. In case the plugin is t listed in the Site24x7 web client, restart the agent
    sudo /etc/init.d/site24x7monagent restart

For Windows:

  • Create a directory with the name "twiliomon", under Site24x7 Windows agent plugin directory - C:\Program Files\Site24x7\WinAgent\monitoring\Plugins\
  • Download twiliomon.py from our GitHub repository and place it under the "twiliomon" directory
  • Download twiliomon.ps1 and place it under "twiliomon" directory
  • Replace $python="C:\Python27\python.exe" in "twiliomon.ps1" file with your python path
  • The Site24x7 Windows agent will w report stats on the performance of Twilio under the Plugins tab in the Site24x7 web client

Monitoring additional metrics:

  • To monitor additional metrics, edit the "twiliomon.py" file and add the new metrics that need monitoring
  • Increment the plugin version value in the file to view the newly added metrics (For e.g., change the default plugin version from PLUGIN_VERSION = "1" to "PLUGIN_VERSION = "2")

Related plugins:

  • ActiveMQ plugin - Monitor performance metrics of your Apache ActiveMQ instances
  • Kafka plugin - Monitor performance metrics of your Apache Kafka server
  • GlassFish plugin - Analyze performance of your GlassFish servers
  • Nagios plugin - Execute thousands of Nagios plugins in Site24x7 without the need of running a Nagios server
  • Out-of-the-box plugins - Monitor your entire app stack with our extensive list of integrations
  • Create custom plugins - Create custom Linux and Windows plugins and monitor custom attributes