Hi All,
We have a bunch of VMs which get spun up and removed automatically, and reserve 100% memory. This gives them all a memory warning status as default. I don't want to set the global threshold to avoid this, and would need to constantly scan for these vms to manually set their local thresholds.
So, automation!
In SQL, I believe what I need to do is insert a row like so
Id | InstanceID | ThresholdType | ThresholdNameID | ThresholdOperator | Warning | Critical | WarningFormula | CriticalFormula | BaselineFrom | BaselineTo | BaselineApplied | BaselineApplyError | WarningPolls | WarningPollsinterval | CriticalPolls | CriticalPollsinterval | WarningEnabled | CriticalEnabled |
1094 | 24208 | 1 | 24 | 2 | 1 | 2 | NULL | NULL | NULL | NULL | NULL | NULL | 1 | 1 | 1 | 1 | False | False |
Of which Warning, Critical, ThresholdOperator and ThresholdType seem to be the important ones for the threshold and InstanceID relates to the VM. I've no idea what Id refers to.
The values here specify stupid unreachable thresholds to force a green status for memory.
As inserting with SQL automatically isn't recommended by anyone I'm hoping there may be a better way of doing this via the API, I guess set-swisobject? I've not spotted a specific verb for this case thus far
Would inserting those 4 values with set-swisobject per relevant instanceID work? Is there a better way to do this? Do I need to supply all the other values which dont seem to offer anything useful