How To
Summary
User-defined variables can be leveraged to translate IPv6 addresses for use in the Name and/or Description Expression of an Object Type.
Objective
Various OIDs include IP information as indexes. For example, OIDs from aristaBgp4V2PeerEntry (.1.3.6.1.4.1.30065.4.1.1.2.1) in ARISTA-BGP4V2-MIB contain indexes that represent the decimal values of a 128-bit IPv6 address that has been split into 16-byte octets, each consisting of two hex characters.
A device might return this response for aristaBgp4V2PeerState on an object with an IPv6 address of 2001:0db8:0000:0000:0000:0000:0000:0000:
.1.3.6.1.4.1.30065.4.1.1.2.1.13.1.2.16.32.1.13.184.0.0.0.0.0.0.0.0.0.0.0.0 = INTEGER: 6The third index of aristaBgp4V2PeerEntry is aristaBgp4V2PeerRemoteAddr, and gives a fixed length of 16 for the indexes that follow it. That means the decimal values of 2001:0db8:0000:0000:0000:0000:0000:0000 are 32.1.13.184.0.0.0.0.0.0.0.0.0.0.0.0.
It's possible to use the S3 scripting language built into SevOne NMS to convert these decimal values so you can include the IP address as part of the Name and/or Description Expression in an Object Type.
Steps
A variable needs to be defined where the conversion will be performed. You will either need for your Object Type to use an OID that contains IPv6 addresses as the Indexed By OID, or to know an OID that will provide that data.
For our example, our Object Type is being indexed by aristaBgp4V2PeerLocalPort (.1.3.6.1.4.1.30065.4.1.1.2.1.6). Since this is part of aristaBgp4V2PeerTable, we know the third index will be the IPv6 address.
1. Edit your Object Type and paste this into the text box labeled "Variable":
[m] = [INDEX]{2};
[mac] = ([m] ) ||| ( #S 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0);
[pmac] = '';
[a] = ( [mac]{1} - [mac]{1} % 16 ) / 16;
[b] = ( [a] == 0 ? '' : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{1} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{2} - [mac]{2} % 16 ) / 16;
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{2} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[pmac] = [b];
[a] = ( [mac]{3} - [mac]{3} % 16 ) / 16;
[b] = ( [a] == 0 ? '' : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{3} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{4} - [mac]{4} % 16 ) / 16;
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{4} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[pmac] = [pmac]:[b];
[a] = ( [mac]{5} - [mac]{5} % 16 ) / 16;
[b] = ( [a] == 0 ? '' : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{5} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{6} - [mac]{6} % 16 ) / 16;
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{6} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[pmac] = [pmac]:[b];
[a] = ( [mac]{7} - [mac]{7} % 16 ) / 16;
[b] = ( [a] == 0 ? '' : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{7} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{8} - [mac]{8} % 16 ) / 16;
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{8} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[pmac] = [pmac]:[b];
[a] = ( [mac]{9} - [mac]{9} % 16 ) / 16;
[b] = ( [a] == 0 ? '' : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{9} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{10} - [mac]{10} % 16 ) / 16;
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{10} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[pmac] = [pmac]:[b];
[a] = ( [mac]{11} - [mac]{11} % 16 ) / 16;
[b] = ( [a] == 0 ? '' : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{11} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{12} - [mac]{12} % 16 ) / 16;
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{12} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[pmac] = [pmac]:[b];
[a] = ( [mac]{13} - [mac]{13} % 16 ) / 16;
[b] = ( [a] == 0 ? '' : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{13} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{14} - [mac]{14} % 16 ) / 16;
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{14} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[pmac] = [pmac]:[b];
[a] = ( [mac]{15} - [mac]{15} % 16 ) / 16;
[b] = ( [a] == 0 ? '' : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{15} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{16} - [mac]{16} % 16 ) / 16;
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[a] = ( [mac]{16} % 16 );
[b] = [b]( [a] == 0 ? ( [b] == '' ? '' : 0 ) : ( [a] < 10 ? [a] : ( $S ( [a] - 10 + 65 ) ) ) );
[pmac] = [pmac]:[b];With this script, we're setting [m] to the third index of aristaBgp4V2PeerLocalPort, which is [INDEX]{2} (index numbering starts with 0). If there is no address, then "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0" is used.
If your Object Type is not indexed by an OID that contains the IPv6 address but has indexes that align with another OID that does, then you can substitute that OID for [INDEX]{2} in this script.
[mac], [pmac], [a], and [b] are additional variables that are used to store and update values as each octet is converted. When the conversion is completed, the final value is stored in [pmac].
2. Include [pmac] in the Name and/or Description Expression for the Object Type by enclosing it in backticks:
`[pmac]`For example:

3. Run discovery on your device to have objects created with the Name and Description expressions you specified
Additional Information
Important notes to keep in mind:
- If you change the Name Expression, Indexed By OID, or the Index Keys of an Object Type when objects of that type have already been discovered, then new objects will be created using the new settings during the next discovery. Your previous objects will be marked as missing, and will age out and be deleted according to the retention settings you've set in the Cluster Manager. You will lose historical data for those objects when they are deleted, so make sure you either don't have existing objects of that type or do not need the historical data for them
- Changing the Description Expression on an Object Type when objects of that type have already been discovered is a safe operation. The existing objects will have their descriptions updated to use the new expression while the objects themselves and their historical data remain intact
- The variable script in this article will produce a compressed IPv6 address
Document Location
Worldwide
Product Synonym
SevOne
Was this topic helpful?
Document Information
Modified date:
07 May 2026
UID
ibm17268097