
[Rhino@localhost (#1)] getconfig threshold-rules rule/low_memory
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rhino-threshold-rule PUBLIC "-//Open Cloud Ltd.//DTD Rhino Threshold Rule 1.0//EN"
"http://www.opencloud.com/dtd/rhino-threshold-rule.dtd">
<rhino-threshold-rule config-version="1.0" rhino-version="Rhino-SDK
(version=’1.4.3’, release=’00’, build=’200610301220’, revision=’1798’)"
timestamp="1162172349575">
<!-- Generated Rhino configuration file: 2006-10-30 14:39:09.575 -->
<threshold-rules active="false" name="low memory">
<trigger-conditions name="Trigger conditions" operator="OR" period="0">
<relative-threshold operator="<=" value="0.2">
<first-statistic calculate-delta="false"
parameter-set="System Info" statistic="freeMemory"/>
<second-statistic calculate-delta="false"
parameter-set="System Info" statistic="totalMemory"/>
</relative-threshold>
</trigger-conditions>
<reset-conditions name="Reset conditions" operator="OR" period="0"/>
<trigger-actions>
<raise-alarm-action level="Major" message="Low on memory" type="memory"/>
</trigger-actions>
<reset-actions>
<clear-raised-alarm-action/>
</reset-actions>
</threshold-rules>
</rhino-threshold-rule>
The rule is displayed in XML format on the console. It can be exported to a file using the
exportConfig
command:
[Rhino@localhost (#2)] exportconfig threshold-rules rule/low_memory rule.xml
Export threshold-rules (rule/low_memory) to rule.xml
Wrote rule.xml
A rule can be modified using a text editor and then reinstalled. In the following example, a reset condition is added to the rule so
that the alarm raised will be automatically cleared when free memory becomes greater than 30%. Currently, the reset-conditions
element in the rule contains no conditions. To add a condition, edit the
reset-conditions
element as follows:
<reset-conditions name="Reset conditions" operator="OR" period="0">
<relative-threshold operator=">" value="0.3">
<first-statistic calculate-delta="false" parameter-set="System Info"
statistic="freeMemory"/>
<second-statistic calculate-delta="false"
parameter-set="System Info"
statistic="totalMemory"/>
</relative-threshold>
</reset-conditions>
The rule can be imported using the
importconfig
command:
[Rhino@localhost (#1)] importconfig threshold-rules rule_low_memory.xml -replace
The first argument,
threshold-rules
, is interpreted as the type of data to read from the file in the second argument (the XML
file). The third argument,
-replace
, is necessary to reinstall the “low memory” rule because there is already an existing rule
of that name.
Note that when an active existing rule is replaced, the rule is always reverted to its untriggered state first. If the rule being
replaced has triggered an alarm then that alarm will be cleared.
Open Cloud Rhino 1.4.3 Administration Manual v1.1 82
Commentaires sur ces manuels