Monitor the switch with SNMP
The switch answers SNMP v2c queries with live call counters: per environment, customer, account, vendor and connection, plus media relay statistics. Point Zabbix, PRTG, Nagios or any other SNMP tool at it to graph traffic and alert on drops. This page opens SNMP to your monitoring host and shows which OIDs to read. Allow 15 minutes.
Before you start
Section titled “Before you start”- You have root shell access to the switch over SSH. If you do not, ask FlySIP support to do steps 1 and 2.
- You know the IP address of your monitoring host and have picked a community string, for example
fs-monitor-7Qx. - Your monitoring host has the
snmpwalkandsnmpgettools (packagenet-snmp) for the test.
Step 1: Allow your monitoring host
Section titled “Step 1: Allow your monitoring host”The SNMP agent answers only 127.0.0.1 until you add your host. The switch’s firewall opens UDP 161 only to hosts listed in the agent’s configuration.
-
Open
/home/ssp/etc/snmpd.confon the switch. It already has the line that serves the switch’s statistics:pass_persist .1.3.6.1.4.1.36523 /home/ssp/scripts/snmp_statsd.py -
Add a line with your community string and the monitoring host:
rocommunity fs-monitor-7Qx 198.51.100.20 -
Restart the agent and reload the firewall rules. Run the firewall script inside
screen, so that a dropped SSH session does not interrupt it:Terminal window /usr/local/etc/rc.d/snmpd restartscreen /home/ssp/scripts/rc.firewall.sh
Result: UDP 161 of the switch accepts queries from 198.51.100.20 with this community.
Step 2: Copy the MIB file (optional)
Section titled “Step 2: Copy the MIB file (optional)”The OIDs below work without a MIB. To see names instead of numbers in your tool, copy the MIB file that ships in /home/ssp/etc/ on the switch to the MIB directory of your monitoring host, for example /usr/share/snmp/mibs/. Ask FlySIP support if you cannot find it.
Step 3: Read the counters
Section titled “Step 3: Read the counters”All OIDs start with .1.3.6.1.4.1.36523.1.1. Walk the tree from your monitoring host:
snmpwalk -v2c -On -c fs-monitor-7Qx 203.0.113.10 .1.3.6.1.4.1.36523.1.1.1.3.6.1.4.1.36523.1.1.1.1.1.1 = STRING: "1/Primary/".1.3.6.1.4.1.36523.1.1.1.2.1.1 = INTEGER: 42.1.3.6.1.4.1.36523.1.1.1.3.1.1 = INTEGER: 37Per environment
Section titled “Per environment”The OID is .1.3.6.1.4.1.36523.1.1.1.<n>.1.<i_environment>.
<n> |
Value |
|---|---|
1 |
ID and name of the environment, for example "1/Primary/" |
2 |
Active calls: calls being routed plus connected calls |
3 |
Connected calls |
4 |
Average ptime of the call processor |
5 |
Average aa_ptime of the call processor |
6 |
Average number of authorized calls |
7 |
Average number of routed calls |
8 |
Average number of connected calls |
9 |
Number of authorized calls, counter |
10 |
Number of routed calls, counter |
11 |
Number of connected calls, counter |
12 |
Total duration of calls, counter |
13 |
Number of received calls, counter |
14 |
Number of originated calls, counter |
15 |
Number of registered devices |
The ID of the root environment is 1. Other environments have the IDs shown under System Management → Environments.
Per account, customer, vendor and connection
Section titled “Per account, customer, vendor and connection”The OID is .1.3.6.1.4.1.36523.1.1.<object>.<n>.1.<i_environment>.<id>, where <n> is 2 for active calls and 3 for connected calls.
<object> |
Object | <id> |
|---|---|---|
2 |
Account | i_account |
3 |
Vendor | i_vendor |
4 |
Connection | i_connection |
5 |
Customer | i_customer |
For example, active calls of connection 64 in environment 1:
snmpget -v2c -On -c fs-monitor-7Qx 203.0.113.10 .1.3.6.1.4.1.36523.1.1.4.2.1.1.64.1.3.6.1.4.1.36523.1.1.4.2.1.1.64 = INTEGER: 52The IDs are in the panel: open the object and look at the i_… value in the address bar, or read them with the API.
Media relay
Section titled “Media relay”| OID | Value |
|---|---|
.1.3.6.1.4.1.36523.1.1.6.1 |
Calls with SDP on both legs but RTP on one leg only |
.1.3.6.1.4.1.36523.1.1.6.2 |
Calls with a media description on one leg only |
.1.3.6.1.4.1.36523.1.1.6.3 |
Calls with SDP on both legs and no RTP on either |
.1.3.6.1.4.1.36523.1.1.6.4 |
Discarded RTP and RTCP packets, usually from unknown sources |
A growing one-way or no-RTP count points to NAT or firewall problems on the media path.
Step 4: Test it
Section titled “Step 4: Test it”- Run the
snmpwalkcommand from step 3 on the monitoring host. It prints the environments. - Make a test call and run
snmpgetfor the environment’s active calls (<n>=2). The value goes up by one while the call is up.
What’s next
Section titled “What’s next”- Monitoring graphs through the API
- Set up the firewall
- Operator notifications