Menu

#36 Enhance REGSUB transformation capabilities

Unstable (example)
open
nobody
None
5
2017-04-01
2017-04-01
Wim Nelis
No

The attached patch allows for the usage of the /e modifier in the REGSUB transformation, allowing one to specify an expression in the right-hand side of the substitution.

This enhancement is used to decode the VC port status of a Juniper switch. The name of the port is used as part of the OID, in which each (ASCII) character is represented by a decimal number. For instance, the administrative status of VC port named 'vcp-255/0/30.32768' has OID enterprises.2636.3.40.1.4.1.2.1.3.0.18.118.99.112.45.50.53.53.47.48.47.51.48.46.51.50.55.54.56. The MIB contains no entry specifying the name of the port, thus the name must be retrieved from the OID. (Note: 0 is the ordinal of the VC member, 18 is the length of the name.) The following transformations are used:

jnxVcpAdminStatus : 1.3.6.1.4.1.2636.3.40.1.4.1.2.1.3 : branch

jnxVcpIndex : INDEX : {jnxVcpAdminStatus}
jnxVcpName0 : REGSUB : {jnxVcpIndex} /^\d+.\d+//
jnxVcpName1 : REGSUB : {jnxVcpName0} /.(\d+)/chr($1)/ge

1 Attachments

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.