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

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:

  • Verified Answer

    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

     

     

  • Thats exacty what I was looking for!

    Thanks for your help.