i am in the process of creating an enrichment rule in order to update a certain attribute based on another attribute. let me explain a bit more in detail.
we are discovering certain nodes with the "Host Connection by SNMP" job. as result we are getting certain CI instances of type UNIX where the SNMP system name starte with quotation marks:
now in order to be alligned with all the other nodes from other discovery jobs and devices we need to loose there quotation marks in the name attribute for the CI. one way of doing it, is to adapt the discovery script. we have done this in the past, but obviously we're loosing these changes with every CP update.
the other way is to create an enrichment rule which will generate the name attribute based on lets say the "Primary DNS Name" attribute. so the primar DNS name is "servername.domain.com". now i would like to create an enrichment rule which updates the name attribute by removing the quotation marks from the value of the primary dns name attribute.
For this purpose i am trying to update the value of the attribute "Name" with the value of the attribute "Primary DNS Name" and use the reqular expression (\w*) and the RegExp Group 1.
I have searched the documentation for more information on how to use the Regular Expression in this context, but i was not able to find anythig relevant. For example i am not totally sure on how the RegExp Group has to be used.
Anyone here can help me and explain how exactley i have to use RegEx in this case?
HI..I dont prefer changing the Name attribute by an enrichment rule since name is used in the reconcilation logic of node. it might cretae duplicates based on the reconcilation rules validation.but your requirement can be meet very easily by a simple enrcihment. Regards...
Why don't you copy "Host Connection by SNMP" adapater/script, Create a new adapter like "Host Connection by SNMP_Modified", Modify the script as you did in the past? I hope CP update will not modify this adapter.
If you find this reply helpful, Click the KUDOS button on the bottom to say 'Thanks'
in the meantime i have realized that it is not possible to create an enrichment rule which will update an attribute based on itself. means i don't think it is possible to update the name attribute based on the name attribute after applying the regular expression. from my understanding this some sort of limitation which does make some sense now that i think about it.
the job does return snmp sysname with quotation marks. removing the marks by modifying the script is an option we have used in the past successfully. but with every new CP our changes in the script will be overwritten. obviously we could copy the script, implement the change again and use it as custom script. but in this case we prefer to use the enrichment rule. at this point we will use the enrichment rule to set the name attribute based on the Primary DNS name attribute which is being discovered correctly.