Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Check_MK exception: Unknown tag group snmp_community #40

Open
cboseck opened this issue Apr 23, 2021 · 3 comments
Open

Check_MK exception: Unknown tag group snmp_community #40

cboseck opened this issue Apr 23, 2021 · 3 comments

Comments

@cboseck
Copy link
Contributor

cboseck commented Apr 23, 2021

Hello,

I am facing the issue that you can't create a host with snmp-host.
The response from the exeption message says: "Check_MK exception: Unknown tag group snmp_community".

To reproduce this I created this test:

def test_add_host_with_attributes():
   api.add_host('host00', tags={'snmp_community': 'public', 'tag_snmp_ds': 'snmp-v2'})
   assert api.get_host('host00')['attributes']['snmp_community'] == 'public'
   assert api.get_host('host00')['attributes']['tag_snmp_ds'] == 'snmp-v2'

The problem is that always the 'tag_' prefix gets added so 'snmp_community' can't be found.

Removing this solved my problem.
I guess I could use the 'custom_attrs' param, but then I would need to build a special-case.
Is there a reason the the tag_ prefix gets added?

Have a nice day

@brennerm
Copy link
Owner

Hey @cboseck, thanks for reporting this issue. Which version of CheckMK are you using?

@cboseck
Copy link
Contributor Author

cboseck commented Apr 23, 2021

check-mk-raw:1.6.0p18

@brennerm
Copy link
Owner

Just did some research and read through the docs of the Web API add_host function. If I understand that section correctly tags are just special attributes identified by the tag_ prefix. According to that the implementation seems correct. Let me know if you see that differently.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants