The file was opened with XMLPad in the Tabular view. The -NoClobber parameter makes sure n existing file is not overwritten.Īs you can notice from the following extract, the content of the file is rather hard to read if you’re not used to the CLIXML format. Line 68: The report with all the alarms is saved to an XML file. Alarms Alarm Monitors Datastore Usage On Disk Disk usage Host CPU Usage CPU usage. Line 55: If the GetAlarm method is called with the $null parameter it will return all alarms defined in the vCenter. Create a vCenter utilization alarm Relate the alarm to the affected. So you get at least alarms when datastores in storage cluster are at threshold level. ![]() Note that the New-Object format that is used here is only valid in PowerShell v2 RTM. When disabling this alarm, I would strongly recommend to set percentage of Datastore Disk Usage in alarm Datastore usage on disk like Space threshold in storage cluster configuration. Line 14-47: Handles each of the “base” actions and stores the specific properties for each of them in a PSObject. This case loops through each of them and calls the Get-AlarmAction function recursively. Line 7-13: A GroupAlarmAction can contain one or more of the other “basic” actions. Line 6: This switch handles all possibilities that can be found in the Action property. All actions will be returned in an array of PSObjects. Line 1: This function is called recursively (for the GroupAlarmAction). $report | Export-Clixml "C:\Alarm-actions.xml" -NoClobber $report += New-Object PSObject -Property = $Įntity = (Get-View $).NameĪction = Get-AlarmAction $ $list += New-Object PSObject -Property = $_ One of the disadvantages of the CLIXML format it’s not obvious for a user to read this type of XML file ! Since an alarm can have one or more actions of different types (see above), the easiest serialisation solution was CLIXML and to use the built-in Export-CliXML cmdlet. The Datastore Usage on Disk triggers a warning alarm at 75 usage and a critical alarm at 85 usage. Same is valid for the ConvertTo-Xml cmdlet that came with PowerShell v2. While a CSV file is handy to export object that all have the same layout, it’s quite cumbersome to export objects that have varying content. Why CLIXML and not to a plain XML or CSV file ? The answer is simple: “ structure“. The following script produces a CLIXML file containing all the existing alarms and for each of them a selection of their properties, including the action(s) that are defined.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |