HQU Log Track Enable Snippet
Description
This snippet allows you to globally set log-track configurations on platforms whose name matches a regex.
Works with
HQ 3.2.2 or higher
Running
Simply copy-n-paste the following script into the Groovy Console. Change the configuration and platform regex to suite your setup, and press 'Execute'.
| WARNING: Take caution with your criteria! This script will wipe out previous configurations! |
To view the changes in the UI, navigate to the platform -> Inventory -> Configuration
Snippet
import org.hyperic.hq.hqu.rendit.util.HQUtil
import org.hyperic.hq.hqu.rendit.helpers.ResourceHelper
def overlord = HQUtil.getOverlord()
def rhelp = new ResourceHelper(overlord)
def touched = []
rhelp.findAllPlatforms().grep { platform ->
platform.name =~ /Travistation.*/
}.each { platform ->
platform.setConfig('platform.log_track.enable' : 'true',
'platform.log_track.level' : 'Warn',
'platform.log_track.files' : '/tmp/myFile, /tmp/myFile2',
overlord)
touched << platform
}
'Touched: ' + touched.name.join(', ')