跳转到主内容

如何在使用 Active IQ Unified Manager 时测试从警报发送到 PowerShell 的参数?

Views:
56
Visibility:
Public
Votes:
0
Category:
not set
Specialty:
not set
Last Updated:

适用于

  • OnCommand 统一管理器( UM )
  • Active IQ Unified Manager ( AIQUM )

解答

工程人员编写了一个示例 PowerShell 脚本,用于定义参数并打印参数值。PowerShell 脚本 "param_testing.ps1" 代码如下。

param ($eventID, $eventName, $eventSeverity, $eventSourceID, $eventSourceName, $eventSourceType, $eventState, $eventArgs)
write-host "eventID : $eventID `n"
write-host "eventName : $eventName `n"
write-host "eventSeverity : $eventSeverity `n"
write-host "eventSourceID : $eventSourceID `n"
write-host "eventSourceName : $eventSourceName `n"
write-host "eventSourceType: $eventSourceType `n"
write-host "eventState : $eventState `n"
write-host "eventArgs : $eventArgs `n"

下面是测试示例。此简单脚本的目的是,对自定义脚本进行故障排除,以验证根据提供的参数在 PowerShell 中输出的值。

PS C:\Users\Administrator\Desktop> .\param_testing.ps1 -eventID 341966 -eventName Qtree` Space` Soft` Limit` Breached -eventSeverity warning -eventSourceID 6042432 -eventSourceName foo:`/bar`/test` name` `-` test -eventSourceType QTREE -eventState NEW -eventArgs qtreeSpaceHardLimit=1048576,qtreeSpaceSoftLimit=838864,bytesUsed=1033848,bytesPercent=123`.24381544565031,qtreeSpaceIsHardLimitNotSet=false
eventID : 341966
eventName : Qtree Space Soft Limit Breached
eventSeverity : warning
eventSourceID : 6042432
eventSourceName : foo:/bar/test name - test
eventSourceType: QTREE
eventState : NEW
eventArgs : qtreeSpaceHardLimit=1048576 qtreeSpaceSoftLimit=838864 bytesUsed=1033848 bytesPercent=123.24381544565031 qtreeSpaceIsHardLimitNotSet=false

 

其他信息

附加信息 _text

 

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.