Another exciting scripts to give away to my dear community fellows - ability to catch alarms on vCenter server from SolarWinds SAM. In fact, vCenter alarms are pretty cool and robust, the only downside - they fall outside of SW workflow and alerts (unless, probably, you have VMAN, which I don't). So, let's fix it...
4 counters will extract info about alerts and will count number of them. Only 1 component needed, which will utilize the power of multiply outputs in SAM templates
The moment you acknowledge them in vCenter, upon next poll it will give the following (notice some new additional bits of information about acknowledged user and time)
You can set thresholds yourself as you wish. In my case I want to be alerted only when there are new unacknowledged alerts in vCenter, so, I have only set threshold for Unacked counters, as follows:
You can obviously change it as you desire.
I have also made it to trigger over 5 polls in order to avoid firing too many alerts about vCenter alarms with too short life span
- PowerShell script will do the job
- I have never been able to execute powershell directly from SolarWinds. So, I have followed workaround kindly shared by lukas.belza (Re: PowerShell/PowerCLI Monitor Problem) where I simply drop this PS script on the SolarWinds' server local drive and then wrap it around VBScript in app template
- Then I attach this template to vCenter server node and run it every 15 minutes.
1.1 Download attached PowerShell script (attached)
1.2 Open it in notepad and follow instruction in comments section on top of the script
1.3 Test script by running it from SolarWinds box - it should give you desirable output in SolarWinds supported output format
1.4 Place it in the local drive. C:\Scripts\ folder would be a good candidate
2.1 Download VMWare Alerts SolarWinds Template (attached) and apply this to your vCenter node
2.2 Update arguments parameter with the full path to your PowerShell script file from step (1)
2.3 Ensure credential you provide in template/application can run PowerShell script locally on SolarWinds app server (usually <inherit from Node> will work in most cases)
3.1 Come back here and comment if you like it
Credits to Eric and massive Thank You for his post which I have used as a base to build script above: