moog-rep-snow-grp v1.0.10
Moogsoft ServiceNow Assignment Group Replication Utility
moog-rep-snow-grp is a utility intended to facilitate the replication of ServiceNow assignment groups, (and their description) in Moogsoft Cloud.
The utility:
- Queries the ServiceNow Table API to list the assignment groups
- Replicates the groups in Moogsoft Cloud
- Fails harmlessly if the groups already exist
Installation
Prerequisites
moog-rep-snow-grp is a Node.js utility and requires Node.js to be installed, available here
Install the moog-rep-snow-grp
CLI utility
Install the node module.
$ npm install moog-rep-snow-grp
Link to create a command line utility.
$ npm link moog-rep-snow-grp
Depending on your computer/OS, you may need to close, and re-open your shell to update your environment to execute the commands.
The utility reads configuration from a local configuration file (mrsg-config.yaml by default, see example) use the init option to create a template in your current working directory.
$ moog-rep-snow-grp --init
Edit the config file to use your Moogsoft
apiKey
and specify your ServiceNow URL and credentials. 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'
Where:
moog.apiKey
: Moogsoft API keysnow.hostname
: The hostname (from URI) of your ServiceNow instancesnow.username
: The username used for a basic auth API requestsnow.password
: The password used for a basic auth API request
Usage
moog-rep-snow-grp [-i] [-d] [-y] [-j] [-l debug] [-c config_file] [-h]
--init: Create a template config file (./mrsg-config.yaml)
--dryrun: Show what groups would be added, but don't do it.
--yaml: Dump the entire search results as a YAML file. (saved.yaml)
--json: Dump the entire search results as a JSON file. (saved.json)
--loglevel debug: Be more verbose
--conf config_file: Specify an alternative config file (default is ./mrsg-config.yaml)
--help: The usage message
Examples
Run the utility
$ moog-rep-snow-grp
Note: If a group already exists in Moogsoft, the utility will report it as a failure ("already exists") this is intentional
Find out what it would do (but not don't replicate the groups in Moogsoft), and store the group information in a YAML file
$ moog-rep-snow-grp -d -y
Get more detail - Useful for debugging issues
$ moog-rep-snow-grp -l debug