Create SNMP traphosts
- PDF of this doc site
Collection of separate PDF docs
Creating your file...
POST /support/snmp/traphosts
Introduced In: 9.7
Creates SNMP traphosts. While adding an SNMPv3 traphost, an SNMPv3 user configured in ONTAP must be specified. ONTAP uses this user's credentials to authenticate and/or encrypt traps sent to this SNMPv3 traphost. While adding an SNMPv1/SNMPv2c traphost, SNMPv1/SNMPv2c user or community need not be specified.
Required properties
-
host
- Fully Qualified Domain Name (FQDN), IPv4 address or IPv6 address of SNMP traphost.
Recommended optional properties
-
If
host
refers to an SNMPv3 traphost, the following field is required:-
user
- SNMPv3 or User-based Security Model (USM) user.
-
-
For an SNMPv1/SNMPv2c traphost, ONTAP automatically uses 'public' if 'public' is configured or no community is configured. Otherwise, ONTAP uses the first configured community.
Related ONTAP commands
-
system snmp traphost add
Learn more
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
return_records |
boolean |
query |
False |
The default is false. If set to true, the records are returned.
|
Request Body
Name | Type | Description |
---|---|---|
_links |
||
host |
string |
Fully qualified domain name (FQDN), IPv4 address or IPv6 address of SNMP traphost. |
ip_address |
string |
IPv4 or IPv6 address |
user |
Optional SNMP user parameter. For an SNMPv3 traphost, this property refers to an SNMPv3 or User-based Security Model (USM) user. For an SNMPv1 or SNMPv2c traphost, this property refers to an SNMP community. |
Example request
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"host": "traphost.example.com",
"ip_address": "10.10.10.7",
"user": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "snmpv3user3"
}
}
Response
Status: 201, Created
Name | Type | Description |
---|---|---|
_links |
||
num_records |
integer |
Number of records. |
records |
array[snmp_traphost] |
Example response
{
"_links": {
"next": {
"href": "/api/resourcelink"
},
"self": {
"href": "/api/resourcelink"
}
},
"records": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"host": "traphost.example.com",
"ip_address": "10.10.10.7",
"user": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "snmpv3user3"
}
}
]
}
Error
Status: Default
ONTAP Error Response Codes
Error Code | Description |
---|---|
8847365 |
Unknown host. |
9043969 |
Duplicate traphost entry. |
9043980 |
IPv6 support is disabled. |
9043991 |
Not a USM user. |
9043993 |
Current cluster version does not support SNMPv3 traps. |
9044001 |
Failed to create SNMPv1 traphost. |
9044002 |
Failed to create SNMPv3 traphost. |
Name | Type | Description |
---|---|---|
error |
Example error
{
"error": {
"arguments": [
{
"code": "string",
"message": "string"
}
],
"code": "4",
"message": "entry doesn't exist",
"target": "uuid"
}
}
Definitions
See Definitions
href
Name | Type | Description |
---|---|---|
href |
string |
_links
Name | Type | Description |
---|---|---|
self |
user
Optional SNMP user parameter. For an SNMPv3 traphost, this property refers to an SNMPv3 or User-based Security Model (USM) user. For an SNMPv1 or SNMPv2c traphost, this property refers to an SNMP community.
Name | Type | Description |
---|---|---|
_links |
||
name |
string |
Optional SNMPv1/SNMPv2c or SNMPv3 user name. For an SNMPv3 traphost, this object refers to an SNMPv3 or User-based Security Model (USM) user. For an SNMPv1 or SNMPv2c traphost, this object refers to an SNMP community. For an SNMPv3 traphost, this object is mandatory and refers to an SNMPv3 or User-based Security Model (USM) user. For an SNMPv1 or SNMPv2c traphost, ONTAP automatically uses "public", if the same is configured, or any other configured community as user. So, for an SNMPv1 or SNMPv2c traphost, this property should not be provided in the "POST" method. However, the configured community for the SNMPv1/SNMPv2c traphost is returned by the "GET" method.
|
snmp_traphost
SNMP manager or host machine that receives SNMP traps from ONTAP.
Name | Type | Description |
---|---|---|
_links |
||
host |
string |
Fully qualified domain name (FQDN), IPv4 address or IPv6 address of SNMP traphost. |
ip_address |
string |
IPv4 or IPv6 address |
user |
Optional SNMP user parameter. For an SNMPv3 traphost, this property refers to an SNMPv3 or User-based Security Model (USM) user. For an SNMPv1 or SNMPv2c traphost, this property refers to an SNMP community. |
_links
Name | Type | Description |
---|---|---|
next |
||
self |
error_arguments
Name | Type | Description |
---|---|---|
code |
string |
Argument code |
message |
string |
Message argument |
error
Name | Type | Description |
---|---|---|
arguments |
array[error_arguments] |
Message arguments |
code |
string |
Error code |
message |
string |
Error message |
target |
string |
The target parameter that caused the error. |