Forum Discussion
You’ll likely end up with two scripts, a discovery script and a collection script.
Discovery:
This script is meant to enumerate the instances to LogicMonitor. The goal is to output a list of the objects you’ll be monitoring. Depending on how you want to do it, this will either be the list of VMs or the list of snapshots. This PS script would execute on the collector, but use the invoke-command with the -computer argument to actually execute the command remotely on the target HPV. The output will be multiple lines, where each line represents a VM or snapshot.
You could list the snapshots using the get-vmlget-vmsnapshot command. The required output is described here. I recommend ticking the box that says “Use Wildvalue as Unique Identifier” (I’ll explain if you’re interested why). Tick the “Multi-instance” and “Enable Active Discovery” tickboxes. Then you can select “Embedded PowerShell Script” and paste in your script. I recommend testing your script on the collector debug console since the test options on the DS editor aren’t conducive to actual debugging.
I recommend setting a property on the instance containing the name of the VM the snapshot belongs to. This will allow you to auto-group the instances by VM.
Collection:
This script will be very similar to the discovery script; it will use the invoke-command with the -computer argument to run on the collector but execute on the target HPV remotely. The output syntax is described here.
Your datapoints would use the “multi-line key value pairs” processor and the key would look like this: ##WILDVALUE##.<datapointname> where <datapointname> is the part that comes after the dot and before the equals sign in your script output.
I’m not a powershell guy, so someone else might have to get you started with template scripts.
Related Content
- 10 months ago
- 8 months ago