警报操作
类别属性确定要定义的警报操作的类型。每个类别都定义了其自己的属性集。
支持的类别为:
-
ad
-
all
-
appliance_software
-
backup
-
cluster
-
custom
-
hardware
-
hardware_faults
-
ndmp
-
network
-
replication
-
replication_source
-
replication_target
-
restore
-
scrk
-
shadow
-
smf
-
thresholds
-
zfs_pool
表 3-3 警报操作 "ad"
|
|
|
active_directory_degraded
|
布尔型
|
过滤器应匹配 active_directory_degraded 事件 [true 或 false]
|
smb_kerberos_client_authentication_degraded
|
布尔型
|
过滤器应匹配 mb_kerberos_client_authentication_degraded 事件 [true 或 false]
|
|
表 3-4 警报操作 "all"
|
|
|
all_defects
|
布尔型
|
过滤器应匹配 all_defects 事件 [true、false]
|
service_alerts
|
布尔型
|
过滤器应匹配 service_alerts 事件 [true、false]
|
all_hardware_faults
|
布尔型
|
过滤器应匹配 all_hardware_fault 事件 [true、false]
|
|
表 3-5 警报操作 "appliance software"
|
|
|
obstacles_to_system_software_update
|
布尔型
|
过滤器应匹配 obstacles_to_system_software_update 事件 [true、false]
|
operating_system_kernel_panic
|
布尔型
|
过滤器应匹配 operating_system_kernel_panic 事件 [true 或 false]
|
|
表 3-6 警报操作 "backup"
|
|
|
backup_finished
|
布尔型
|
过滤器应匹配 backup_finished 事件 [true 或 false]
|
backup_started
|
布尔型
|
过滤器应匹配 backup_started 事件 [true 或 false]
|
|
表 3-7 警报操作 "cluster"
|
|
|
cluster_i /o_link_down
|
布尔型
|
过滤器应匹配 cluster_i /o_link_down 事件 [true 或 false]
|
cluster_i /o_link_failed
|
布尔型
|
过滤器应匹配 cluster_i /o_link_failed 事件 [true 或 false]
|
cluster_i /o_link_up
|
布尔型
|
过滤器应匹配 cluster_i /o_link_up 事件 [true 或 false]
|
unexpected_peer_error_occurred
|
布尔型
|
过滤器应匹配 unexpected_peer_error_occurred 事件 [true 或 false]
|
communication_t o_peer_lost
|
布尔型
|
过滤器应匹配 communication_to_peer_lost 事件 [true 或 false]
|
cluster_peer_panicked
|
布尔型
|
过滤器应匹配 cluster_peer_panicked 事件 [true 或 false]
|
failed_to_set_s p_root_password_on_cluster_peer
|
布尔型
|
过滤器应匹配 failed_to_set_sp_root_password_on_cluster_peer 事件 [true 或 false]
|
cluster_rejoin_failed_on_peer
|
布尔型
|
过滤器应匹配 cluster_rejoin_failed_on_peer 事件 [true 或 false]
|
cluster_rejoin_mismatch_on_peer
|
布尔型
|
过滤器应匹配 cluster_rejoin_mismatch_on_peer 事件 [true 或 false]
|
cluster_rejoin_completed_on_peer
|
布尔型
|
过滤器应匹配 cluster_rejoin_completed_on_peer 事件 [true 或 false]
|
cluster_peer_lost_communication_token
|
布尔型
|
过滤器应匹配 cluster_peer_lost_communication_token 事件 [true 或 false]
|
cluster_rejoin _failed
|
布尔型
|
过滤器应匹配 cluster_rejoin_failed 事件 [true 或 false]
|
cluster_rejoin_mismatch
|
布尔型
|
过滤器应匹配 cluster_rejoin_mismatch 事件 [true 或 false]
|
cluster_rejoin_completed
|
布尔型
|
过滤器应匹配 cluster_rejoin_completed 事件 [true 或 false]
|
cluster_takeover_complete
|
布尔型
|
过滤器应匹配 cluster_takeover_complete 事件 [true 或 false]
|
resource_import_failed_during_cluster_takeover
|
布尔型
|
过滤器应匹配 resource_import_failed_during_cluster_takeover 事件 [true 或 false]
|
local_cluster_communication_token_lost
|
布尔型
|
过滤器应匹配 local_cluster_communication_token_lost 事件 [true 或 false]
|
|
表 3-8 警报操作 "custom"
|
|
|
patterns
|
Default
|
FMA 事件模式
|
|
表 3-9 警报操作 "hardware"
|
|
|
fibre_channel_port_down
|
布尔型
|
过滤器应匹配 fibre_channel_port_down 事件 [true 或 false]
|
multiple_transient_fibre_channel_port_status _changes
|
布尔型
|
过滤器应匹配 multiple_transient_fibre_channel_port _status_changes 事件 [true 或 false]
|
transient_fibre_channel_port_status_change
|
布尔型
|
过滤器应匹配 transient_fibre_channel_port_status_change 事件 [true 或 false]
|
fibre_channel_port_up
|
布尔型
|
过滤器应匹配 fibre_channel_port_up 事件 [true 或 false]
|
network_port_down
|
布尔型
|
过滤器应匹配 network_port_down 事件 [true 或 false]
|
network_port_up
|
布尔型
|
过滤器应匹配 network_port_up 事件 [true 或 false]
|
chassis_connected_to_system
|
布尔型
|
过滤器应匹配 chassis_connected_to_system 事件 [true 或 false]
|
chassis_removed
|
布尔型
|
过滤器应匹配 chassis_removed 事件 [true 或 false]
|
hardware_component_inserted
|
布尔型
|
过滤器应匹配 hardware_component_inserted 事件 [true 或 false]
|
hardware_component_removed
|
布尔型
|
过滤器应匹配 hardware_component_removed 事件 [true 或 false]
|
disk_inserted
|
布尔型
|
过滤器应匹配 disk_inserted 事件 [true 或 false]
|
disk_removed
|
布尔型
|
过滤器应匹配 disk_removed 事件 [true 或 false]
|
i/o_path_added
|
布尔型
|
过滤器应匹配 i/o_path_added 事件 [true 或 false]
|
i/o_path_removed
|
布尔型
|
过滤器应匹配 i/o_path_removed 事件 [true 或 false]
|
service_processor_offline_or_unavailable
|
布尔型
|
过滤器应匹配 service_processor_offline_or_unavailable 事件 [true 或 false]
|
service_processor_online_after_outage
|
布尔型
|
过滤器应匹配 service_processor_online_after_outag 事件 [true 或 false]
|
failed_to_set_root_password_on_service_processor
|
布尔型
|
过滤器应匹配 failed_to_set_root_password_on_service_processor 事件 [true 或 false]
|
|
表 3-10 警报操作 "hardware_faults"
|
|
|
all_hardware_faults
|
布尔型
|
过滤器应匹配 all_hardware_faults 事件 [true 或 false]
|
|
表 3-11 警报操作 "ndmp"
|
|
|
invalid_ndmp_restore
|
布尔型
|
过滤器应匹配 invalid_ndmp_restore 事件 [true 或 false]
|
backup_finished
|
布尔型
|
过滤器应匹配 backup_finished 事件 [true 或 false]
|
backup_started
|
布尔型
|
过滤器应匹配 backup_started 事件 [true 或 false]
|
restore_finished
|
布尔型
|
过滤器应匹配 restore_finished 事件 [true 或 false]
|
restore_started
|
布尔型
|
过滤器应匹配 restore_started 事件 [true 或 false]
|
|
表 3-12 警报操作 "network"
|
|
|
datalink_failed
|
布尔型
|
过滤器应匹配 datalink_failed 事件 [true 或 false]
|
datalink_ok
|
布尔型
|
过滤器应匹配 datalink_ok 事件 [true 或 false]
|
network_port_down
|
布尔型
|
过滤器应匹配 network_port_down 事件 [true 或 false]
|
network_port_up
|
布尔型
|
过滤器应匹配 network_port_up 事件 [true 或 false]
|
ip_address_conflict
|
布尔型
|
过滤器应匹配 ip_address_conflict 事件 [true 或 false]
|
ip_address_conflict_resolved
|
布尔型
|
过滤器应匹配 ip_address_conflict_resolved 事件 [true 或 false]
|
ip_interface_degraded
|
布尔型
|
过滤器应匹配 ip_interface_degraded 事件 [true 或 false]
|
ip_interface_failed
|
布尔型
|
过滤器应匹配 ip_interface_failed 事件 [true 或 false]
|
ip_interface_ok
|
布尔型
|
过滤器应匹配 ip_interface_ok 事件 [true 或 false]
|
|
表 3-13 警报操作 "replication"
|
|
|
receive_failed_(unsupported _version)
|
布尔型
|
过滤器应匹配 receive_failed_(unsupported_version) 事件 [true 或 false]
|
receive_failed_(cancelled)
|
布尔型
|
过滤器应匹配 receive_failed_(cancelled) 事件 [true 或 false]
|
receive_failed_(all_others)
|
布尔型
|
过滤器应匹配 receive_failed_(all_others) 事件 [true 或 false]
|
receive_failed_(out_of_space)
|
布尔型
|
过滤器应匹配 receive_failed_(out_of_space) 事件 [true 或 false]
|
receive_failed_(package_not _upgraded)
|
布尔型
|
过滤器应匹配 receive_failed_(package_not_upgraded) 事件 [true 或 false]
|
receive_finished
|
布尔型
|
过滤器应匹配 receive_finished 事件 [true 或 false]
|
receive_started
|
布尔型
|
过滤器应匹配 receive_started 事件 [true 或 false]
|
send_failed_(unsupported_version)
|
布尔型
|
过滤器应匹配 send_failed_(unsupported_version) 事件 [true 或 false]
|
send_failed_(cancelled)
|
布尔型
|
过滤器应匹配 send_failed_(cancelled) 事件 [true 或 false]
|
send_failed_(all_others)
|
布尔型
|
过滤器应匹配 send_failed_(all_others) 事件 [true 或 false]
|
send_failed_(connectivity)
|
布尔型
|
过滤器应匹配 send_failed_(connectivity) 事件 [true 或 false]
|
send_failed_(out_of_space)
|
布尔型
|
过滤器应匹配 send_failed_(out_of_space) 事件 [true 或 false]
|
send_failed_(remote _verification)
|
布尔型
|
过滤器应匹配 send_failed_(remote_verification) 事件 [true 或 false]
|
send_finished
|
布尔型
|
过滤器应匹配 send_finished 事件 [true 或 false]
|
send_skipped_(already_running)
|
布尔型
|
过滤器应匹配 send_skipped_(already_running) 事件 [true 或 false]
|
send_started
|
布尔型
|
过滤器应匹配 send_started 事件 [true 或 false]
|
|
表 3-14 警报操作 "replication_source"
|
|
|
send_failed_(unsupported_version)
|
布尔型
|
过滤器应匹配 send_failed_(unsupported_version) 事件 [true 或 false]
|
send_failed_(cancelled)
|
布尔型
|
过滤器应匹配 send_failed_(cancelled) 事件 [true 或 false]
|
send_failed_(all_others)
|
布尔型
|
过滤器应匹配 send_failed_(all_others) 事件 [true 或 false]
|
send_failed_(connectivity)
|
布尔型
|
过滤器应匹配 send_failed_(connectivity) 事件 [true 或 false]
|
send_failed_(out_of_space)
|
布尔型
|
过滤器应匹配 send_failed_(out_of_space) 事件 [true 或 false]
|
send_failed_(remote_verification)
|
布尔型
|
过滤器应匹配 send_failed_(remote_verification) 事件 [true 或 false]
|
send_finished
|
布尔型
|
过滤器应匹配 send_finished 事件 [true 或 false]
|
send_skipped_(already_running)
|
布尔型
|
过滤器应匹配 send_skipped_(already_running) 事件 [true 或 false]
|
send_started
|
布尔型
|
过滤器应匹配 send_started 事件 [true 或 false]
|
|
表 3-15 警报操作 "replication_target"
|
|
|
receive_failed_(unsupported_verrsion)
|
布尔型
|
过滤器应匹配 receive_failed_(unsupported_version) 事件 [true 或 false]
|
receive_failed_(cancelled)
|
布尔型
|
过滤器应匹配 receive_failed_(cancelled) 事件 [true 或 false]
|
receive_failed _(all_others)
|
布尔型
|
过滤器应匹配 receive_failed_(all_others) 事件 [true 或 false]
|
receive_failed _(out_of_space)
|
布尔型
|
过滤器应匹配 receive_failed_(out_of_space) 事件 [true 或 false]
|
receive_failed_(package_not_upgraded)
|
布尔型
|
过滤器应匹配 receive_failed_(package_not_upgraded) 事件 [true 或 false]
|
receive_finished
|
布尔型
|
过滤器应匹配 receive_finished 事件 [true 或 false]
|
receive_started
|
布尔型
|
过滤器应匹配 receive_started 事件 [true 或 false]
|
|
表 3-16 警报操作 "restore"
|
|
|
restore_finished
|
布尔型
|
过滤器应匹配 restore_finished 事件 [true 或 false]
|
restore_started
|
布尔型
|
过滤器应匹配 restore_started 事件 [true 或 false]
|
|
表 3-17 警报操作 "scrk"
|
|
|
support_bundle_build_failed
|
布尔型
|
过滤器应匹配 support_bundle_build_failed 事件 [true 或 false]
|
support_bundle_sent
|
布尔型
|
过滤器应匹配 support_bundle_sent 事件 [true 或 false]
|
support_bundle _upload_failed
|
布尔型
|
过滤器应匹配 support_bundle_upload_failed 事件 [true 或 false]
|
an_update_is_available_on_my_oracle_support.
|
布尔型
|
过滤器应匹配 an_update_is_available_on_my_oracle_support. 事件 [true 或 false]
|
no_updates_available.
|
布尔型
|
过滤器应匹配 no_updates_available. 事件 [true 或 false]
|
the_appliance_failed_to_verify _if_an_update_i s_available.
|
布尔型
|
过滤器应匹配 the_appliance_failed_to_verify_if_an_u pdate_is_available. 事件 [true 或 false]
|
|
表 3-18 警报操作 "shadow"
|
|
|
shadow_migration_complete
|
布尔型
|
过滤器应匹配 shadow_migration_complete 事件 [true 或 false]
|
|
表 3-19 警报操作 "smf"
|
|
|
service_failures
|
布尔型
|
过滤器应匹配 service_failures 事件 [true 或 false]
|
|
表 3-20 警报操作 "thresholds"
|
|
|
thresholdid
|
Default
|
应匹配其警报的监视的 UUID
|
|
表 3-21 警报操作 "zfs_pool"
|
|
|
resilver_finished
|
布尔型
|
过滤器应匹配 resilver_finished 事件 [true 或 false]
|
resilver_started
|
布尔型
|
过滤器应匹配 resilver_started 事件 [true 或 false]
|
scrub_finished
|
布尔型
|
过滤器应匹配 scrub_finished 事件 [true 或 false]
|
scrub_started
|
布尔型
|
过滤器应匹配 scrub_started 事件 [true 或 false]
|
hot_spare_activated
|
布尔型
|
过滤器应匹配 hot_spare_activated 事件 [true 或 false]
|
|
列出警报操作
列出警报操作命令可列出所有警报操作。要获取单个资源的数据,请向给定警报操作资源的 href 属性发送 HTTP GET 请求。
获取警报操作的请求示例:
GET /api/alert/v1/actions HTTP/1.1
Authorization: Basic abcd123MWE=
Host: zfs-storage.example.com:215
Accept: application/json
响应示例:
HTTP/1.1 200 OK
X-Zfssa-Appliance-Api: 1.0
Content-Type: application/json
Content-Length: 1395
{
"actions": [
{
"action": "actions-000",
"category": "smf",
"href": "/api/alert/v1/actions/actions-000",
"service_failures": true
},
{
"action": "actions-001",
"category": "scrk",
"href": "/api/alert/v1/actions/actions-001",
"action-000": {
"handler": "snmp_trap",
"href": "/api/alert/v1/alerts/actions/actions-001
/action-000"
},
"action-001": {
"address": "Joe.Admin@acme.com",
"handler": "email",
"href": "/api/alert/v1/actions/actions-001
/action-001",
"subject": "Phone Home Alert"
},
"support_bundle_build_failed": true,
"support_bundle_sent": true,
"support_bundle_upload_failed": true
},
{
"action": "actions-002",
"category": "thresholds",
"href": "/api/alert/v1/actions/actions-002",
"action-000": {
"address": "Joe.Admin@acme.com",
"handler": "email",
"href": "/api/alert/v1/actions/actions-002
/action-000",
"subject": "CPU Busy Alert"
},
"thresholdid": "b182ca05-53d3-6604-b874-ec353335704d"
}
]
}
获取警报操作
此命令类似于列出警报操作命令,但此命令仅返回指定的警报操作。
请求示例:
GET /api/alert/v1/actions/actions-002 HTTP/1.1
响应示例:
HTTP/1.1 200 OK
X-Zfssa-Appliance-Api: 1.0
Content-Type: application/json
Content-Length: 331
{
"action": {
"category": "thresholds",
"href": "/api/alert/v1/actions/actions-002",
"action-000": {
"address": "Joe.Admin@acme.com",
"handler": "email",
"href": "/api/alert/v1/alerts/actions/actions-002
/action-000",
"subject": "CPU Busy"
},
"thresholdid": "b182ca05-53d3-6604-b874-ec353335704d"
}
}
创建警报操作
当您创建一个包含 JSON 对象的警报操作 POST 请求时,必须向 /api/alert/v1/alerts/actions 发送操作属性。必须设置类别属性以选择要创建的操作类型。有关给定系统上的所有可用类别值,请参见 CLI 文档。
类别值通常包括:
"ad", "all", "appliance_software", "backup", "cluster", "custom",
"hardware", "hardware_faults", "ndmp", "network", "replication",
"replication_source", "replication_target", "restore", "scrk", "shadow",
"smf", "thresholds" or "zfs_pool"
请求示例:
POST /api/alert/v1/actions HTTP/1.1
Host: zfssa.example.com:215
X-Auth-Session: uerqghq84vbdv
Content-Type: application/json
Content-Length: 30
{"category": "hardware_faults"}
响应示例:
HTTP/1.1 201 Created
X-Zfssa-Appliance-Api: 1.0
Content-Type: application/json
Content-Length: 118
Location: /api/alert/v1/actions/actions-006
{
"action": {
"href": "/api/alert/v1/actions/actions-006",
"category": "hardware_faults",
"all_hardware_faults": true
}
}
修改警报操作
可通过发送 HTTP PUT 请求来修改由 list 命令返回的一些属性。
请求示例:
PUT /api/alert/v1/actions/actions-001 HTTP/1.1
Host: zfssa.example.com:215
X-Auth-Session: uerqghq84vbdv
Content-Type: application/json
Content-Length: 30
{"support_bundle_sent": false}
响应示例:
HTTP/1.1 202 Accepted
X-Zfssa-Appliance-Api: 1.0
Content-Type: application/json
Content-Length: 195
{
"action": {
"href": "/api/alert/v1/actions/actions-001",
"category": "scrk",
"support_bundle_build_failed": true,
"support_bundle_sent": false,
"support_bundle_upload_failed": true
}
}
删除警报操作
向任何警报操作 href 或操作 href 发送 HTTP DELETE 请求可删除指定的资源。成功删除的响应为 HTTP 状态 204 (No Content)。
请求示例:
DELETE /api/alert/v1/actions/actions-003 HTTP/1.1
Authorization: Basic abcd123MWE=
Host: zfssa.example.com:215
响应示例:
HTTP/1.1 204 No Content
X-Zfssa-Appliance-Api: 1.0