In at this time’s digital enterprise panorama, organizations more and more depend on asset administration options to streamline their operations. Firms usually discover themselves managing the identical bodily belongings throughout a number of IT and operational expertise (OT) methods. One of many companies that assist IT groups monitor and handle enterprise IT belongings is ServiceNow. This service handles all the things from {hardware} and software program stock to service requests, license compliance, and the entire lifecycle of expertise assets. For OT, AWS IoT SiteWise is a managed service that allows corporations to gather, set up, and analyze industrial gear information at scale. This service gives a unified repository of reside and historic operational information, empowering organizations to make data-driven selections that improve manufacturing effectivity and optimize asset upkeep.
A standard problem that organizations face utilizing ServiceNow and AWS IoT SiteWise collectively is sustaining constant asset info throughout their methods. When an asset hierarchy is up to date in ServiceNow, operations groups should manually replicate these adjustments in AWS IoT SiteWise, resulting in duplicate work and potential inconsistencies. This course of can be time-consuming, error-prone, and creates pointless overhead to handle the identical belongings in each environments.This weblog put up presents an strategy to synchronize asset information between ServiceNow and AWS IoT SiteWise. By implementing this integration sample, you possibly can remove guide updates, cut back errors, and preserve constant asset hierarchies throughout your IT and OT platforms.
Answer overview
This resolution makes use of AWS companies to create an automatic integration between ServiceNow and AWS IoT SiteWise. When adjustments happen in ServiceNow’s asset administration system, they’ll mechanically move by way of to AWS IoT SiteWise, making certain each methods stay synchronized.
Determine 1: Structure
Determine 1 exhibits a two-phase information move. Within the first section (Ingest), information strikes from ServiceNow by way of Amazon AppFlow to in Amazon Easy Storage Service (Amazon S3). Within the second section (Import), the info flows by way of AWS Glue and again to Amazon S3 earlier than reaching AWS IoT SiteWise. Each phases serve totally different functions:
Ingest section:
- Amazon AppFlow pulls asset information from ServiceNow tables: Operations Know-how (OT), OT Entity, OT Entity Kind.
- The information is then saved in Amazon S3 and in parquet format.
Import section:
- AWS Glue transforms the parquet information to a JSON format that AWS IoT SiteWise can import.
- Remodeled JSON information are saved in Amazon S3.
- AWS IoT SiteWise imports the asset info to create or replace asset fashions and hierarchies.
Implementation overview
This put up presents the next phases to implement this integration:
- Configure the ServiceNow connector in Amazon AppFlow to ingest asset information into Amazon S3.
- Create AWS Glue jobs to rework the info from parquet to JSON to match the required AWS IoT SiteWise import format.
- Arrange AWS IoT SiteWise asset import from Amazon S3.
Conditions
Earlier than implementing this resolution, you’ll want:
- A ServiceNow occasion with entry to your asset tables. On this instance, we use:
- Operations Know-how (OT) (
cmdb_ci_ot
): Accommodates operational expertise gadget information from ServiceNow. These information embody primary attributes like identify, serial quantity, mannequin quantity, producer, and site info. - OT Entity (
cmdb_ot_entity
): Accommodates information that outline the OT entity cases and their relationships. It additionally represents how units join to one another within the operational hierarchy. - OT Entity Kind (
cmdb_ot_entity_type
): Accommodates information that outline the categories or classes of OT entities (reminiscent of, Space, Course of Cell, Unit, and Tools Module). It additionally defines the allowed parent-child relationships within the operational hierarchy.
- Operations Know-how (OT) (
- Three tables work collectively to offer a whole image of OT belongings:
cmdb_ci_ot
handles the bodily gadget info (configuration Gadgets).cmdb_ot_entity
manages the cases and relationships of those units.cmdb_ot_entity_type
defines the hierarchy construction guidelines and classes.
- An AWS account with permissions to make use of Amazon AppFlow, Amazon S3, AWS Glue, and AWS IoT SiteWise.
- ServiceNow credentials for a system-only person with permission to learn your asset tables.
Implementation
Configure the ServiceNow connector
On this part, you’ll arrange Amazon AppFlow to drag information from ServiceNow and configure AWS Glue to catalog the info.
Create a ServiceNow connection in Amazon AppFlow
- Navigate to the Amazon AppFlow console.
- Within the left menu, beneath Connections, select ServiceNow from the Connectors dropdown.
- Select Create connection.
- Within the Hook up with ServiceNow pop up, see Determine 2, enter the next:
- Choose both Primary Auth or OAuth2 as wanted.
- Fill within the crucial info based on the person information.
- When you select OAuth2 fill within the Consumer ID, Consumer secret and Occasion URL in your ServiceNow Occasion.
- When you select Primary Auth fill within the Username, Password and Occasion URL in your ServiceNow Occasion.
- Click on join as soon as all info is stuffed in.
Determine 2: Hook up with ServiceNow
Create flows for every desk
- Navigate to the Amazon AppFlow console.
- Within the left menu, beneath Flows, select Create move.
- Enter a Circulation Title (for instance:
cmdb_ci_ot
), see Determine 3, and choose Subsequent.
Determine 3: Create move
- Within the Supply particulars dialog field, see Determine 4, enter the next:
- For Supply Title, choose ServiceNow.
- Make certain that the connection you created earlier is chosen beneath ServiceNow connection. The reference could have the identify of your ServiceNow occasion, this instance makes use of “dev287617”.
- For ServiceNow object, choose Operational Know-how (OT).
- Navigate to the Vacation spot particulars dialog field, see Determine 4, and enter the next:
- For Vacation spot identify, select Amazon S3.
- Beneath Bucket particulars, both select your vacation spot bucket or create one by way of the Amazon S3 console. This instance makes use of the bucket prefix
cmdb_ci_ot
.
- Select Subsequent.
Determine 4: Circulation supply and vacation spot
- Within the Supply to vacation spot subject mapping dialog field, see Determine 5, enter the next:
- Beneath Supply subject identify, select Map all fields instantly.
- Select Subsequent after which select Subsequent once more.
- End by selecting Run move.
Determine 5: Run move
Repeat the “Create flows for every desk” process to create a move for every of your tables to create connections with the opposite ServiceNow objects:
- Circulation identify and Amazon S3 prefix:
cmdb_ot_entity
, ServiceNow object: OT Asset. - Circulation identify and Amazon S3 prefix:
cmdb_ot_entity_type
, ServiceNow object: OT Asset Kind.
Arrange and run AWS Glue Crawler to establish the schema
- Navigate to AWS Glue console.
- Within the left menu, beneath Knowledge Catalog, select Crawlers.
- Within the Crawlers dialog field, see Determine 6, select Create crawler.
Determine 6: AWS Glue crawlers
- For Crawler identify, use ServiceNow Crawler and select Subsequent.
Determine 7: Crawler properties
- Select Add an information supply.
- Within the Add information supply dialog field, see Determine 8, enter the next:
- For Knowledge supply, select S3.
- For S3 path, select
. - Choose Add an S3 information supply.
Determine 8: Crawler information supply
- Select Subsequent.
- Beneath IAM function, choose Create new IAM function, see Determine 9.
Determine 9: Crawler IAM Function
- Select a reputation for the function. On this instance, we use
AWSGlueServiceRole-ServiceNowCrawler
. - Choose Subsequent.
- Beneath Goal database, select an AWS Glue Database. This instance makes use of the default database.
Determine 10: AWS Glue Database Choice
- Select Subsequent.
- Select Create.
- Run the crawler. It ought to take round two minutes to finish.
The ServiceNow parquet information has now been efficiently imported into Amazon S3.
Remodel the JSON information
On this part, you’ll arrange the AWS Glue job to rework the parquet information to JSON format appropriate for AWS IoT SiteWise and import the info into AWS IoT SiteWise.
Create AWS Glue Job
- Navigate to AWS Glue console.
- Within the menu to the left, beneath ETL Jobs, select Visible ETL.
- In Create Job, choose Visible ETL.
Determine 11: AWS Glue studio
- Create a Supply node. Choose the blue plus (+) button, see Determine 12, and choose Amazon S3.
Determine 12: Visible ETL
- For Title, select any identify for the node, see Determine 13. On this instance, we are going to use cmdb_ot_entity.
- For S3 supply sort, choose Knowledge Catalog desk.
- For Database, select the goal database you beforehand chosen when establishing your AWS Glue Crawler.
- For Desk, select the primary desk
cmbd_ot_entity
. Repeat this step for every of the tables:cmdb_ci_ot
andcmdb_ot_entity_type
.
Determine 13: Including supply node
Map belongings to the AWS IoT SiteWise import format
- Create a brand new Supply node by deciding on the blue “+” button as proven in Determine 12.
- Add a Remodel node and choose SQL Question.
- For Title, use “belongings”.
- For Node mother and father, select the supply nodes
cmdb_ot_entity
andcmdb_ci_ot
. - For Enter sources and SQL Aliases, select
cmdb_ot_entity
andcmdb_ci_ot
for every, as proven in Determine 14.
Determine 14: belongings remodel
- For SQL Question, copy and paste the next question:
Map the asset mannequin
- Create a brand new Supply node by deciding on the blue “+” button as proven in Determine 12.
- Add a brand new Remodel node and choose SQL Question.
- For Title, use “assetModels”.
- For Node Dad and mom, select the supply node
cmdb_ot_entity_type
. - For Enter sources and SQL Aliases, use
cmdb_ot_entity_type
for every, as proven in Determine 15.
Determine 15: assetModel remodel
- For SQL Question, copy and paste the next question:
Mix the belongings and assetModels
- Create a brand new Supply node by deciding on the blue “+” button as proven in Determine 12.
- Add a brand new node Remodel and choose SQL Question.
- For Title, use “assetModelHierarchy”.
- For Node mother and father, select the supply nodes belongings and assetModels.
- For Enter sources and SQL aliases, use belongings and assetModels for every, as proven in Determine 16.
Determine 16: assetModelHierarchy remodel
- For SQL Question, copy and paste the next question:
Now, add the goal of the remodel so you possibly can retailer the results of our AWS Glue Job for use for importing into AWS IoT SiteWise.
Add the goal of the remodel
- Create a brand new Supply node by deciding on the blue “+” button as proven in Determine 12.
- Add a brand new node Remodel and choose Amazon S3 from the targets.
- For Title, use something. This instance usesAmazon S3.
- For Node Dad and mom, select the supply node assetModelHierarchy.
- For Format, select JSON.
- For Compression Kind, select None.
- For S3 Goal Location, choose
.
Determine 17: Including goal node
As soon as full, it’s best to see the ETL that’s proven in Determine 18. Select Save.
Then choose Run and watch for it to complete.
Determine 18: Asset hierarchy
Import into AWS IoT SiteWise
On this part, you’ll verify the creation of the JSON file in Amazon S3 and import the ServiceNow belongings into AWS IoT SiteWise.
- First, verify JSON file was created by doing the next:
- Open the Amazon S3 console.
- Choose
. - Choose the
run-
file, then select Actions.-part-r-00000 - Choose Rename Object, then rename it to
sitewise-import.json
. So as to import it to AWS IoT SiteWise, the article should have the json extension added to the identify.
- To import into AWS IoT SiteWise, open the AWS IoT SiteWise console.
- Within the navigation pane, select Bulk Operations.
- Choose New Import
Determine 19: AWS IoT SiteWise bulk operations
- Within the Import metadata dialog field, for S3 URI, choose
then thesitewise-import.json file.
Determine 20: S3 import
- Choose Import and watch for the import to complete.
Validate your work
Now you can view the totally different fashions and mannequin properties as proven in Determine 21. You can too view the totally different belongings and asset properties as proven in Figures 22, 23, and 24. Your ServiceNow hierarchy is now efficiently replicated into AWS IoT SiteWise.
Determine 21: AWS IoT SiteWise fashions
Determine 22: AWS IoT SiteWise mannequin properties
Determine 23: AWS IoT SiteWise belongings
Determine 24: AWS IoT SiteWise asset properties
Cleanup
To wash up the work outlined on this weblog, navigate to the Amazon AppFlow console to delete the flows and ServiceNow connection. Delete any person and person credentials created for ServiceNow. In AWS Glue, delete the crawler, job, and tables from the AWS Glue Knowledge Catalog. Take away the belongings and asset fashions from AWS IoT SiteWise. Lastly, delete each the parquet and remodeled JSON information out of your Amazon S3 buckets.
Conclusion
This weblog introduced a course of to combine ServiceNow asset information with AWS IoT SiteWise, a observe that permits organizations to take care of constant asset info throughout their IT and OT asset administration options. To completely automate this integration, schedule your Amazon AppFlow flows to run at common intervals and configure your AWS Glue job with a schedule set off. When establishing the AWS Glue job, you may as well add the ‘.json’ extension to the output file by way of the ETL script. Each options remove guide information entry and guarantee consistency between IT and OT methods.
Strive implementing this resolution and tell us about your expertise within the feedback part under. Wish to be taught extra about AWS IoT SiteWise? See the AWS IoT SiteWise Developer Information for extra info.
Concerning the authors
Maria El Khoury is a Options Architect at AWS supporting manufacturing prospects of their digital transformation journey. With a background of constructing IoT and pc imaginative and prescient options, Maria is particularly all for making use of AWS within the fields of Industrial IoT and provide chain.
Brent Van Wynsberge is a Options Architect at AWS supporting enterprise prospects. He accelerates the cloud adoption journey for organizations by aligning technical aims to enterprise outcomes and strategic objectives. Brent is an IoT fanatic, particularly within the utility of IoT in manufacturing, he’s additionally all for DevOps, information analytics and containers.