lunedì 24 marzo 2014

VMware: PowerCLI to report triggered Alarms

There's one more thing related to management that I've still not covered in previous blog posts about reporting: alarms.
They are extremely important indicators of issues occurring in our virtual infrastructure, they are triggered once there's something wrong, something that need to be resolved in order to make everything work smooth.

Alarms are of two kinds: Warnings and Alerts. A Warning indicates that something is wrong in our environment but it's not yet critical. When it becomes more serious a Warning is replaced by an Alert, dictating something needs to be addressed as soon as possible.

As usual PowerCLI allow us to retrieve and get some informations regarding triggered alarms.

The following PowerCLI script connects to a vCenter Server and retrieves all alarms from any registered host. These alarms are presented in an HTML table and, using JavaScript, we add a little bit a style. By being JavaScript interpreted at client level, browser need to have it enabled in order to work.

The following image depicts an example of what you get after running the script:

For the sake of keeping the script essential I've excluded the CSS from it but, if you have a look at my previous fancy HTML reports blog post, you will get an example about how to use it in your report.

Here's the code for creating reports based on triggered alarms, as usual, you can also find it in my GitHub repository: Alarm Reports.ps1

That's all!!

Nessun commento:

Posta un commento