1.0.8 • Published 1 year ago

moog-snow-catalog v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Moogsoft Logo

Moogsoft ServiceNow CMDB table to Catalog Upload Utility

moog-snow-catalog is a utility intended to export a CMDB table as CSV, and upload as a catalog to Moogsoft Cloud.

The utility:

  • Queries the ServiceNow Table API to extract CIs (with fields being user defined)
  • Save the table locally as a CSV file
  • Deletes any existing catalog with the same name
  • Uploads the CSV file as a Moogsoft data enrichment catalog

Installation

Prerequisites

moog-snow-catalog is a Node.js utility and requires Node.js to be installed, available here

Install the moog-snow-catalog CLI utility

  1. Install the node module.

    $ npm install moog-snow-catalog

  2. Link to create a command line utility.

    $ npm link moog-snow-catalog

Depending on your computer/OS, you may need to close, and re-open your shell to update your environment to execute the commands.

  1. The utility reads configuration from a local configuration file (msc-config.yaml by default, see example) use the init option to create a template in your current working directory.

    $ moog-snow-catalog --init

  2. Edit the config file to use your Moogsoft apiKey and specify your ServiceNow URL and credentials. Also this file is used to customize the table, and fields that will be extracted. This is a YAML file, so the correct indentation must be preserved.

The config file

---
moog:
  apiKey: 'foo-bar-0123434-ahdgefwvbs14535'

snow:
  hostname: 'mysnow.service-now.com'
  username: 'admin'
  password: 'foobar'
  cmdb_table: 'cmdb_ci'
  sysparm_fields:
    - name
    - support_group
    - sys_class_name

Where:

moog.apiKey: Moogsoft API key
snow.hostname: The hostname (from URI) of your ServiceNow instance
snow.username: The username used for a basic auth API request
snow.password: The password used for a basic auth API request
snow.cmdb_table: The cmdb table to be queried
snow.sysparm_fields: A list of fields to be extracted from the table

Usage

moog-snow-catalog [-i] [-d] [-l debug] [-c config_file] [-h]
    --init:              Create a template config file (./msc-config.yaml)
    --dryrun:            Query ServiceNow, create a CSV file, but don't upload it to Moogsoft or delete a catalog
    --loglevel debug:    Be more verbose
    --conf config_file:  Specify an alternative config file (default is ./msc-config.yaml)
    --help:              The usage message

Examples

  • Run the utility

    $ moog-snow-catalog

  • Query the ServiceNow table API, and create a CSV file with the defined fields. This is a great first step

    $ moog-snow-catalog -d

  • Get more detail - Useful for debugging issues

    $ moog-snow-catalog -l debug

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago