Highlighted
Absent Member.. Absent Member..
Absent Member..
201 views

Looking for an example of a regex in a Node CI Type

Jump to solution

Can you guys point me to an example of a regex that is used in the labeling of a new Node CI?

 

I have 2000+ Node CI's that are named b y their FQDN.  I would like to use a regex to remove the domain name, and simply name the Node CI by the short name of the node.  Unfortunately, these nodes come from NNMi, and they only have FQDN attributes.

 

Running uCMDB 9.05 CUP 17.  Yes, I know it's not supported any more.  Upgrade is just around the corner.  I don't expect that to change the way a Node CI is built.

 

Thanks for the help.

Tags (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

To create a regex for a label, go to CI Type Manager, select your CI Type (node), click on the 'default label' and then make sure your expression is first in the list.  The regular expression is in a structure of:

 

RegExp( <FIELD>, <pattern>, <group>)

 

So, FIELD is which field (in my example, mycomputer.hp.com)

<pattern> is the regex pattern to match:  (\w+)\.(.*)  (match a word and put it into group 1, then a dot, then everything else in group 2)

<group> is which group to match, in my case, group 1.

 

RegExp(name,(\w+)\.(.*),1)|name|snmp_sys_name|primary_dns_name|host_key|root_class

 

My node name:  mycomputer.hp.com

My display label:  mycomputer

 

 

Hope this helps,
Keith Paschal
UCMDB Worldwide Support Lead
Micro Focus Support
If you find this or any post resolves your issue, please be sure to mark it as an accepted solution."

Click the KUDOS star on the left to say 'Thanks'

View solution in original post

2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

To create a regex for a label, go to CI Type Manager, select your CI Type (node), click on the 'default label' and then make sure your expression is first in the list.  The regular expression is in a structure of:

 

RegExp( <FIELD>, <pattern>, <group>)

 

So, FIELD is which field (in my example, mycomputer.hp.com)

<pattern> is the regex pattern to match:  (\w+)\.(.*)  (match a word and put it into group 1, then a dot, then everything else in group 2)

<group> is which group to match, in my case, group 1.

 

RegExp(name,(\w+)\.(.*),1)|name|snmp_sys_name|primary_dns_name|host_key|root_class

 

My node name:  mycomputer.hp.com

My display label:  mycomputer

 

 

Hope this helps,
Keith Paschal
UCMDB Worldwide Support Lead
Micro Focus Support
If you find this or any post resolves your issue, please be sure to mark it as an accepted solution."

Click the KUDOS star on the left to say 'Thanks'

View solution in original post

Highlighted
Absent Member.. Absent Member..
Absent Member..

Thats exacty what I was looking for!

Thanks for your help.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.