Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • iml-open-source/imldeployment
1 result
Select Git revision
Show changes
......@@ -21,9 +21,32 @@
* 2022-09-16 <axel.hahn@iml.unibe.ch> read error before closing socket.
* 2022-11-22 <axel.hahn@iml.unibe.ch> Use exec with detecting MS Win for the ping parameter for count of pings
* 2024-07-23 <axel.hahn@unibe.ch> php 8 only: use typed variables
* 2025-03-19 <axel.hahn@unibe.ch> add validation rules and parameter description
*/
class checkPing extends appmonitorcheck
{
/**
* Self documentation and validation rules
* @var array
*/
protected array $_aDoc = [
'name' => 'Plugin Ping',
'description' => 'Check if a given host can be pinged.',
'parameters' => [
'host' => [
'type' => 'string',
'required' => false,
'description' => 'Hostname to ping; default: 127.0.0.1',
'regex' => '/^[a-z0-9\_\-\.]/i',
// doc
'default' => "127.0.0.1",
'example' => 'www.example.com',
],
],
];
/**
* Get default group of this check
* @return string
......
......@@ -22,10 +22,46 @@
* 2022-09-16 <axel.hahn@iml.unibe.ch> read error before closing socket.
* 2022-12-05 <axel.hahn@unibe.ch> add @ sign at socket functions to prevent warning
* 2024-07-23 <axel.hahn@unibe.ch> php 8 only: use typed variables
*
* 2025-03-19 <axel.hahn@unibe.ch> add validation rules and parameter description
*/
class checkPortTcp extends appmonitorcheck
{
/**
* Self documentation and validation rules
* @var array
*/
protected array $_aDoc = [
'name' => 'Plugin PortTcp',
'description' => 'Check if the local server or another host is listening to a given port number.',
'parameters' => [
'host' => [
'type' => 'string',
'required' => true,
'description' => 'optional: hostname to connect to; if unavailable 127.0.0.1 will be tested',
'regex' => '/./',
// doc
'default' => null,
'example' => 'mysql:host=$aDb[server];port=3306;dbname=$aDb[database]',
],
'port' => [
'type' => 'int',
'required' => true,
'description' => 'port number to check',
'default' => null,
'validate' => 'portnumber',
'example' => '22',
],
'timeout' => [
'type' => 'int',
'required' => false,
'description' => 'optional timeout in sec; default: 5',
'default' => 5,
'example' => '3',
],
],
];
/**
* Get default group of this check
* @return string
......
......@@ -19,10 +19,60 @@
*
* 2021-10-27 <axel.hahn@iml.unibe.ch>
* 2024-07-23 <axel.hahn@unibe.ch> php 8 only: use typed variables
*
* 2025-03-19 <axel.hahn@unibe.ch> add validation rules and parameter description
*/
class checkSimple extends appmonitorcheck
{
/**
* Self documentation and validation rules
* @var array
*/
protected array $_aDoc = [
'name' => 'Plugin Simple',
'description' => 'Check loaded php modules',
'parameters' => [
'value' => [
'type' => 'string',
'required' => true,
'description' => 'Ouput text to describe the result',
'default' => "",
'example' => 'My simple example',
],
'result' => [
'type' => 'int',
'required' => true,
'description' => 'Result value to return',
'min' => RESULT_OK,
'max' => RESULT_ERROR,
// doc
'default' => RESULT_OK,
'example' => '0 (for "ok")',
],
'type' => [
'type' => 'string',
'required' => false,
'description' => 'Type of the rendetred tile',
'oneof' => ["counter"],
'default' => null,
'example' => 'counter',
],
'count' => [
'type' => 'float',
'required' => false,
'description' => 'If a count exists in a check then a tile will be rendered as a tile',
'default' => null,
'example' => '3.14',
],
'visual' => [
'type' => 'string',
'required' => false,
'description' => 'Visualize count value with "simple", "line", "bar,<width>,<count>"',
'default' => null,
'example' => 'bar,3,100',
],
],
];
/**
* Most simple check: set given values
......@@ -36,8 +86,8 @@ class checkSimple extends appmonitorcheck
* brainstorming for a future release
*
* "counter" optioal: array of counter values
* - label string a label
* - value float a number
* - type string a label
* - count float a number
* - type string one of simple | bar | line
* @return array
*/
......
......@@ -19,10 +19,54 @@
*
* 2021-10-27 <axel.hahn@iml.unibe.ch>
* 2024-07-23 <axel.hahn@unibe.ch> php 8 only: use typed variables
*
* 2025-03-19 <axel.hahn@unibe.ch> add validation rules and parameter description
*/
class checkSqliteConnect extends appmonitorcheck
{
/**
* Self documentation and validation rules
* @var array
*/
protected array $_aDoc = [
'name' => 'Plugin SqliteConnect',
'description' => 'Verify a database connection with PDO connect',
'parameters' => [
'db' => [
'type' => 'string',
'required' => true,
'description' => 'full path of the sqlite database file',
'regex' => '/./',
// doc
'default' => null,
'example' => 'mysql:host=$aDb[server];port=3306;dbname=$aDb[database]',
],
'user' => [
'type' => 'string',
'required' => false,
'description' => 'Database user to connect with',
'default' => null,
'example' => 'dbuser',
],
'password' => [
'type' => 'string',
'required' => false,
'description' => 'Password of the database user to authenticate',
'default' => null,
'example' => 'mySecretDatabasePassword',
],
'timeout' => [
'type' => 'float',
'required' => false,
'description' => 'Timeout in sec',
'default' => 5,
'example' => '3',
],
],
];
/**
* Get default group of this check
* @return string
......