Centreon Api for use Webservice in Centreon Web 2.8.0 or later
Project description
Make a Python LIB for Centreon API
Forked from https://github.com/centreon/centreon-sdk-python
Install
$ pip install centreonapi
Usages
Connect to Centreon platform
from centreonapi.centreon import Webservice
centreon = centreon("https://centreon.mydomain.tld, "admin", "centreon")
List all hosts on Centreon platform
centreon.hosts.list()
>>>
{
'Centeon-central': Centeon-central,
'server1': myserver1
}
Add new host
centreon.hosts.add(
name='server1',
alias='DBServ',
ip=127.0.0.1,
template="DB-Host-Template",
hg="DB Servers"
)
Get host
_, myhost = centreon.hosts.get('server1')
myhost.name
>>>
server1
Macros
Get macros
_, macros = myhost.getmacro()
macros
>>>
{
'$_HOSTMODULESTATSFILE$': $_HOSTMODULESTATSFILE$,
'$_HOSTMYSQLPASSWORD$': $_HOSTMYSQLPASSWORD$,
'$_HOSTMYSQLPORT$': $_HOSTMYSQLPORT$,
}
mymacro = macros.get('$_HOSTMYSQLPORT$')
mymacro.value
>>>
3306
Set Macros
myhost.setmacro('SECRETMACRO', 'pass', 1, 'secret macro pass')
HostTemplate on host
myhost.gettemplate()
>>>
{
'App-Monitoring-Centreon-Central-custom': App-Monitoring-Centreon-Central-custom,
'App-Monitoring-Centreon-Database-custom': App-Monitoring-Centreon-Database-custom,
'App-Monitoring-Centreon-Poller-custom': App-Monitoring-Centreon-Poller-custom
}
Documentation
Complete documentation here
Features
TODO
Documentation
The full documentation is at http://centreonapi.rtfd.org.
History
0.1.5 (2019-02-16)
Beta version
0.1.0 (2018-12-14)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
centreonapi-0.1.6.tar.gz
(19.3 kB
view hashes)
Built Distribution
Close
Hashes for centreonapi-0.1.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30d47eac7140ed0444b9bdabe888361b58b1f657419206113f1db04b6c7277e3 |
|
MD5 | 9dc6651dce6a846f25aded41ba96943b |
|
BLAKE2b-256 | aa44cfd806675aeee2a2c6035be7df31dc753b84404f6451335d7d7424e0f86c |