How can I set the Status of CIs created by Discovery on Insert? The CIs created by other sources should remain unaffected.

mkhan123
Kilo Contributor

How can I set the Status of CIs created by Discovery on Insert? The CIs created by other sources should remain unaffected.

10 REPLIES 10

Doug, excellent advice.



Mohd, here's the relevant solution you can implement:   Discovery 301: Optimizing Discovery for your Infrastructure



In case you were not at Knowledge 17 (in which case you won't have access to that lab), here's the Business Rule screenshots, out-of-box there isn't an install_status of 'New', so maybe you added that choice?   I'd double-check your value in your Business Rule as that may be part of the problem.   Also, you probably want to be a bit more specific in your choice of table, cmdb_ci are all CIs in the CMDB and that will include applications, databases, software, etc.   Many of which "install_status" won't make sense.   My example is specifically on the cmdb_ci_hardware table as that seems most appropriate, but you can adjust for your needs (note the 'Role conditions' in the first screen shot as that's what Doug was suggesting':



Screen Shot 2017-08-15 at 9.37.28 AM.png



Screen Shot 2017-08-15 at 9.39.26 AM.png


Thanks Doug & Rob. I have a question regarding the role specified in the "Role conditions". Is this the role of the "Created by" user of the record OR the role of the current logged in user?


It will be 'a role' of the account that is inserting the record.   Since humans won't have the mid_server role, then you'll know that Discovery is performing the insert in question (via the MIDServer).   Technically, if you gave an account the 'mid_server' role, and it inserted a record, the business rule would fire.   In reality there's no reason for this to happen.



-Rob


Hi Doug,

I have a similar situation and I was able to set a default install_status using a business rule, but, we are having problems with Network adapter class, in here, all the elements in this class don't accept the business rule logic and are being inserted with a wrong install_status(seems to be the one defaulted in the dictionary), do you know why or where can I set network adapters state?

Regards.

That's interesting for sure. I would have thought that all classes have to follow BR logic, have you tried before and after insert? Other than that I don't have the availability to give this specific case a test drive for a couple weeks but perhaps there is a bug and support can offer some of their sage advice... If any of our friends here don't answer first.