ResourceDefinition
uris
/redfish/v1/Managers/manager_id/SnmpService
properties
| 名称 | 类型 | 是否只读 | 取值范围/枚举值 | 说明 |
|---|---|---|---|---|
| @odata.context | string | true | SNMP资源模型的OData描述信息 | |
| @odata.id | string | true | SNMP资源节点的访问路径 | |
| @odata.type | string | true | SNMP资源类型 | |
| Name | string | true | SNMP资源的名称 | |
| Id | string | true | SNMP资源的ID | |
| SnmpV1Enabled | boolean | false | SNMP协议版本1使能状态 | |
| SnmpV2CEnabled | boolean | false | SNMP协议版本2使能状态 | |
| SnmpV3Enabled | boolean | false | SNMP协议版本3使能状态 | |
| SnmpV1V2CLoginRule | array | false | 成员是字符串,取值如下 ● Rule1 ● Rule2 ● Rule3 | |
| LongPasswordEnabled | boolean | false | 超长口令使能状态 | |
| RWCommunityEnabled | boolean | false | 读写团体名使能状态 | |
| ReadOnlyCommunity | null或字符串 | false | 只读团体名说明自BMC300 5.5.0.1版本后, 该信息更改为非敏感信息, 可查询明文值。BMC300 5.5.0.1版本前该信息显示为null,仅可以进行PATCH操作。 | |
| ReadWriteCommunity | null或字符串 | false | 读写团体名说明自BMC300 5.5.0.1版本后, 该信息更改为非敏感信息, 可查询明文值。BMC300 5.5.0.1版本前该信息显示为null,仅可以进行PATCH操作。 | |
| SnmpV3AuthUser | array | false | ● 具有用户配置权限的BMC用户显示所有用户名 ● 无配置自身权限的用户显示null ● 其他用户只显示自身用户名 | |
| SnmpV3EngineID | string | true | SNMP v3引擎ID | |
| TrapMode | string | false | Trap报文模式 ● OID:OID模式 ● PreciseAlarm:精准告警模式 | |
| ServiceEnabled | boolean | false | Trap功能使能状态 | |
| TrapVersion | string | false | Trap版本 | |
| TrapV3User | string | false | V3用户名 | |
| TrapServerIdentity | string | false | 主机标识 | |
| CommunityName | null | false | 团体名(此属性包含敏感信息,显示为null,可以进行PATCH操作) | |
| AlarmSeverity | null或字符串 | false | 告警发送级别 ● Critical (紧急) ● Major (严重及以上) ● Minor (轻微及以上) ● Normal (正常及以上) ● null (不发送告警) | |
| ReportType | 枚举 | false | 上报事件类型: ● OemEvent:自定义事件 ● SEL:传感器事件 | |
| MemberId | string | false | 数组序号 | |
| BobEnabled | boolean | false | 带内转发使能状态 | |
| Enabled | boolean | false | 服务器使能状态 | |
| TrapServerAddress | string | false | 服务器地址 | |
| TrapServerPort | number | false | 服务器端口号 | |
| PasswordRulePolicy | string | false | 密码校验规则: ● Default:默认密码复杂度校验 ● Customized:自定义正则校验 ● Hybrid:两种校验模式共同生效 | |
| PasswordPattern | string | false | 密码校验正则表达式 | |
| target | string | true | 操作路径 | |
| @Redfish.ActionInfo | string | true | 操作查询路径 | |
| #SnmpService.ConfigSnmpV3PrivPasswd | object | true | 设置指定用户的snmpv3加密密码 | |
| LoginRule | array | true | 登录规则 | |
| SystemContact | string | false | 信息产品联系人 | |
| SystemLocation | string | false | 位置 | |
| #SnmpService.SubmitTestEvent | object | true | 发送测试事件 | |
| code | string | true | 指示消息注册表中特定消息ID的字符串。 | |
| message | string | true | 与消息注册表中的消息对应的易读的错误消息。 | |
| @Message.ExtendedInfo | string | true | 错误消息扩展信息 | |
| MessageId | string | true | 消息ID | |
| RelatedProperties | array | true | 消息相关属性 | |
| Message | string | true | 详细信息 | |
| MessageArgs | array | true | 信息参数 | |
| Severity | string | true | 严重性Redfish支持的严重级别包括:OK、Warning、Critical。 | |
| Resolution | string | true | 解决建议 |
supported_methods
- GET
- PATCH
- POST
HTTP methods
GET
命令功能
查询 SNMP 资源信息
命令格式
URL: https://device_ip/redfish/v1/Managers/manager_id/SnmpService
请求头:
X-Auth-Token: auth_value请求消息体: 无
参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| device_ip | 登录设备的IP地址 | IPv4或IPv6地址 |
| auth_value | 请求消息的鉴权参数 | 可通过/redfish/v1/SessionService/Sessions创建会话时获得 |
使用指南
GA140C机型不支持
使用实例
请求样例: GET https://device_ip/redfish/v1/Managers/manager_id/SnmpService
X-Auth-Token: auth_value 请求消息体:无
响应样例:
{
"@odata.context": "/redfish/v1/$metadata#Managers/Members/1/SnmpService/$entity",
"@odata.id": "/redfish/v1/Managers/1/SnmpService",
"@odata.type": "#HwSnmpService.v1_0_0.HwSnmpService",
"Name": "SnmpService",
"Id": "SnmpService",
"SnmpV1Enabled": false,
"SnmpV2CEnabled": false,
"SnmpV3Enabled": true,
"SnmpV1V2CLoginRule": [
"Rule1"
],
"LongPasswordEnabled": true,
"RWCommunityEnabled": true,
"ReadOnlyCommunity": null,
"ReadWriteCommunity": null,
"SnmpV3AuthUser": [
"Administrator",
"test_user"
],
"SnmpV3EngineID": "0x80001f880300180a0a0168d72c",
"SnmpTrapNotification": {
"ServiceEnabled": true,
"TrapVersion": "V1",
"TrapV3User": "root",
"TrapServerIdentity": "BoardSN",
"CommunityName": null,
"AlarmSeverity": "Normal",
"TrapServer": [
{
"MemberId": "0",
"BobEnabled": true,
"Enabled": false,
"TrapServerAddress": "",
"TrapServerPort": 162
},
{
"MemberId": "1",
"BobEnabled": true,
"Enabled": false,
"TrapServerAddress": "",
"TrapServerPort": 162
},
{
"MemberId": "2",
"BobEnabled": true,
"Enabled": false,
"TrapServerAddress": "",
"TrapServerPort": 162
},
{
"MemberId": "3",
"BobEnabled": true,
"Enabled": false,
"TrapServerAddress": "",
"TrapServerPort": 162
}
],
"TrapMode": "PreciseAlarm"
},
"PasswordRulePolicy": "Default",
"PasswordPattern": "",
"Actions": {
"#SnmpService.SubmitTestEvent": {
"target": "/redfish/v1/Managers/1/SnmpService/Actions/SnmpService.SubmitTestEvent",
"@Redfish.ActionInfo": "/redfish/v1/Managers/1/SnmpService/SubmitTestEventActionInfo"
},
"#SnmpService.ConfigSnmpV3PrivPasswd": {
"target": "/redfish/v1/Managers/Blade2/SnmpService/Actions/SnmpService.ConfigSnmpV3PrivPasswd",
"@Redfish.ActionInfo": "/redfish/v1/Managers/Blade2/SnmpService/ConfigSnmpV3PrivPasswdActionInfo"
}
},
"Links": {
"LoginRule": [
{
"@odata.id": "/redfish/v1/Managers/1#/Oem/Public/LoginRule/0"
},
{
"@odata.id": "/redfish/v1/Managers/1#/Oem/Public/LoginRule/1"
},
{
"@odata.id": "/redfish/v1/Managers/1#/Oem/Public/LoginRule/2"
}
]
},
"SystemContact": "",
"SystemLocation": null,
"ReportType": "SEL"
}响应码:200
PATCH
命令功能
修改 SNMP 资源属性
命令格式
URL: https://device_ip/redfish/v1/Managers/manager_id/SnmpService
请求头:
X-Auth-Token: auth_value
Content-Type: header_type
If-Match: ifmatch_value请求消息体:
{
"SnmpV1Enabled": SnmpV1Enabled,
"SnmpV2CEnabled": SnmpV2CEnabled,
"SnmpV3Enabled": SnmpV3Enabled,
"SnmpV1V2CLoginRule": login_rule,
"LongPasswordEnabled": LongPasswordEnabled,
"RWCommunityEnabled": RWCommunityEnabled,
"ReadWriteCommunity": ReadWriteCommunity,
"ReadOnlyCommunity": ReadOnlyCommunity,
"SnmpTrapNotification": {
"ServiceEnabled": ServiceEnabled,
"TrapVersion": TrapVersion,
"TrapV3User": TrapV3User,
"TrapServerIdentity": TrapServerIdentity,
"CommunityName": CommunityName,
"AlarmSeverity": AlarmSeverity,
"TrapMode": "TrapMode",
"TrapServer": [
{
"BobEnabled": BobEnabled,
"Enabled": Enabled,
"TrapServerAddress": TrapServerAddress,
"TrapServerPort": TrapServerPort
}
]
},
"SystemContact": "",
"SystemLocation": SystemLocation_value,
"ReportType": ReportType_value,
"PasswordRulePolicy": PasswordRulePolicy_value,
"PasswordPattern": PasswordPattern_value
}请求头参数说明
参见 请求头参数说明
请求体参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| ifmatch_value | 请求消息的匹配参数 | 可通过对相应资源发起GET操作,从响应头中获取(对应于“ETag”参数) |
| SnmpV1Enabled | SNMP协议版本1使能状态 | ● true ● false |
| SnmpV2CEnabled | SNMP协议版本2使能状态 | ● true ● false |
| SnmpV3Enabled | SNMP协议版本3使能状态 | ● true ● false |
| SnmpV1V2CLoginRule | 登录规则,类型是字符串数组 | 字符串数组,数组元素支持以下值: ● Rule1 ● Rule2 ● Rule3 |
| LongPasswordEnabled | 超长口令使能状态 | ● true ● false |
| RWCommunityEnabled | 读写团体名使能状态 | ● true ● false |
| ReadOnlyCommunity | 只读团体名 | 字符串,格式要求: ● 不能包含空格 ● 空字符串时,可删除只读团体名 ● 长度要求: 默认长度1 ~ 32字节, 开启超长口令后16 ~ 32字节 ● 密码复杂度校验: 开启时,长度最少为8字节;至少包含两种字符的组合(小写字符、 大写字符、数字、特殊字符) ● 只读团体名和读写团体名互不能相同 |
| ReadWriteCommunity | 读写团体名 | 字符串,格式要求: ● 不能包含空格 ● 空字符串时,可删除读写团体名 ● 长度要求: 默认长度1 ~ 32字节, 开启超长口令后16 ~ 32字节 ● 密码复杂度校验: 开启时,长度最少为8字节;至少包含两种字符的组合(小写字符、 大写字符、数字、特殊字符) ● 只读团体名和读写团体名互不能相同 |
| TrapMode | Trap报文模式 | ● OID:OID模式 ● PreciseAlarm:精准告警模式 |
| ServiceEnabled | Trap功能使能状态 | ● true ● false |
| TrapVersion | Trap版本 | ● V1 ● V2C ● V3 |
| TrapV3User | V3用户名 | 已存在的本地用户名 (当TrapVersion为V3时有效) |
| TrapServerIdentity | 主机标识 | ● BoardSN (单板序列号) ● ProductAssetTag (产品资产标签) ● HostName (主机名) (TrapMode选择精准告警模式时有效) |
| CommunityName | 团体名 | 字符串,格式要求: ● trap版本为v3时不允许设置trap团体名 ● 密码复杂度校验: 开启时,至少两种字符的组合(小写字符、大写字符、数字、特殊字符);长度要求8– 32字节; 关闭时,长度要求1–32字节 ● 不能包含空格说明 ● 如果使用SNMPv3 trap,团体名称无效 ● BMC300 5.0.0及以上版本,团体名最大字符长度由18字节扩展到32字节 |
| AlarmSeverity | 告警发送级别 | ● Critical (紧急) ● Major (严重及以上) ● Minor (轻微及以上) ● Normal (正常及以上) ● null (不发送告警) |
| ReportType | 上报事件类型 | ● OemEvent:自定义事件 ● SEL:传感器事件 |
| BobEnabled | 带内转发使能状态 | ● true ● false |
| Enabled | 服务器使能状态 | ● true ● false |
| TrapServerAddress | 服务器地址 | IPV4、IPV6地址或域名字符串 |
| TrapServerPort | 服务器端口号 | 数字范围在1-65535之间 |
| SystemContact | 信息产品联系人 | 字符串 |
| SystemLocation_value | 位置 | 字符串 |
| PasswordRulePolicy_value | 密码校验规则 | ● Default:默认密码复杂度校验 ● Customized:自定义正则校验 ● Hybrid:两种校验模式共同生效 |
| PasswordPattern_value | 密码校验正则表达式 | 带有起始符(^)和终止符的 ($)的正则表达式长度0-255 |
使用指南
GA140C机型不支持
使用实例
请求样例: PATCH https://device_ip/redfish/v1/Managers/manager_id/SnmpService
X-Auth-Token: auth_value Content-Type: header_type If-Match: ifmatch_value 请求消息体:
{
"SnmpV1Enabled": SnmpV1Enabled,
"SnmpV2CEnabled": SnmpV2CEnabled,
"SnmpV3Enabled": SnmpV3Enabled,
"SnmpV1V2CLoginRule": login_rule,
"LongPasswordEnabled": LongPasswordEnabled,
"RWCommunityEnabled": RWCommunityEnabled,
"ReadWriteCommunity": ReadWriteCommunity,
"ReadOnlyCommunity": ReadOnlyCommunity,
"SnmpTrapNotification": {
"ServiceEnabled": ServiceEnabled,
"TrapVersion": TrapVersion,
"TrapV3User": TrapV3User,
"TrapServerIdentity": TrapServerIdentity,
"CommunityName": CommunityName,
"AlarmSeverity": AlarmSeverity,
"TrapMode": "TrapMode",
"TrapServer": [
{
"BobEnabled": BobEnabled,
"Enabled": Enabled,
"TrapServerAddress": TrapServerAddress,
"TrapServerPort": TrapServerPort
}
]
},
"SystemContact": "",
"SystemLocation": SystemLocation_value,
"ReportType": ReportType_value,
"PasswordRulePolicy": PasswordRulePolicy_value,
"PasswordPattern": PasswordPattern_value
}响应样例:
{
"@odata.context": "/redfish/v1/$metadata#Managers/Members/1/SnmpService/$entity",
"@odata.id": "/redfish/v1/Managers/1/SnmpService",
"@odata.type": "#HwSnmpService.v1_0_0.HwSnmpService",
"Name": "SnmpService",
"Id": "SnmpService",
"SnmpV1Enabled": false,
"SnmpV2CEnabled": false,
"SnmpV3Enabled": true,
"LongPasswordEnabled": false,
"ReadOnlyCommunity": null,
"ReadWriteCommunity": null,
"SnmpV3AuthUser": [
"Administrator",
"test_user"
],
"SnmpV3EngineID": "0x80001f880300180a0a0168d72c",
"SnmpTrapNotification": {
"ServiceEnabled": false,
"TrapVersion": "V1",
"TrapV3User": "root",
"TrapServerIdentity": "BoardSN",
"CommunityName": null,
"AlarmSeverity": "Normal",
"TrapServer": [
{
"BobEnabled": true,
"MemberId": "0",
"Enabled": true,
"TrapServerAddress": "192.168.44.1",
"TrapServerPort": 162
},
{
"BobEnabled": true,
"MemberId": "1",
"Enabled": false,
"TrapServerAddress": "",
"TrapServerPort": 162
},
{
"BobEnabled": true,
"MemberId": "2",
"Enabled": false,
"TrapServerAddress": "",
"TrapServerPort": 162
},
{
"BobEnabled": true,
"MemberId": "3",
"Enabled": false,
"TrapServerAddress": "",
"TrapServerPort": 162
}
],
"TrapMode": "PreciseAlarm"
},
"PasswordRulePolicy": "Default",
"PasswordPattern": "",
"Actions": {
"#SnmpService.SubmitTestEvent": {
"target": "/redfish/v1/Managers/1/SnmpService/Actions/SnmpService.SubmitTestEvent",
"@Redfish.ActionInfo": "/redfish/v1/Managers/1/SnmpService/SubmitTestEventActionInfo"
},
"#SnmpService.ConfigSnmpV3PrivPasswd": {
"target": "/redfish/v1/Managers/Blade2/SnmpService/Actions/SnmpService.ConfigSnmpV3PrivPasswd",
"@Redfish.ActionInfo": "/redfish/v1/Managers/Blade2/SnmpService/ConfigSnmpV3PrivPasswdActionInfo"
}
},
"Links": {
"LoginRule": [
{
"@odata.id": "/redfish/v1/Managers/1#/Oem/Public/LoginRule/0"
},
{
"@odata.id": "/redfish/v1/Managers/1#/Oem/Public/LoginRule/1"
},
{
"@odata.id": "/redfish/v1/Managers/1#/Oem/Public/LoginRule/2"
}
]
},
"SystemContact": "",
"SystemLocation": "shanghai",
"ReportType": "SEL"
}响应码:200
POST (ACTION)
ConfigSnmpV3PrivPasswd
命令功能
修改指定用户 SNMP v3 加密密码
命令格式
URL: https://device_ip/redfish/v1/Managers/manager_id/SnmpService/Actions/SnmpService.ConfigSnmpV3PrivPasswd
请求头:
X-Auth-Token: auth_value
Content-Type: header_type请求消息体:
{
"SnmpV3AuthUser": user_value,
"SnmpV3PrivPasswd": password_value
}请求头参数说明
参见 请求头参数说明
请求体参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| user_value | Snmpv3鉴权用户名 | 字符串,格式要求: ● 具有用户配置权限的BMC用户可设置任何一个本地用户名 ● 无配置自身权限的用户无权限使用该功能 ● 其他用户仅可设置自身用户名 |
| password_value | 被用于SNMPv3鉴权的用户的加密密码 | 字符串, 取值原则: 关闭密码检查功能后,密码不能为空,可以是任意字符组成的长度不大于20的字符串。 启用密码检查功能后,密码复杂度要求: 长度为8 ~ 20个字符。 至少包含一个空格或者以下特殊字符:“`~!@#$ %^&*()-_=+\ |
使用指南
GA140C机型不支持
使用实例
请求样例: POST https://device_ip/redfish/v1/Managers/manager_id/SnmpService/Actions/SnmpService.ConfigSnmpV3PrivPasswd
X-Auth-Token: auth_value Content-Type: header_type 请求消息体:
{
"SnmpV3AuthUser": user_value,
"SnmpV3PrivPasswd": password_value
}响应样例:
{
"error": {
"code": "Base.1.0.GeneralError",
"message": "A general error has occurred. See ExtendedInfo for more information.",
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"MessageId": "Base.1.0.Success",
"RelatedProperties": [],
"Message": "Successfully Completed Request",
"MessageArgs": [],
"Severity": "OK",
"Resolution": "None"
}
]
}
}响应码:200
POST (ACTION)
SubmitTestEvent
命令功能
SNMP 发送测试事件
命令格式
URL: https://device_ip/redfish/v1/Managers/manager_id/SnmpService/Actions/SnmpService.SubmitTestEvent
请求头:
X-Auth-Token: auth_value
Content-Type: header_type请求消息体:
{
"MemberId": value
}请求头参数说明
参见 请求头参数说明
请求体参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| value | Trap服务器编号 | 字符串,格式要求:0、1、2、3 |
使用指南
GA140C机型不支持
使用实例
请求样例: POST https://device_ip/redfish/v1/Managers/manager_id/SnmpService/Actions/SnmpService.SubmitTestEvent
X-Auth-Token: auth_value Content-Type: header_type 请求消息体:
{
"MemberId": value
}响应样例:
{
"error": {
"code": "Base.1.0.GeneralError",
"message": "A general error has occurred. See ExtendedInfo for more information.",
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"MessageId": "Base.1.0.Success",
"RelatedProperties": [],
"Message": "Successfully Completed Request",
"MessageArgs": [],
"Severity": "OK",
"Resolution": "None"
}
]
}
}响应码:200