Hi
I am trying to create a host using the REST API (testing via Postman but will use python for production) and setting SNMPv3 attributes at the same time. I’ve manually configured a host with example config and then used the API to read the JSON representation of the attributes and then replicated the json list in a create host API request - eg below
POST https://checkmk/localsite/check_mk/api/v0/domain-types/host_config/collections/all
header: Accept: application/json
Body:
{
“folder”: “/”,
“host_name”: “example8.com”,
“attributes”: {
“ipaddress”: “192.168.0.18”,
“snmp_community”: [
“authPriv”,
“SHA-256”,
“SNMPV3USER”,
“authpass123”,
“DES”,
“privpass123”
],
“tag_snmp_ds”: “snmp-v2”
}
}
The result is as follows (it seems that the snmp_community field is string only and doesn’t accept a list of SNMPv3 parameters as is displayed when you do a fetch of a preconfigured host).
{
"title": "Bad Request",
"status": 400,
"detail": "These fields have problems: attributes",
"fields": {
"attributes": {
"snmp_community": [
"Not a valid string."
]
}
}
}
Is it possible to configure SNMPv3 via the new REST API?
If so, what is the correct format for the parameters please?
Thanks
Paul