delta operator
Syntax
id id;
delta xpath-expression, delta-value {
info string;
err "string";
[err "string";]
}Description
Junos Snapshot Administrator test operator that compares the change in value of a specified data element, which must be present in both snapshots, to a specified delta. You can specify the delta as an absolute, positive, or negative percentage, or as an absolute, positive, or negative fixed value.
Parameters
| delta-value | Delta value expressed as a percentage or fixed value and against which the change in the element value is compared. Expressed as a percentage:
Expressed as a fixed value:
|
| err string | Statement generated when the test case returns false. |
| id id | XPath expression relative to the data content that specifies
a unique data element that maps the first snapshot data item to the
second snapshot data item. To create a unique ID based on multiple
element values, define multiple |
| info string | Description of the test case. |
| xpath-expression | XPath expression selecting the elements to evaluate. |
Usage Examples
The following test cases check the BGP route prefix count after a maintenance window. To ensure that the BGP peers were restored, the code checks the prefix counts for a delta change of -10%. That is, if the new prefix count is less than 90% of the original prefix count, the test reports an error.
bgp-checks {
command show bgp summary;
iterate bgp-rib {
id name;
delta total-prefix-count, -10% {
info BGP total prefix count should not change by more than -10%;
err " BGP rib: %s total prefix count has exceeded threshold", name;
err " pre-check: %s, post-check: %s", $PRE/total-prefix-count, $POST/total-prefix-count;
}
delta active-prefix-count, -10% {
info BGP active prefix count should not change by more than -10%;
err " BGP rib: %s total prefix count has exceeded threshold", name;
err " pre-check: %s, post-check: %s", $PRE/active-prefix-count, $POST/active-prefix-count;
}
}
}
Release Information
Operator introduced in Junos Snapshot Administrator Release 1.0.