Difference between revisions of "Freeswitch SNMP"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
= Freeswitch SNMP =  
= Freeswitch SNMP =  


Freeswitch SNMP module (mod_snmp) allows to access various Freeswitch parameters and channel information via SNMP.
Freeswitch SNMP module (mod_snmp) allows to access various Freeswitch parameters and channel information via SNMP


= Installation =
= Installation =
Line 8: Line 8:


  svn update /usr/src/m2
  svn update /usr/src/m2
  /usr/src/m2/helpers/freeswitch_snmp_install.sh
  /usr/src/m2/freeswitch/snmp/freeswitch_snmp_install.sh
 
NOTE: Does not work on Centos 7 currently due to the MySQL version conflict (updates MySQL to v8, we need v5.7)


Note that this script '''will restart''' Freeswitch and Calls will be terminated.
Note that this script '''will restart''' Freeswitch and Calls will be terminated.

Latest revision as of 12:12, 14 July 2020

Freeswitch SNMP

Freeswitch SNMP module (mod_snmp) allows to access various Freeswitch parameters and channel information via SNMP

Installation

Freeswitch SNMP module can be installed by executing install script (works only in Kolmisoft M2 environment):

svn update /usr/src/m2
/usr/src/m2/freeswitch/snmp/freeswitch_snmp_install.sh

NOTE: Does not work on Centos 7 currently due to the MySQL version conflict (updates MySQL to v8, we need v5.7)

Note that this script will restart Freeswitch and Calls will be terminated.

Configuration

Example SNMP configuration file is installed in /etc/snmp/snmpd.conf:

# Run as an AgentX master agent
# Freeswitch will connect to this agent
master          agentx
agentXPerms     0755 0755 freeswitch daemon
agentXSocket    /var/agentx/master


# Map 'm2_freeswitch_7e618bc4' community string to 'FreeswitchUser'
#       sec.name         source          community string
com2sec FreeswitchUser   default         m2_freeswitch_7e618bc4


# Map 'FreeswitchUser' to 'FreeswitchGroup' for SNMP Version 2c
#       name             sec.model       sec.name
group   FreeswitchGroup  v2c             FreeswitchUser


# Define 'FreeswitchView', which includes everything under .1.3.6.1.4.1.27880
#       name             incl/excl       subtree
view    FreeswitchView   included        .1.3.6.1.4.1.27880


# Give 'FreeswitchGroup' read access to objects in the view 'FreeswitchView'
#                       context  model   level   prefix  read            write   notify
access  FreeswitchGroup ""       any     noauth  exact   FreeswitchView  none    none

This configuration file serves as an example configuration and should be modified by administrator for production use.

Community string

Freeswitch SNMP comes with randomly generated community string (for example: m2_freeswitch_7e618bc4) which is displayed after installation and can be changed in /etc/snmp/snmpd.conf configuration file.

Reserved Object Identifier (OID)

The OID .1.3.6.1.4.1.27880 has been reserved for FreeSWITCH

All attributes are read-only

  • .1 core
    • .1.1 identity
      • .1.3.6.1.4.1.27880.1.1.1 FreeSWITCH version string (eg. "1.0.head (git-0cf1d54 2011-01-19 16-36-04 \-0500)")
      • .1.3.6.1.4.1.27880.1.1.2 Core UUID as a string
    • .2 systemStats
      • .1.3.6.1.4.1.27880.1.2.1 FreeSWITCH uptime as SNMP TimerTicks (hundredths of seconds)
      • .1.3.6.1.4.1.27880.1.2.2 Number of sessions since FreeSWITCH was started
      • .1.3.6.1.4.1.27880.1.2.3 Currently active sessions
      • .1.3.6.1.4.1.27880.1.2.4 Maximum allowed sessions
      • .1.3.6.1.4.1.27880.1.2.5 Currently active calls
      • .1.3.6.1.4.1.27880.1.2.6 Current sessions per second
      • .1.3.6.1.4.1.27880.1.2.7 Maximum allowed sessions per second
      • .1.3.6.1.4.1.27880.1.2.8 Peak sessions per second
      • .1.3.6.1.4.1.27880.1.2.9 Peak sessions per second Last Five Minutes
      • .1.3.6.1.4.1.27880.1.2.10 Peak sessions
      • .1.3.6.1.4.1.27880.1.2.11 Peak sessions Last Five Minutes
    • .9.1 channel info
      • .1.3.6.1.4.1.27880.1.9.1.1 Channel index
      • .1.3.6.1.4.1.27880.1.9.1.2 Channel UUID
      • .1.3.6.1.4.1.27880.1.9.1.3 Channel direction
      • .1.3.6.1.4.1.27880.1.9.1.4 Channel created at
      • .1.3.6.1.4.1.27880.1.9.1.5 Channel name
      • .1.3.6.1.4.1.27880.1.9.1.6 Channel state
      • .1.3.6.1.4.1.27880.1.9.1.7 Channel CID name
      • .1.3.6.1.4.1.27880.1.9.1.8 Channel CID num
      • .1.3.6.1.4.1.27880.1.9.1.9 Channel IP addr type
      • .1.3.6.1.4.1.27880.1.9.1.10 Channel IP addr
      • .1.3.6.1.4.1.27880.1.9.1.11 Channel destination
      • .1.3.6.1.4.1.27880.1.9.1.12 Channel application
      • .1.3.6.1.4.1.27880.1.9.1.13 Channel application status
      • .1.3.6.1.4.1.27880.1.9.1.14 Channel dialplan
      • .1.3.6.1.4.1.27880.1.9.1.15 Channel context
      • .1.3.6.1.4.1.27880.1.9.1.16 Channel read codec
      • .1.3.6.1.4.1.27880.1.9.1.17 Channel read codec rate
      • .1.3.6.1.4.1.27880.1.9.1.18 Channel read codec bitrate
      • .1.3.6.1.4.1.27880.1.9.1.19 Channel write codec
      • .1.3.6.1.4.1.27880.1.9.1.20 Channel write codec rate
      • .1.3.6.1.4.1.27880.1.9.1.21 Channel write codec btrate

Testing with snmpwalk

Get current active calls count:

snmpwalk -v 2c -c m2_freeswitch_7e618bc4 127.0.0.1 .1.3.6.1.4.1.27880.1.2.5