SNMP
From Pbxnsip Wiki
Contents |
Purpose
The simple network management protocol (SNMP) is a widely used protocol for checking what's going on in your network. When you run the PBX, you probably also want to see statistics about the usage and get alarms when something goes wrong.
There are many tools available for SNMP. For example, you can use the Linux command line argument snmpget or you can use the Windows commercial tool PRTG Traffic Grapher. Depending on the feature set, you may get SMS or email when something goes wrong. You can use those tools also to monitor other devices in your network, for example SIP phones.
The PBX does not send traps, it only supports GET in SNMP version 1. Though this is very simple, it is supported by all tools. Sending traps has only little value, as the process monitors itself and for example cannot send a trap in the case of a fatal event.
Setup
The setup of SNMP on the PBX side is very simple. Essentially, you have to perform two steps:
Select the port on which the SNMP server should listen. By default, this would be port 161, but on a host that runs other SNMP services as well you might want to choose another port.
Tell the PBX from which addresses to accept SNMP requests. You find the setting "SNMP Trusted IP Addresses" for this. Enter the IP addresses (separated by a space) or the IP address range here. The PBX will accept requests only from these addresses. The format is in the IP Address List format.
The setup of your SNMP tools varies from tool to tool. Because the PBX does not offer a standard set of values (such as CPU temperature, disk space etc.), the setup is a little bit more difficult that the setup of a standard sensor.
Available Object Identifiers
A readable parameter is described by its object identifier (OID). Please enter the OID in your tool and select appropriate names for them. Also make sure that the IP address of the host running the SNMP tool matches the setup that you gave the PBX in the "SNMP Trusted IP Addresses" setting. The PBX does not support "snmpwalk" or other tools that automatically describe the abilities of the PBX. You must enter these settings manually.
The following table describes the available OID. An absolute value describes the current state on the PBX, the value might go up and down. Relative values only go up and accumulate the values.
| OID | Description | Absolute | Unit |
|---|---|---|---|
| 1.3.6.1.4.1.25060.1.1 | Call Objects | Yes | Calls |
| 1.3.6.1.4.1.25060.1.2 | Registrations | Yes | Registrations |
| 1.3.6.1.4.1.25060.1.3 | Messages | Yes | Minutes |
| 1.3.6.1.4.1.25060.1.4 | Call Attempts | No | Calls |
| 1.3.6.1.4.1.25060.1.5 | Successful Calls | No | Calls |
| 1.3.6.1.4.1.25060.1.6 | Media CPU load | Yes | Value 0..100 |
| 1.3.6.1.4.1.25060.1.7 | Successful Emails | No | Emails |
| 1.3.6.1.4.1.25060.1.8 | Unsuccessful Emails | No | Emails |
| 1.3.6.1.4.1.25060.1.9 | Email Alert Flag | Yes | Value 0..1 |
| 1.3.6.1.4.1.25060.1.10 | SIP Received Packets | No | Packets |
| 1.3.6.1.4.1.25060.1.11 | SIP Sent Packets | No | Packets |
Please note that the OID was changed from 1.3.6.1.2.1.2.1.x to 1.3.6.1.4.1.25060.1.x in version 1.5.
The "Call Objects" just shows the number of call objects that have been allocated inside the PBX. Note that usually there are at least two call objects for a regular call, and during call forking you might have even more. This object will give you a good overview on the internal resource usage of the PBX.
The "Registrations" object shows how many extensions are actively registered with the PBX. This object gives you a good overview on how many active users the system has.
The "Messages" object shows you how many voicemail messages the system currently has stored. Note that when you do Email-forwarding, the messages are not stored on the PBX.
The "Call Attempts" object is useful to measure the Busy Hour Call Attempts (BHCA) number. This number is useful when you want to see where the limits of your system are. The BHCA number is a important performance number of traditional PBX. Feel free to compare the BHCA value of your modern CPU to the value of an old-style hardware PBX.
The "Successful Calls" object is similar to the "Call Attempts", but is measure the number of successful calls. The number is increased when the call terminates. The number can be used to determine the busy hour call performance of the system. Please note that on this software PBX, not only the call establishment takes resources. The call traffic itself also causes significant traffic, especially when the CPU has to do codec translation.
The "Media CPU Load" object show (in percent) how much time the media CPU threads spend in processing. This information is very important, because as this number approaches 100 % the jitter gets worse and the CPU eventually will not be able to process all media streams.
The "Successful Emails" contains the number of Emails that the PBX has sent out successfully. That means it has received the acknowledgement of the SMTP server that the email has been accepted. The "Unsuccessful Emails" contains the number of messages that failed. A failed message may be re-tried later; therefore the sum of the successful and the unsuccessful messages not not have to be the number of attempted emails.
The "Email Alert Flag" is set to one, if the last email failed. This flag is useful to find out when there is a situation where the administrator needs to do some action.
The "SIP Received Packets" and "SIP Send Packets" number says how many SIP messages have been received and sent on the PBX. Messages shorter than 5 bytes are not counted.
Example
If you use snmpget, you can get the status of the PBX with a command like like this:
# snmpget -v 1 -c public 192.168.1.103 .1.3.6.1.4.1.25060.1.3 SNMPv2-SMI::enterprises.25060.1.3 = INTEGER: 4
Log Messages
If you receive SNMP: Received unknown object identifier the SNMP tool tries to get an object identifier that does not exist. Some tools try various object identifier by default, which is not a reason for concern.
