Hi!
I need to modify a rule to add more information.
The information I need can be extracted using the ${scope()} formatting since the information is in the tags.
Now to the problem:
The rule covers different vendors, not all vendors support the “extra” metric.
I believe that if I use a ${scope(“something”)} and it does not exist then the rule will fail
Any way to make the ${scope()} optional? Ie if the formatting can’t resolve then we can use a default value, say empty string? Might look a bit funny, but it’s still better than a failure.
Example on a device with the metric:
“{scope(\"name\")} ({scope(“peerip”)} - ${scope(“remote-peer-name”)})” would resolve to
Safenet_SAS_VPN (64.26.xx.xx - SafeNet_SAS_NA)
whilst on the devices that the metrics does not exist it would be presented thus
Safenet_SAS_VPN (64.26.xx.xx - )
Or is there another solution?
I see in the same rule(VpnTunnelIsDownRule) that there are two variants, one for vsx and one for non-vsx.
Would it be possible to multiply the derived classes and make a Vsx where the extra tag exist + a Non-Vsx where the extra tag exists? Dirty workaround…