How the location field populated for a CI during OOB ServcieNow Discovery

Lakshmi46
Giga Contributor

How the location field populated for a CI during OOB ServcieNow Discovery

5 REPLIES 5

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

Based on the location field on the schedules in which this IP lies is used to update the location on CI.

This happens in Shazzam probe and its sensor script.


Thanks,
Ashutosh

Hi Ashutosh,

Thanks for your quick response.

Location in schedule is blank.

my concern is, there are a range or list of IPs in this schedule, which location I have to mention

In CI record is it not about the location where that particular server or device is lcoated?

Hi,

Its like your data center location. We have a strategy in place. We have schedule specific to our datacenter locations and country locations.

So you have to put IP ranges or IPs in that schedule only specific to that location.

So separate schedules properly so you can use location field wisely.


Thanks,
Ashutosh

Aakash Bhagat
ServiceNow Employee
ServiceNow Employee

This should be in the Shazzam Sensor script.   If you scroll down there is a function called "updateLocation".

updateLocation: function() {

              if (!this.schedule.location)

                      return;

              this.ciData.getData()['location'] = this.schedule.location;

},

 

If you don't want the location field to change and you don't want to modify the Shazzam probe, you can also put an "after" business rule on the 'discovery_device_history' table. It holds the CI in a reference field and you can dot-walk to the Discovery Schedule table. Of course, that doesn't prevent the location from being written to the location field on the CI record, but I know a lot of clients have been hesitant to modify the OOB probes/sensors. You can set the location record to NULL and erase that value if you want though (or write another BR to reject any update to the location field).