Table of Contents


The php client contains a few checks. You can extend the functionality by writing custom plugins.


  • custom checks are in the “plugins/checks/” subdirectory
  • naming convention: they must be lowercase - [name of your check] + “.php”
  • it must be a class that extends appmonitorcheck
  • the class name must be “check” + [name of your check]
  • it needs a run method that gets an array as argument

The built in functions and custom checks are listed with listChecks method:

$oMonitor = new appmonitor();


A good starting point is the file [client]/plugins/hello.php

  • To access the checkHello.php you need to use “Hello” in the value check -> function.
  • A plugin gets the array check -> params as argument. The following snippet will use an array with a single key “message”

In the check script:

$oMonitor = new appmonitor();
// (...)
        "name" => "check plugin",
        "description" => "test an external plugin plugins/checkHello.php",
        "check" => array(
            "function" => "Hello",
            "params" => array(
                "message" => "Here I am",

In the plugins/checkHello.php the class name ist the same like the filename (without “.php”):

It needs a method run() that must be public.

class checkHello extends appmonitorcheck{
    // (...)
    public function run($aParams){
        // (...)

Inside the class I suggest to use to verify your needed keys with _checkArrayKeys()

$this->_checkArrayKeys($aParams, "message");

After making the magic things things of your custom check you need to return a result set as an array.

The class appmonitorcheck that calls your plugin will put your response to _setReturn():

$oPlogin = new $sCheck;

The checkHello has a documented section. It returns the minimal variant with return code and a message - but no counter.

// see method appmonitorcheck->_setReturn()
// {integer} you should use a RESULT_XYZ constant:
// {string}  output text 
// {array}   optional: counter data
//              type   => {string} "counter"
//              count  => {float}  value
//              visual => {string} one of bar|line|simple (+params)
return array(
    'Hello world! My message is: ' .$aParams['message']

This returns an OK with the message “Hello world! My message is: Here I am”.