command:monitor-rules

monitorSetRuleUpdated

monitorSetRuleUpdated [--target=] [--zsurl=] [--zskey=] [--zssecret=] [--zsversion=] [--http=] [--output-format=] 

Cause monitor rules to be applied to the monitor extension.

  • --output-format
    Output format. Default is "xml", but you can use "json", or "kv" for key-value.

monitorExportRules

monitorExportRules [--applicationId=] [--target=] [--zsurl=] [--zskey=] [--zssecret=] [--zsversion=] [--http=] [--output-format=] 

Create an xml document that contains all monitor rules for an application. This document conforms to the structure required by the Deployment package to include rules in a zpk. Note that this action returns an unusual xml format and does not conform to the rest of the API in terms of structural conformity. The XSD for validating the document is provided in the appendices at the end of the document. Also note that this action returns only an XML output - it is not allowed to return a JSON format and an 406 error will be returned for a JSON output request.

  • --applicationId
    Application to retrieve rules for. Default: Global rules
  • --output-format
    Output format. Default is "xml", but you can use "json", or "kv" for key-value.

monitorImportRules

monitorImportRules --monitorRules= [--target=] [--zsurl=] [--zskey=] [--zssecret=] [--zsversion=] [--http=] [--output-format=] 

Get a list of global rules in XML formats. Refactor the XML to an array and update the server’s rules accordingly.

  • --monitorRules
    An XML string that describes the rules to be imported. This xml structure is identical to the one use in monitorExportRules action.
  • --output-format
    Output format. Default is "xml", but you can use "json", or "kv" for key-value.

monitorGetRulesList

monitorGetRulesList [--filters=] [--target=] [--zsurl=] [--zskey=] [--zssecret=] [--zsversion=] [--http=] [--output-format=] 

Retrieve a list of monitor rules.

  • --filters
    Add filter parameters in an ad-hoc manner. This parameter is an array with a predefined set of parameters that accept strings or arrays to hold multiple values:
    • applications: array, a list of application IDs to use for retrieving rules rows.
    • ruleIds: array, a list of rules IDs to use for retrieving rules rows.
    • freeText: Free text filter
  • --output-format
    Output format. Default is "xml", but you can use "json", or "kv" for key-value.

monitorEnableRules

monitorEnableRules --rulesIds= [--target=] [--zsurl=] [--zskey=] [--zssecret=] [--zsversion=] [--http=] [--output-format=] 

Enable a list of Monitor rules.

  • --rulesIds
    Comma-separated list of rules ids to be enabled.
  • --output-format
    Output format. Default is "xml", but you can use "json", or "kv" for key-value.

monitorDisableRules

monitorDisableRules --rulesIds= [--target=] [--zsurl=] [--zskey=] [--zssecret=] [--zsversion=] [--http=] [--output-format=] 

Disable a list of Monitor rules.

  • --rulesIds
    Comma-separated list of rules ids to be disabled.
  • --output-format
    Output format. Default is "xml", but you can use "json", or "kv" for key-value.

monitorSetRule

monitorSetRule --rulesId= --ruleProperties= [--ruleConditions=] --ruleTriggers= [--target=] [--zsurl=] [--zskey=] [--zssecret=] [--zsversion=] [--http=] [--output-format=] 

Add/modify a monitor rule.

  • --rulesId
    The ruleId of the rule to be set. -1 for new rule
  • --ruleProperties
    Associative array with the following mandatory rule properties: "rule_type_id", "rule_parent_id", "app_id", "name", "enabled" (1|0), "description", "url" and the following optional property: "creator" (0|1|2) - creator field with value “0” indicates that this is a Global rule, while value “1” indicates that this is a user defined rule and value“2” indicates that this rule originated from an application package. Default value is 1
  • --ruleConditions
    Optional Array of conditions, each condition has the following list of properties: "condition_id", "operation", "attribute", "operand" .
  • --ruleTriggers
    List of triggers. Each trigger is an associative array, with the following properties: triggerProperties - Mandatory Array with the following properties: "severity" (integer), "trigger_id" triggerConditions - Optional Array of conditions, each condition has the following list of properties: "condition_id", "operation", "attribute", "operand" triggerActions - Optional Array of actions, each action has the following list of properties: "action_id", "action_type" (integer), "action_url", "tracing_duration" (integer)
  • --output-format
    Output format. Default is "xml", but you can use "json", or "kv" for key-value.

monitorRemoveRules

monitorRemoveRules --rulesIds= [--target=] [--zsurl=] [--zskey=] [--zssecret=] [--zsversion=] [--http=] [--output-format=] 

Remove a monitor application rule (Global rules cannot be removed).

  • --rulesIds
    Comma-separated list of rules ids to be removed.
  • --output-format
    Output format. Default is "xml", but you can use "json", or "kv" for key-value.