SNMP

The below APIs are used to configure and validate the SNMP, which allows users to manage the Traps, Community, Threshold, SNMPV3 user creation and deletion.

Show SNMP Trap Status

Request URL

/api/info/snmp/trapstatus

Description

Use this API to show snmp trap status

Method

POST

Request Body

{

"version":2,

"server_id":1,

"community":"public",

"ip_address":"10.4.4.11"

}

Response Body

NA

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Show SNMP Users

Request URL

/api/info/snmp/users

Description

Use this API to show snmp users

Method

POST

Request Body

{

"version":2,

"server_id":1,

"community":"public",

"ip_address":"10.4.4.11"

}

Response Body

NA

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Configure SNMP Community

Request URL

/api/config/snmp-community

Description

Use this API to configure the SNMP community

Method

POST

Request Body

{"community":"Aviz"}

Response Body

NA

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Configure SNMP Trap

Request URL

/api/config/snmptrap

Description

Use this API to enable the SNMP Trap

Method

POST

Request Body

{

"version":2,

"server_id":1,

"community":"public",

"ip_address":"10.4.4.11"

}

Response Body

NA

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Configure SNMP Trap Threshold

Request URL

/api/config/snmp/threshold

Description

Use this API to configure threshold for trap generation of mem_util, cpu_util and disk_util

Method

POST

Request Body

{

"mem_util_threshold":"5",

"cpu_util_threshold":"8",

"disk_util_threshold":"10"

}

Response Body

NA

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Creating SNMPv3 User

Request URL

/api/config/snmp/users

Description

Use this API to create the SNMPv3 user

Method

POST

Request Body

{

"username":"testuser6",

"priv_type":"Priv",

"auth":"MD5",

"auth_pwd":"testuser4_auth_pass",

"enc":"AES",

"enc_pwd":"testuser3_encrypt_pass",

"access":"RO"

}

Response Body

NA

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Get SNMP Community detail

Request URL

/api/info/snmp-community

Description

Use this API to get the community details

Method

GET

Request Body

NA

Response Body

{

"public": {

"TYPE": "RO"

}

}

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Get SNMP Trap details

Request URL

/api/info/snmptrap

Description

Use this API to get the SNMP trap details

Method

GET

Request Body

NA

Response Body

{

"1": {

"DestPort": "161",

"v2TrapDest": "Null",

"DestIp": "10.4.4.11",

"vrf": "None",

"Community": "public"

}

}

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Get SNMP trap threshold details

Request URL

/api/info/snmp/threshold

Description

Use this API to get the details of threshold value for mem_utils, cpu_utils and disk_utils trap generation

Method

GET

Request Body

NA

Response Body

{

"disk_util_threshold": "5", "cpu_util_threshold": "8", "mem_util_threshold": "10"

}

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Get SNMPv3 user detail

Request URL

/api/info/snmp/users or. /api/info/snmp/users/<user-name>

Description

Use this API to get the SNMPv3 user details

Method

GET

Request Body

NA

Response Body

{

"authuser": {

"SNMP_USER_TYPE": "AuthNoPriv", "SNMP_USER_AUTH_PASSWORD": "authuser", "SNMP_USER_PERMISSION": "RW", "SNMP_USER_ENCRYPTION_TYPE": "", "SNMP_USER_AUTH_TYPE": "MD5", "SNMP_USER_ENCRYPTION_PASSWORD": ""

}

}

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Delete SNMP community

Request URL

/api/config/snmp-community/<community-name>

Description

Use this API to delete the configured SNMP community

Method

DELETE

Request Body

NA

Response Body

{

"Info": "SNMP-Community deleted successfully"

}

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Delete SNMP Trap

Request URL

/api/config/snmptrap/<server-id>

Description

Use this API to delete the SNMP trap configured

Method

DELETE

Request Body

NA

Response Body

{

"Info": "SNMP-Trap deleted successfully"

}

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Reset the SNMP trap threshold value

Request URL

/api/config/snmp/threshold/disk_util_threshold

/api/config/snmp/threshold/mem_util_threshold

/api/config/snmp/threshold/cpu_util_threshold

Description

Use this API to reset the threshold value for trap generation of mem_utils, cpu_utils and disk_utils

Method

DELETE

Request Body

NA

Response Body

{

"INFO": [

"disk utilization threshold deleted. Default threshold set"

]

}

{

"INFO": [

"memory utilization threshold deleted. Default threshold set"

]

}

{

"INFO": [

"cpu utilization threshold deleted. Default threshold set"

]

}

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Delete the SNMPv3 user

Request URL

/api/config/snmp/users/<user-name>

Description

Use this API to delete the SNMPv3 user configured

Method

DELETE

Request Body

NA

Response Body

{

"Info": "SNMP User deleted successfully"

}

Status Code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully