- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017 08:02 AM
I have several physical server assets (eg. Windows Servers)... where we have re-allocated them as Linux Servers. I can change the class on the CI... but the model category on the corresponding asset is still 'Windows Server'.
This doesn't appear to be enabled, even for adminstrators, 'out of the box'. I assume it's because the complexity and rules & processing around asset/ci creation.
How can I update the Asset record with the correct model category?
Solved! Go to Solution.
- Labels:
-
Enterprise Asset Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017 08:10 AM
You are correct that there is nothing there and makes sense that the function or type of sever is not defined or changes during the lifecycle. In the past I have added a business rule on the cmdb_ci table to look for changes in class and has an asset record to do something like this below:
updateAssetMC();
function updateAssetMC(){
var asset = current.asset;
var newClass = getModelCat(current.sys_class_name);
var gr = new GlideRecord('alm_asset');
gr.addQuery('sys_id',asset);
gr.query();
if(gr.next()){
if(newClass){
gr.model_category = newClass;
gr.update();
}
}
}
function getModelCat(c){
var gr = new GlideRecord('cmdb_model_category');
gr.addQuery('cmdb_ci_class',c);
gr.query();
if(gr.next()){
return gr.sys_id;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017 08:10 AM
You are correct that there is nothing there and makes sense that the function or type of sever is not defined or changes during the lifecycle. In the past I have added a business rule on the cmdb_ci table to look for changes in class and has an asset record to do something like this below:
updateAssetMC();
function updateAssetMC(){
var asset = current.asset;
var newClass = getModelCat(current.sys_class_name);
var gr = new GlideRecord('alm_asset');
gr.addQuery('sys_id',asset);
gr.query();
if(gr.next()){
if(newClass){
gr.model_category = newClass;
gr.update();
}
}
}
function getModelCat(c){
var gr = new GlideRecord('cmdb_model_category');
gr.addQuery('cmdb_ci_class',c);
gr.query();
if(gr.next()){
return gr.sys_id;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017 09:02 AM
Would you recommend that I add the new class (model category) as a valid model category for the Model as well (if it's not already there?). I suspect we will have the scenario where a specific model of server (eg. HP DL480) may have only been used as a Windows Server, and now has been reclassed as a 'Linux Server'. I suspect there will be issues if I don't also ensure the model has been setup with the new class as a valid model category.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017 09:08 AM
How are these getting changed? Via discovery? I believe if you change the class of a CI - let's say linux to windows - they system will also add that to the model categories on the associated model.
This happens I believe via a business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017 10:28 AM
Unfortunately our company chose a phase 1 CMDB implementation where we continue to manually update the asset and configuraiton data. Data was loaded from numerous legacy configuration systems into ServiceNOW. Re-platforming to a central integrated platform (at low cost) was the key driver for our first phase. We are now looking at auto-discovery options.
Having said this... as servers are being repurposed (eg. from Windows to Linux Server), we have the need to reclassify the server. The method to reclassify will have to be manually (eg. admin or superuser adjusts the class field on the CI... ideally would replicate to the asset (if there is one)).