https://github.com/brennerm/check-mk-web-api
Python library to talk to the Check_Mk Web API
https://github.com/brennerm/check-mk-web-api
api-wrapper checkmk python
Last synced: 6 months ago
JSON representation
Python library to talk to the Check_Mk Web API
- Host: GitHub
- URL: https://github.com/brennerm/check-mk-web-api
- Owner: brennerm
- License: mit
- Archived: true
- Created: 2017-03-10T20:49:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-08-02T20:18:14.000Z (almost 5 years ago)
- Last Synced: 2026-01-05T03:07:09.962Z (6 months ago)
- Topics: api-wrapper, checkmk, python
- Language: Python
- Homepage: https://brennerm.github.io/check-mk-web-api/
- Size: 5.13 MB
- Stars: 53
- Watchers: 10
- Forks: 26
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# check-mk-web-api [](https://travis-ci.org/brennerm/check-mk-web-api)
## supported Checkmk versions
- 1.6.0
- 1.5.0
## Installation
- From source code
```
git clone https://github.com/brennerm/check-mk-web-api
cd check-mk-web-api
sudo python setup.py install
```
- With pip
```
pip install check_mk_web_api
```
## [API Documentation](https://brennerm.github.io/check-mk-web-api/check_mk_web_api/)
## Quickstart
#### Initialization
```
import check_mk_web_api
api = check_mk_web_api.WebApi('http://checkmk.company.com/check_mk/webapi.py', username='automation', secret='123456')
```
#### Add Host
```
>>> api.add_host('webserver00.com')
```
#### Add Host in an existing WATO folder
```
>>> api.add_host('webserver00.com', folder='webservers')
```
Note there is no leading '/' on the folder name.
#### Edit Host
```
>>> api.edit_host('webserver00.com', ipaddress='192.168.0.100')
```
#### Delete Host
```
>>> api.delete_host('webserver00.com')
```
#### Delete Hosts
```
>>> api.delete_hosts(['webserver00.com', 'webserver01.com' ])
```
#### Get Host
```
>>> api.get_host('webserver00.com')
{
'hostname': 'webserver00.com',
'attributes': {
'ipaddress': '192.168.0.100'
},
'path': ''
}
```
#### Get All Hosts
```
>>> api.get_all_hosts()
{
'webserver00.com': {
'hostname': 'webserver00.com',
'attributes': {
'ipaddress': '192.168.0.100'
},
'path': ''
},
'webserver01.com': {
'hostname': 'webserver01.com',
'attributes': {
'ipaddress': '192.168.0.101'
},
'path': ''
}
}
```
#### Discover Services
```
>>> api.discover_services('webserver00.com')
{'removed': '0', 'new_count': '16', 'added': '16', 'kept': '0'}
```
#### Bake Agents
```
>>> api.bake_agents()
```
#### Activate Changes
```
>>> api.activate_changes()
```