Plugin template?


is there some template for check_mk plugin?

I would like to write a plugin to monitor the Status of SIP-Trunks on Alcatel OXO PBX.

I have already a script, which can read and deliver the requested information.

I will modify the Script so, that it will accept four parameters: username, password, ip adress and name of sip trunk. I want to set these Parameters through wato. The Script will then connect to web interface and read the appropriate state of the sip trunk. The output can be “REGISTRATION FAILED” or “REGISTRATION SUCCESSFULL”.

Where can I begin? Unfortunately the documentation on check_mk web did not help me that much.



have you already read this document?

I suggest you first write a script that takes these 4 arguments as parameters and that returns 0 on success, 1 on warning, 2 on critical, else 3 (unknown).

You can use any programming language, but if you’re not sure then use python since most of the other plugins are written in it.


here is my script returning desired values:

How could I know proceed to be able to configure the script in WATO?


For configuration in WATO you have to develop other files on the central monitoring server in python.

Example for ~site/local/share/check_mk/web/plugins/wato/<your_filename>. It’s working in 1.5 and is not tested on 1.6. I am not sure if the reference changed for this functions.

        _('Linux multipath broken paths'),
                elements = [
                    title = _("Set levels on broken paths"),
                    elements = [
                                    Integer(title = _("Warning at"), default_value = 1),
                                    Integer(title = _("Critical at"), default_value = 2),
                Integer(title = _("Sum Paths"))
                    default_value = 1,
                    title = _("State in case of new paths found"),
   match_type = 'dict',


I tried to develop the file for wato, but I still do not understand how should I put it all together:

# -*- encoding: utf-8; py-indent-offset: 4 -*-

register_check_parameters (
    _("Alcatel-Lucent OXE SIP Trunk Status"),
        title=_("Check SIP Trunk Status OXE"),
    help = _("This ruleset can be used to monitor status of SIP Trunk at Alcatel-Lucent OXE     PBX"),
        elements = [
                title=_("Public Registration Domain"),

According to this article I want to develop an “Active Check”.

Can somebody tell me what should be the next step now to connect all together? Thanks.

I got further now. I can see my check in WATO in “Host & Service Parameters”.

But I still do not know how can I use the IP Address of target host in my script.

My check script needs in parametr -H an ip address of target host. How can I use the $HOSTADDRESS$ variable in my check script?


As this script is more an classic active check then a checkmk check.
You cannot use the classic way with check parameters and then the checkmk check.

Take a look at the “check_tcp”
“check_tcp” is only a checkmk plugin making the correct active check syntax for your monitoring core.
The monitoring core then is running your script.

And the options from WATO for this active check.

There the definition
def _valuespec_active_checks_tcp():


If you write your own definition then it is the easiest way to take the complete import block from the start of this file :slight_smile:

Hi Andreas,
thank you for your help.

I managed to create mkp package for my plugin and run it and configure through wato, but unfortunately my script does not function in the same way as if I run it manually from CLI.

The script parses the webpage of OXE PBX and print on its output Status of desired SIP Trunk:

#./check_oxesiptrunkstatus -u user -p secret -H -P
0 SIP-TRUNK - OK: Public Registration Domain -, Public DDI - f106353ecompany, Status - REGISTRATION SUCCESSFUL

But when check_mk runs the script with the same parameters, then in the script output I cannot see given “Public Registration Domain” but I always see the first PRD from the list.

Out of some reason the script does not work the same way as when I run it manually from CLI.

I also was not able to debug the command using cmk.

When I try to run:

cmk -vn --checks=check_oxesiptrunkstatus OmniPCX-Office

I get:

Check_MK version 1.6.0p10
Unknown plugin file check_oxesiptrunkstatus
Unknown plugin file check_oxesiptrunkstatus
 [snmp] Execute data source
 [piggyback] Execute data source
No piggyback files for 'OmniPCX-Office'. Skip processing.
No piggyback files for ''. Skip processing.
 [snmp] Execute data source
Plugins: inv_if snmp_info snmp_os
OK - [snmp] Success, execution time 0.1 sec | execution_time=0.126 user_time=0.080 system_time=0.000 children_user_time=0.000 children_system_time=0.000 cmk_time_snmp=0.039 cmk_time_agent=0.001

Even though I can fin it in cmk -L:

$ cmk -L|grep oxesip
check_oxesiptrunkstatus                      active Check OXE SIP Trunk Status

This output looks like a local check output, not an active check.
What guide do you used to write this script? Is there somewhere the source code?

To include such a script with an SNMP device can be challenging.

Source code is here:

I put it together using various examples, howtos and check_mk documentation.
I used this article a lot:

The check needs to download a web page, parse the data out of it and then evaluate the data.

Can someone have a look at it? I am almost there. My first check_mk plugin. :slight_smile: Thanks!