{"id":26430432,"url":"https://github.com/i-doit/checkmk-web-api-client-php","last_synced_at":"2025-03-18T05:31:48.888Z","repository":{"id":28236478,"uuid":"117674499","full_name":"i-doit/checkmk-web-api-client-php","owner":"i-doit","description":"Easy-to-use, but feature-rich client library for Check_MK's Web API","archived":false,"fork":false,"pushed_at":"2022-08-18T08:54:56.000Z","size":400,"stargazers_count":9,"open_issues_count":4,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-30T09:18:07.663Z","etag":null,"topics":["api","checkmk","inventory","monitoring","php","wato"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i-doit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2018-01-16T11:21:35.000Z","updated_at":"2024-06-15T12:15:45.000Z","dependencies_parsed_at":"2022-07-05T20:41:19.834Z","dependency_job_id":null,"html_url":"https://github.com/i-doit/checkmk-web-api-client-php","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-doit%2Fcheckmk-web-api-client-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-doit%2Fcheckmk-web-api-client-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-doit%2Fcheckmk-web-api-client-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-doit%2Fcheckmk-web-api-client-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-doit","download_url":"https://codeload.github.com/i-doit/checkmk-web-api-client-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244164906,"owners_count":20409007,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","checkmk","inventory","monitoring","php","wato"],"created_at":"2025-03-18T05:31:14.807Z","updated_at":"2025-03-18T05:31:48.873Z","avatar_url":"https://github.com/i-doit.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Checkmk Web API Client\n\nEasy-to-use, but feature-rich client for Checkmk Web API\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/idoit/checkmkwebapiclient.svg)](https://packagist.org/packages/idoit/checkmkwebapiclient)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%5E7.4%7C%5E8.0-8892BF.svg)](https://php.net/)\n[![Build status](https://github.com/i-doit/checkmk-web-api-client-php/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/i-doit/checkmk-web-api-client-php/actions)\n\n**Please note: This project is not an official product by synetics GmbH. synetics GmbH doesn't provide any commercial support.**\n\n## About\n\n[Checkmk](https://checkmk.com/) is a software application for network monitoring. The community edition (\"raw\") is licensed under the GPLv2.\n\nThis client communicates with Checkmk over its Web API. It provides a simple, but powerful abstraction layer for written in PHP. Feel free to use it as a library in your own projects.\n\n## Requirements\n\nMeet these simple requirements before using the client:\n\n-   One or more Checkmk sites, version `1.4` or higher (most calls work since `1.5`)\n-   PHP, version `8.0` or higher (`8.1` is recommended, `7.4` should work but is deprecated)\n-   PHP modules `curl`, `date`, `json`, `openssl`, `spl` and `zlib`\n\n## Installation\n\nIt is recommended to install this client via [Composer](https://getcomposer.org/). Change to your project's root directory and fetch the latest stable version:\n\n~~~ {.bash}\ncomposer require idoit/checkmkwebapiclient\n~~~\n\nThis command installs the latest stable version. Instead of sticking to a specific/minimum version you may switch to the current development branch by using `@DEV`:\n\n~~~ {.bash}\ncomposer require \"idoit/checkmkwebapiclient=@DEV\"\n~~~\n\n## Updates\n\nComposer has the great advantage (besides many others) that you can simply update the client by running:\n\n~~~ {.bash}\ncomposer update\n~~~\n\n## Usage\n\nComposer comes with its own autoloader. Include this line into your PHP code:\n\n~~~ {.php}\nrequire_once 'vendor/autoload.php';\n~~~\n\nThis is it. All other files will be auto-loaded on-the-fly if needed.\n\n## First call\n\nThis is a simple \"Hello, world!\" example. It fetches all configured hosts from Checkmk:\n\n~~~ {.php}\nuse Idoit\\CheckmkWebAPIClient\\API;\nuse Idoit\\CheckmkWebAPIClient\\Config;\nuse Idoit\\CheckmkWebAPIClient\\Host;\n\n$config = new Config();\n$config\n    -\u003esetURL('https://monitoring.example.org/mysite/check_mk/')\n    -\u003esetUsername('automation')\n    -\u003esetSecret('abc123');\n\n$api = new API($config);\n\n$request = new Host($api);\n$hosts = $request-\u003egetAll();\n\nvar_dump($hosts);\n~~~\n\n## Configuration\n\nThe `API` class requires configuration settings passed to its constructor:\n\n~~~ {.php}\nuse Idoit\\CheckmkWebAPIClient\\API;\nuse Idoit\\CheckmkWebAPIClient\\Config;\n\n$config = new Config();\n$config\n    -\u003esetURL('https://monitoring.example.org/mysite/check_mk/')\n    -\u003esetPort(443)\n    -\u003esetUsername('automation')\n    -\u003esetSecret('abc123')\n    -\u003eenableProxy()\n    //-\u003edisableProxy()\n        -\u003euseHTTPProxy()\n        //-\u003euseSOCKS5Proxy()\n        -\u003esetProxyHost('proxy.example.net')\n        -\u003esetProxyPort(8080)\n        -\u003esetProxyUsername('proxyuser')\n        -\u003esetProxyPassword('verysecure');\n\n$api = new API($config);\n~~~\n\nThe `Config` class has public methods which must be called to configure the API:\n\n| Setting               | Parameter | Required  | Description                                                                                           |\n| --------------------- | --------- | --------- | ----------------------------------------------------------------------------------------------------- |\n| `setURL()`            | string    | yes       | URL to Checkmk *without* entry point, for example `https://monitoring.example.com/mysite/check_mk/`   |\n| `setPort()`           | integer   | no        | Port on which the Web server listens; if not set port `80` will be used for HTTP and `443` for HTTPS  |\n| `setUsername()`       | string    | yes       | User for authentication, probably `automation`                                                        |\n| `setSecret()`         | string    | yes       | Secret specified for user                                                                             |\n| `enableProxy()`       | –         | no        | Use a proxy between client and server; see below for details                                          |\n\nOptional proxy settings:\n\n| Setting               | Parameter | Required  | Description                                   |\n| --------------------- | --------- | --------- | --------------------------------------------- |\n| `disableProxy()`      | boolean   | no        | Disable proxy settings; this is the default   |\n| `useHTTPProxy()`      | –         | yes       | Use a HTTP(S) proxy                           |\n| `useSOCKS5Proxy()`    | –         | yes       | Use a SOCKS5 proxy                            |\n| `setProxyHost()`      | string    | yes       | FQDN or IP address to proxy                   |\n| `setProxyPort()`      | integer   | yes       | port on which the proxy server listens        |\n| `setProxyUsername()`  | string    | no        | Authenticate against proxy                    |\n| `setProxyPassword()`  | string    | no        | Specified password for authentication         |\n\n## Hosts\n\nClass `Host` with public methods:\n\n| API Call              | Class Method          | Description                                                               |\n| --------------------- | --------------------- | ------------------------------------------------------------------------- |\n| `get_host`            | `get()`               | Read information about a host by its hostname                             |\n| `get_all_hosts`       | `getAll()`            | Read information about all hosts                                          |\n| `add_host`            | `add()`               | Create new host with some attributes and tags                             |\n| `edit_host`           | `edit()`              | Edit host, adds new attributes, changes attributes, or unsets attributes  |\n| `delete_host`         | `delete()`            | Delete a host by its hostname                                             |\n| `discover_services`   | `discoverServices()`  | Discover services of a host                                               |\n\n## Sites\n\nClass `Site` with public methods:\n\n| API Call              | Class Method          | Description                                                       |\n| --------------------- | --------------------- | ------------------------------------------------------------------|\n| `get_site`            | `get()`               | Read information about a site by its identifier                   |\n| –                     | `getAll()`            | Read information about all sites                                  |\n\n## Folders\n\nClass `Folder` with public methods:\n\n| API Call              | Class Method          | Description                                                       |\n| --------------------- | --------------------- | ------------------------------------------------------------------|\n| `get_folder`          | `get()`               | Read information about a folder by its path                       |\n| `get_all_folders`     | `getAll()`            | Read information about all folders                                |\n| `add_folder`          | `add()`               | Create new folder with some attributes                            |\n| `edit_folder`         | `edit()`              | Edit a folder's attributes                                        |\n| `delete_folder`       | `delete()`            | Delete a folder by its path                                       |\n\n## Groups\n\nClasses `HostGroup`, `ServiceGroup` and `ContactGroup` with public methods:\n\n| API Call              | Class Method          | Description                                                       |\n| --------------------- | --------------------- | ------------------------------------------------------------------|\n| `get_all_*groups`     | `getAll()`            | Read information about all groups                                 |\n| –                     | `get()`               | Read information about a group by its name                        |\n| `add_*group`          | `add()`               | Create new group with name and alias                              |\n| `edit_*group`         | `edit()`              | Change the alias of a group                                       |\n| `delete_*group`       | `delete()`            | Delete contact group by its name                                  |\n\n## Host Tags\n\nClass `HostTag` with public methods:\n\n| API Call              | Class Method          | Description                                                       |\n| --------------------- | --------------------- | ------------------------------------------------------------------|\n| `get_hosttags`        | `getAll()`            | Read information about all host tag groups and auxiliary tags     |\n| `set_hosttags`        | `set()`               | Overwrite all host tag groups and auxiliary tags                  |\n\n## Users\n\nClass `Users` with public methods:\n\n| API Call              | Class Method          | Description                                                       |\n| --------------------- | --------------------- | ------------------------------------------------------------------|\n| –                     | `get()`               | Read information about an user by its identifier                  |\n| `get_all_users`       | `getAll()`            | Read information about all users                                  |\n| –                     | `add()`               | Create new user with some attributes                              |\n| `add_users`           | `batchAdd()`          | Create new users with some attributes                             |\n| –                     | `delete()`            | Delete a user by its identifier                                   |\n| `delete_users`        | `batchDelete()`       | Delete users by their identifiers                                 |\n\n## Rulesets\n\nClass `Ruleset` with public methods:\n\n| API Call              | Class Method          | Description                                                       |\n| --------------------- | --------------------- | ------------------------------------------------------------------|\n| `get_ruleset`         | `get()`               | Read information about a ruleset by its name                      |\n| `get_rulesets_info`   | `getAll()`            | Read information about all rulesets                               |\n\n## Agents\n\nClass `Agent` with public methods:\n\n| API Call              | Class Method          | Description                                                       |\n| --------------------- | --------------------- | ------------------------------------------------------------------|\n| `bake_agents`         | `bake()`              | Bake agents but not sign them                                     |\n\n## Activate Changes\n\nClass `Change` with public methods:\n\n| API Call              | Class Method          | Description                                                       |\n| --------------------- | --------------------- | ------------------------------------------------------------------|\n| `activate_changes`    | `activate()`          | Activate changes on specific sites                                |\n| –                     | `activateEverywhere`  | Activate changes on all sites                                     |\n\n## Metrics\n\nClass `Graph` with public method:\n\n| API Call              | Class Method          | Description                                                       |\n| --------------------- | --------------------- | ------------------------------------------------------------------|\n| `get_graph`           | `get()`               | Get metrics as a graph                                            |\n\n## Inventory\n\nCheckmk can collect various information about your hardware/software inventory.\n\nClass `Inventory` with public methods:\n\n| API Call              | Class Method          | Description                                                       |\n| --------------------- | --------------------- | ------------------------------------------------------------------|\n| -                     | `getHost()`           | Read hardware/software inventory data for a specific host         |\n| -                     | `getHosts()`          | Read hardware/software inventory data for one or more hosts       |\n\n## Contribute\n\nPlease, report any issues to [our issue tracker](https://github.com/i-doit/checkmk-web-api-client-php/issues). Pull requests are very welcomed. If you like to get involved see file [`CONTRIBUTING.md`](CONTRIBUTING.md) for details.\n\n## Copyright \u0026 License\n\nCopyright (C) 2022 [synetics GmbH](https://i-doit.com/)\n\nCopyright (C) 2018-22 [Benjamin Heisig](https://benjamin.heisig.name/)\n\nLicensed under the [GNU Affero GPL version 3 or later (AGPLv3+)](https://gnu.org/licenses/agpl.html). This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-doit%2Fcheckmk-web-api-client-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-doit%2Fcheckmk-web-api-client-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-doit%2Fcheckmk-web-api-client-php/lists"}