3.3 KiB
Checkmk asterisk Monitoring Plugin
This repository provides a Checkmk MKP package to monitor an asterisk server.
It includes both an agent plugin (running on the asterisk host) and a check plugin (running in Checkmk).
Features
-
Endpoint information for PJSIP via the built-in asterisk cli
- Status (Available, Busy, Offline)
- Used Channels (Available/Used/Percent)
Requirements
- A running Checkmk installation (v2.x or newer recommended)
- asterisk server using pjsip (default on most new servers, tested on asterisk 21.9.1)
- You can run
asterisk -rx pjsip show endpoints
to verify that you use PJSIP
- You can run
Installation
Development setup
If you want to work on or test the plugin directly inside a Checkmk site, you have two options:
a) Release an installed MKP
If you already installed the package via mkp install
, you can release it:
omd su <yoursite>
mkp release asterisk
This removes the MKP registration but leaves all contained files unpacked in the correct places under ~/local/...
, so you can edit them directly:
- Check plugin (agent-based):
~/local/lib/python3/cmk_addons/plugins/asterisk/agent_based/
- Agent plugin:
~/local/share/check_mk/agents/plugins/asterisk.py
(Just for download purposes)
b) Clone the repository into your development site Alternatively, you can clone this repository directly into the site’s local directory:
omd su <yoursite>
cd ~/local/lib/python3/cmk_addons/plugins
git clone https://git.project-name-here.de/Project-Name-Here/checkmk-asterisk.git asterisk
# reload monitoring core
cmk -R
This way you can pull updates from git and test changes directly.
Installation from MKP (recommended)
For production use install the packaged MKP:
- Download the
.mkp
file from the Releases or Checkmk Exchange. - Install it via GUI (Extension Packages) or via CLI:
omd su <yoursite>
mkp install asterisk-<version>.mkp
cmk -R
After installation, the agent plugin is available for download in the Checkmk GUI under Agents → Plugins. Install it on your asterisk server as described in the next section.
Agent Plugin Setup
On the monitored asterisk server host, place the agent plugin in /usr/lib/check_mk_agent/plugins/
and make it executable. It will then be executed automatically by the Checkmk agent. You can also run it manually for testing:
/usr/lib/check_mk_agent/plugins/asterisk.py
Usage
- Run a service discovery in Checkmk for the host.
- You should now see:
- One service for each endpoint (PJSIP) with the following information:
- Endpoint name
- State (Available, Busy, Offline)
- Used channels (Used/Available/Percent)
- One service for each endpoint (PJSIP) with the following information:
Development & Contributions
- Support for additional endpoint types (Dahdi, IAX2) implementations may be added later.
- If you need support for another implementation or encounter issues, please open an issue.
Contributions via pull requests are welcome!
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.