Welcome to the HyperFORGE

The HyperFORGE was created to facilitate collaboration on plugins and documentation for they Hyperic Community.

Become a HyperFORGE member →

Recent Activity

Skip to end of metadata
Go to start of metadata

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(', ')

Related Files

ResourceHelper.groovy

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.