Cleaning CMDB Tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2014 05:59 AM
I am interested to know if It is recommended to clean the CMDB up to start from scratch, following this plan:
1) TURN OFF discovery schedules.
2) Clean up CMDB except business services (because these are already in use).
3) Upload inventory manually from excel through transform maps.
2) TURN ON discovery schedules to refresh and update inventory with configuration information.
Any thoughts?
Thanks,
Jesus E. Melendez M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2014 02:18 AM
Well,, there is no real easy way to do this. The consultant recommended a clear down and start a new scan, especially as we only have around 3000 task records that are linked to CI's which are not the ci.class of Business Service or Service Offiering - which are not affected
There were further discussions and the existing data needs to be kept...
I am now about to work on and then implement the following
- Mark CIs not updated for more than 2 months as retired
- Mark CI's that have been updated in the last 2 months as not retired if the retired flag is set.
- Look at our SQL information and then backtrack to the hosting server and if the server is marked as retired, mark the db as retired, otherwise as active (there is a bug in calgary where the SQL information does not update its sys_updated_on field
- update the Script include that shows the CI's to take into consideration the retired field.
The scripts are not too hard to write, though the first run of the retirement script will take a long time.
marking them as retired and filtering out does mean that if a device is marked as retired when it should not be, then we can change the flag and then establish why it was marked as retired and not corrected.
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2014 02:16 AM
doing a few more tests today post a clone and we have found that on Calgary,
"Web Sites" and "Web Servers" do not update their sys_updated_on field either - it is the same as the sys_created_on date
I will have to use the same technique as I am for the SQL updates and if the server is marked as retired then its web serves and related web sites are also marked as retired.
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2015 03:20 PM
Hi Julian,
Have you written the script to
- Mark CIs not
updated for more than 2 months as retired - Mark CI's that
have been updated in the last 2 months as not retired if the retired flag is
set.
If so is that possible to share the code.
Thanks,
Hema
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2015 02:56 AM
(function(){
var gr = new GlideRecord('cmdb_ci');
gr.addEncodedQuery('sys_updated_onRELATIVELT@month@ago@3^sys_class_name!=cmdb_ci_service^sys_class_name!=service_offering^sys_class_name!=cmdb_ci_db_mssql_catalog^sys_class_name!=cmdb_ci_db_mssql_instance^sys_class_name!=cmdb_ci_web_server^sys_class_name!=cmdb_ci_web_site^u_retiredISEMPTY^ORu_retired!=true');
gr.query();
while(gr.next())
{
gr.u_retired_date = gs.nowDateTime();
gr.u_retired = true;
gr.update();
}
gr = new GlideRecord('cmdb_ci');
gr.addEncodedQuery('sys_updated_onRELATIVEGT@month@ago@3^sys_class_name!=cmdb_ci_service^sys_class_name!=service_offering^sys_class_name!=cmdb_ci_db_mssql_catalog^sys_class_name!=cmdb_ci_db_mssql_instance^sys_class_name!=cmdb_ci_web_server^sys_class_name!=cmdb_ci_web_site^u_retired=true');
//gr.addEncodedQuery('sys_updated_onRELATIVEGT@month@ago@2^sys_class_name=cmdb_ci_snc_component^u_retired=true');
gr.query();
while(gr.next())
{
if(gr.u_retired_date < gr.sys_updated_on)
{
gr.u_retired_date = '';
gr.u_retired = false;
gr.update();
}
}
})();
Runs as a scheduled job