How to test parameters sent to PowerShell from alerts while using Active IQ Unified Manager?
Applies to
- OnCommand Unified Manager ( UM )
- Active IQ Unified Manager ( AIQUM )
Answer
Engineering wrote a sample PowerShell script which defines the parameters and prints the parameters values. Powershell script "param_testing.ps1" code is below.
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"
Testing example is below. The purpose of this simple script is for custom script troubleshooting to verify what values are outputted in PowerShell given the parameters provided.
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
Additional Information
additionalInformation_text