Discovering multiple CI's with the same Serial

sbolton
Mega Expert

I have tried to disable the serial identifiers by adding

addQuery('cmdb_ci.sys_class_name', '!=', 'cmdb_ci_aix_server');

to the 'Serial Number Table & Class Name', 'Serial Number & Class Name' identifiers but those identifiers are still running on my AIX machines.   Has anyone disabled the identifiers for their AIX machines ?   My virtural environment is pulling the same serials for multiple machines.

Discover multiple CIs with the same Serial Number

// find matches for all valid serials in the serial number table...

              var gr = new GlideAggregate('cmdb_serial_number');

              gr.addEncodedQuery(buildEncodedQuery(discoveredSerials));

              gr.addAggregate('COUNT', 'cmdb_ci');

              gr.addQuery('valid', 'true');

              gr.addQuery('absent', 'false');

  gr.addQuery('cmdb_ci.sys_class_name', '!=', 'cmdb_ci_aix_server');

              gr.groupBy('cmdb_ci');

              gr.addHaving('COUNT', '=', discoveredSerials.length);

              gr.query();

and

function hasSerialNumberTable(cigr) {

              var sgr = new GlideRecord("cmdb_serial_number");

              sgr.addQuery("cmdb_ci", cigr.sys_id);

              sgr.addQuery('absent', 'false');

              sgr.addQuery('valid', 'true');

  sgr.addQuery('sys_class_name', '!=', 'cmdb_ci_aix_server');

  sgr.setLimit(1);

              sgr.query();

              if (sgr.next())

                      return true;

              else

                      return false;

      }

1 ACCEPTED SOLUTION

Sharon Hobart
Mega Guru

Yes.   Have ran into the same scenario and you can create an identifer that only applies to the AIX server class (or whatever class you are trying to control) and put it in the order above the hardware class identifiers.     You do not need to revise the OOB identifier for Serial Numbers.     There is one value you have to change on your New Identifier so it doesn't go to the remaining identifiers.   See this article for assistance.   https://community.servicenow.com/message/680308#680308



What we did was copied the code from the Name/Class identifier into a new identifier.   The new identifier only applies against the one table "AIX servers".   Make sure to change the line from "false" to "true":     return new CIIdentifierResult(matching, matchable, true).   This prevents the AIX servers from going to the next identifier for matching serial numbers or any of the other identifiers in the list.



Please let me know if you have any questions.


View solution in original post

4 REPLIES 4

Sharon Hobart
Mega Guru

Yes.   Have ran into the same scenario and you can create an identifer that only applies to the AIX server class (or whatever class you are trying to control) and put it in the order above the hardware class identifiers.     You do not need to revise the OOB identifier for Serial Numbers.     There is one value you have to change on your New Identifier so it doesn't go to the remaining identifiers.   See this article for assistance.   https://community.servicenow.com/message/680308#680308



What we did was copied the code from the Name/Class identifier into a new identifier.   The new identifier only applies against the one table "AIX servers".   Make sure to change the line from "false" to "true":     return new CIIdentifierResult(matching, matchable, true).   This prevents the AIX servers from going to the next identifier for matching serial numbers or any of the other identifiers in the list.



Please let me know if you have any questions.


Thanks Sharon that worked as expected.


Hi Sharon, 

I am new in discovery I have a similar issue with Solaris Server i need to be able to discover servers with the same serial number, I have created a new identifier but i am not able to identify the code that i need to copy from the Name/Class identifier into a new identifier.

Could you please advice?

Thanks in advance

Hi Sharon

I have a similar problem with solaris server, however I am not able to identify the code that i need to copy from the name/class identifier into a new identifier.

Could you please advice me?