brennerm/check-mk-web-api

add host attributes

Closed this issue · 2 comments

Hey,

how i can add custom host attributes?

{'hostname': 'myserver123',
 'folder': '',
 'attributes': {'ipaddress': '192.168.0.42',
                'site': 'mysite',
                'parent': 'server01'
                'tag_agaent': 'cmk-agent'}}

greetings
sam

Hey @unclesamwk,

host attributes can be added like so:

# add new
>>> api.add_host('host00', foo='bar')
# edit existing
>>> api.edit_host('host00', foo='bars')

Closing this for now. Feel free to ask for further support.