Monitoring Asterisk SIP Peer and Clients

Description

The idea is to monitor the connection of SIP clients to an Asterisk server. SIP clients could be for example important phones or a SIP uplink to a provider.

The attached SIPPeerPoller connects to an Asterisk box using the Asterisk Manager Interface (AMI) and executes a sip show peers command and checks the connection state for a given SIP peer. (it has to be configured in Asterisk's sip.conf, that Asterisk monitors the connection to that SIP peer with the option qualify=yes option). If the result from asterisk is "OK (x ms)", then the poller gives back an up message, if not it gives back a down message.

The monitor reads the OpenNMS AMI configuration file (ami-config.xml) to get the data accessing the asterisk box. In the poller-configuration.xml it needs the parameter sip-peer to be set as the sip peer, that should be monitored. Here is an example:

<service name="SIP-Uplink" interval="30000" user-defined="false" status="on"> <parameter key="timeout" value="3000"/> <parameter key="retry" value="2"/> <parameter key="sip-peer" value="uplink" /> </service> <monitor service="SIP-Uplink" class-name="org.opennms.netmgt.poller.monitors.AsteriskSIPPeerMonitor" />

Ronny has done some refactoring for better JUnit testing:
https://gitorious.org/opennms-monitor-extension/opennms-asterisk-sip-peer-monitor

In the attachment, there is also a patched opennms-asterisk.jar file for the OpenNMS/lib directory, if somebody wants to try it.

Acceptance / Success Criteria

None

Attachments

5
  • 13 Jun 2014, 05:21 AM
  • 28 Apr 2014, 11:42 AM
  • 21 Mar 2014, 12:19 PM
  • 21 Mar 2014, 10:48 AM
  • 02 Mar 2013, 01:07 PM

Confluence content

mentioned on

Lucidchart Diagrams

Activity

Show:

Marcel Fuhrmann March 27, 2017 at 3:06 AM

The poller is definitely not working. Today we got an outage without any response. Please check depency issue too.

Marcel Fuhrmann March 8, 2017 at 5:47 PM

Both issues are still a problem.

Kieran Davies September 5, 2016 at 7:25 PM

Hi,

I have followed the link: https://wiki.opennms.org/wiki/Monitoring_Asterisk

But for some reason when I have tried this it always shows my peer as OK even when I shut down the server or stop asterisk.

Any ideas?

RJ Personal June 3, 2015 at 6:31 AM

Hi Michael,

I already figured this out. The class-name should be:

org.opennms.netmgt.asterisk.monitor.AsteriskSIPPeerMonitor

poller should be asterisk.

But now I'm facing another issue:

http://issues.opennms.org/browse/NMS-7707

Michael Batz June 2, 2015 at 5:30 PM

Hi,

have you put the monitor line in your poller-configuration.xml?

<monitor service="SIP-RegusTrunk" class-name="org.opennms.netmgt.poller.monitors.AsteriskSIPPeerMonitor"/>

Won't Fix

Details

Assignee

Reporter

Labels

HB Grooming Date

Doc Backlog Status

Doc Backlog Grooming Date

Affects versions

Priority

PagerDuty

Created March 2, 2013 at 1:07 PM
Updated October 19, 2021 at 6:02 PM
Resolved October 19, 2021 at 6:02 PM

Flag notifications