To configure a threshold alarm rule:

View rules

To view a current threshold alarm rule., use the getconfig console command:

Command

getconfig [-namespace] <configuration type> [configuration key]
  Description
    Extract and display content of a container configuration key.  The optional
    -namespace argument must be used to get the config of a namespace-specific key.
    If no key is specified the configs of all keys of the given type are shown

Example

To display the threshold alarm rule named "rhino-memory-usage-over-80":

$ ./rhino-console getconfig threshold-rules "rule/rhino-memory-usage-over-80"
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE rhino-threshold-rules-config PUBLIC "-//Open Cloud Ltd.//DTD Rhino Threshold Rules Config 2.6//EN" "rhino-threshold-rules-config-2.6.dtd">
<rhino-threshold-rules-config config-version="2.6" rhino-version="Rhino (version='3.2', release='8', build='xxx', revision='xxx')" timestamp="xxx">
    <!--Generated Rhino configuration file: xxxx-xx-xx xx:xx:xx.xxx-->
    <threshold-rules active="true" name="rhino-memory-usage-over-80">
        <trigger-conditions name="Trigger conditions" operator="OR" period="5000">
            <relative-threshold operator="&gt;" value="0.8">
                <first-statistic calculate-delta="false" parameter-set="JVM" statistic="heapUsed"/>
                <second-statistic calculate-delta="false" parameter-set="JVM" statistic="heapCommitted"/>
            </relative-threshold>
        </trigger-conditions>
        <reset-conditions name="Reset conditions" operator="OR" period="0"/>
        <trigger-actions>
            <raise-alarm-action level="Critical" message="Memory Heap used over 80%" type="MEMORY"/>
        </trigger-actions>
        <reset-actions/>
    </threshold-rules>
</rhino-threshold-rules-config>

Export rules

To save a threshold rule configuration to a file for editing, use the exportconfig console command:

Command

exportconfig [-namespace] <configuration type> [configuration key] <filename>
  Description
    Extract content of a container configuration key and save it to a file.  The
    optional -namespace argument must be used to export the config of a
    namespace-specific key

Example

To export the threshold alarm rule named "rhino-memory-usage-over-80" to the file rule_rhino-memory-usage-over-80.xml:

$ ./rhino-console exportconfig threshold-rules "rule/rhino-memory-usage-over-80" rule_rhino-memory-usage-over-80.xml
Export threshold-rules: (rule/rhino-memory-usage-over-80 to rule_rhino-memory-usage-over-80.xml
Wrote rule_rhino-memory-usage-over-80.xml
Note The structure of the exported data in the XML file is identical to that displayed by the getconfig command.

Edit rules

You can modify a rule using a text editor. In the following example, a reset condition has been added to the rule previously exported, so that the alarm raised will automatically clear when heap memory utilisation falls below 80% for a continuous 30s period. (Previously the reset-conditions element in this rule had no conditions.)

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE rhino-threshold-rules-config PUBLIC "-//Open Cloud Ltd.//DTD Rhino Threshold Rules Config 2.6//EN" "rhino-threshold-rules-config-2.6.dtd">
<rhino-threshold-rules-config config-version="2.6" rhino-version="Rhino (version='3.2', release='8', build='xxx', revision='xxx')" timestamp="xxx">
    <!--Generated Rhino configuration file: xxxx-xx-xx xx:xx:xx.xxx-->
    <threshold-rules active="true" name="rhino-memory-usage-over-80">
        <trigger-conditions name="Trigger conditions" operator="OR" period="1000">
            <relative-threshold operator="&gt;" value="0.8">
                <first-statistic calculate-delta="false" parameter-set="JVM" statistic="heapUsed"/>
                <second-statistic calculate-delta="false" parameter-set="JVM" statistic="heapCommitted"/>
            </relative-threshold>
        </trigger-conditions>
        <reset-conditions name="Reset conditions" operator="OR" period="30000">
            <relative-threshold operator="&lt;" value="0.8">
                <first-statistic calculate-delta="false" parameter-set="JVM" statistic="heapUsed"/>
                <second-statistic calculate-delta="false" parameter-set="JVM" statistic="heapCommitted"/>
            </relative-threshold>
        </reset-conditions>
        <trigger-actions>
            <raise-alarm-action level="Critical" message="Memory Heap used over 80%" type="MEMORY"/>
        </trigger-actions>
        <reset-actions>
            <clear-raised-alarm-action/>
        </reset-actions>
    </threshold-rules>
</rhino-threshold-rules-config>

Import rules

To import the modified threshold alarm rule file, use the importconfig console command:

Command

importconfig [-namespace] <configuration type> <filename> [-replace]
  Description
    Import a container configuration key.  The optional -namespace argument must be
    used to import a config for a namespace-specific key

Example

To import the threshold alarm rule from the file rule_rhino-memory-usage-over-80.xml:

$ ./rhino-console importconfig threshold-rules rule_rhino-memory-usage-over-80.xml -replace
Configuration successfully imported.
Warning The -replace option is required when importing a rule with the same name as an existing rule, as there can be only one rule configuration with a given name present at any one time.
Previous page Next page
Rhino Version 3.2