A user asked if it was possible to run a script periodically on a subset of clients in Edge DX. Suggested methods included using device tags and environment variables, or using Get-Random. Filtering by Edge DX device group is possible with the SIPDEVICEGROUP environment variable. More information can be found in the ControlUp documentation at https://support.controlup.com/docs/edge-dx-scripting-guide#example-for-powershell.
Read the entire ‘Running Scripts Periodically in Edge DX’ thread below:
Guys!
Is there a way to run a scripts periodically (Long Interval Timer (600 seconds) but only on a sub set of clients from within Edge DX?
I have a file copy script (Big thanks to @member) that measures throughput to/from a file share on a server and I don’t really want ALL clients to do it at the same time since it would probably cause some congestion 🙂
Iirc somebody mentioned a way could be to use the device tags, and then in the script read an environment variable that has the tag, only continue if it matches the tag of the machines you want to run the scripts on? Can’t find the thread right now, but it was along those lines.
Or a quick&dirty way would be to launch on every machine, and use a Get-Random with a small calculation to see if the script should proceed with the test:
If ((Get-Random -Minimum 0 -Maximum 10) -ge 9) {
`Write-Host ‘testing’`
}
Else {
`Write-Host ‘Nope, not this time.’`
}
That should have the script run 1 out of 10 times or so.
You can also filter by Edge DX device group with the SIPDEVICEGROUP environment variable.
https://support.controlup.com/docs/edge-dx-scripting-guide#example-for-powershellThx @member thats the method I meant when I said ‘tags’.
Continue reading and comment on the thread ‘How to Run Scripts Periodically in ControlUp Edge DX’. Not a member? Join Here!
Categories: All Archives, ControlUp Edge DX, ControlUp Scripts & Triggers