Skip to main content

Integration with ServiceNow and IP Fabric

Project description

ServiceNow Integration with IP Fabric

This project syncs devices from IP Fabric's Inventory to ServiceNow's CMDB Network Gear Table.

CLI Utility Installation

pip install ipfabric-snow

ServiceNow Configuration

Please see the ServiceNow Configuration section for details on how to configure ServiceNow for use with this integration.

Environment Setup

Copy sample.env to .env and fill in the necessary details. During the setup, you'll be prompted to enter the necessary environment variables including URLs and authentication details for both ServiceNow and IP Fabric.

Quick Start

To sync devices from IP Fabric to ServiceNow, run:

ipfabric-snow sync devices 

If the environment is not properly set up, you'll be prompted to set it up. Follow the prompts to provide the necessary details.

ipfabric-snow --help
 Usage: ipfabric-snow [OPTIONS] COMMAND [ARGS]...                                                                                                                                                 
                                                                                                                                                                                                  
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --log-level                                 TEXT  Log level [default: INFO]                                                                                                                    │
│ --log-to-file           --no-log-to-file          Log to file [default: log-to-file]                                                                                                           │
│ --log-file-name                             TEXT  Log file name [default: ipf_serviceNow.log]                                                                                                  │
│ --log-json              --no-log-json             Log in JSON format [default: no-log-json]                                                                                                    │
│ --install-completion                              Install completion for the current shell.                                                                                                    │
│ --show-completion                                 Show completion for the current shell, to copy it or customize the installation.                                                             │
│ --help                                            Show this message and exit.                                                                                                                  │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ env                     Setup environment variables                                                                                                                                            │
│ sync                    Sync Inventory data with ServiceNow                                                                                                                                    │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
 ipfabric-snow sync --help
                                                                                                                                                                                                                                                             
 Usage: ipfabric-snow sync [OPTIONS] COMMAND [ARGS]...                                                                                                                                                                                                       
                                                                                                                                                                                                                                                             
 Sync Inventory data with ServiceNow                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                             
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                                                                                                                                               │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ devices                                  Sync devices from IP Fabric to ServiceNow                                                                                                                                                                        │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
 ipfabric-snow sync devices --help
Usage: ipfabric-snow sync devices [OPTIONS] [STAGING_TABLE_NAME]                                                                                                                                 
                                                                                                                                                                                                  
 Sync devices from IP Fabric to ServiceNow                                                                                                                                                       
                                                                                                                                                                                                  
╭─ Arguments ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│   staging_table_name      [STAGING_TABLE_NAME]  The name of the ServiceNow staging table to use. [default: x_1249630_ipf_devices]                                                              │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --show-diff         --no-show-diff                  Display the data difference [default: no-show-diff]                            │
│ --diff-source                              TEXT     Specify the main source for diff, either IPF or SNOW [default: IPF]            │
│ --write-diff        --no-write-diff                 Enable or disable writing the diff to a file [default: no-write-diff]          │
│ --diff-file                                TEXT     Path to save the diff file, if desired                                         │
│                                                     [default: data/{date_time}_diff_{diff_source}.json]                            │
│ --dry-run           --no-dry-run                    Perform a dry run without making any changes [default: no-dry-run]             │
│ --ipf-snapshot                             TEXT     IP Fabric snapshot ID to use for the sync [default: $last]                     │
│ --timeout                                  INTEGER  timeout for httpx requests [default: 10]                                       │
│ --record-limit                             INTEGER  Limit the number of records to pull from ServiceNow. Defaults to 1000          │
│                                                     [default: 1000]                                                                │
│ --output-verbose    --no-output-verbose             adds more detail to the output. Identifies which keys changed per device       │
│                                                     [default: no-output-verbose]                                                   │
│ --help                                              Show this message and exit.                                                    │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

example of sync devices command:
```shell
ipfabric-snow --log-level DEBUG sync devices --show-diff --diff-source SNOW  --ipf-snapshot "12dd8c61-129c-431a-b98b-4c9211571f89" --output-verbose --timeout 30 --record-limit 1000

Development

Poetry

Clone the repository and run

poetry install

Invoke

This project uses Invoke for task automation. To see a list of available tasks, run:

invoke --list

Clearing the Netgear Table

During Development, you may want to clear the netgear table in ServiceNow. To clear the netgear table, run:

 invoke clear-netgear-table

Any Changes to ServiceNow Application should be merged into the main_snow_app branch

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipfabric_snow-0.1.0b8.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

ipfabric_snow-0.1.0b8-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file ipfabric_snow-0.1.0b8.tar.gz.

File metadata

  • Download URL: ipfabric_snow-0.1.0b8.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.4 Darwin/23.6.0

File hashes

Hashes for ipfabric_snow-0.1.0b8.tar.gz
Algorithm Hash digest
SHA256 f36c48bbec4b7113fd12b20a5c967c6ac66c024919f21ee7211f5048364bea6a
MD5 0913f9c56d0646d0a01ed5397f90e721
BLAKE2b-256 f803abc5ca1095fe4782ba9b06c74431187ff8abd05a92f7e18e3a34b65808ca

See more details on using hashes here.

File details

Details for the file ipfabric_snow-0.1.0b8-py3-none-any.whl.

File metadata

  • Download URL: ipfabric_snow-0.1.0b8-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.4 Darwin/23.6.0

File hashes

Hashes for ipfabric_snow-0.1.0b8-py3-none-any.whl
Algorithm Hash digest
SHA256 68f5f968951c557ed273cca901d3e7f677777cbc5e9672f36a64e3d88bec1a7f
MD5 c9aa74c0d2bd859b07802713ae731921
BLAKE2b-256 bcd14e1a7177c6967faac283ad885ccaf0f04d691041081f5f5e3304126f6ab3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page