How can a rule be disabled via the command line when the Foglight UI is not accessible?
To disable a rule, run the following piece of groovy within the Foglight Server (FMS) from the command line.
def rulesList = server.RuleService.getAllRules()
def msgOutput = new StringBuffer()
rulesList.each{
msgOutput.append("Rule name: [" + it.name + "]\n")
}
return msgOutput.toString()
def rule = server.RuleService.getAllRules().find { r -> r.name == "YourRuleName" }
if( rule ) {
server.RuleService.suspendRule( rule.id )
return "success"
}
return "not found"
Please note:
To Enable the rule, add the following lines of code into a .groovy script file:
def rule = server.RuleService.getAllRules().find { r -> r.name == "YourRuleName" }
if( rule ) {
server.RuleService.unsuspendRule( rule.id )
return "success"
}
return "not found"
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center