Skip to main content
Version: 2.14.1

Eyeglass ServiceNow API Integration for Cluster Configuration Sync to CMDB

Free integration setupWe’ll install and validate this for you.
Book a setup call

Support Statement

DISCLAIMER

This documentation is provided "as is" without support for 3rd party software. The level of support for this integration guide is best effort without any SLA on response time. No 3rd party product support can be provided by Superna directly. 3rd party components require support contracts. See EULA for more details.


Overview

ServiceNow CMDB integration allows cluster storage inventory to be synchronized into a custom CI schema to capture key properties of the cluster — including hardware serial numbers, capacity, usage, SMB and NFS exports, protection status, and quota usage. Customers can fully leverage ServiceNow ITSM with NAS storage.

Eyeglass collects the inventory of PowerScale clusters and populates an XML file named servicenow.xml. This document uses that XML file as the input for importing into the ServiceNow CMDB.

Capabilities

  • Create incidents against shares and exports
  • Monitor cluster storage capacity and usage within ServiceNow
  • Manage maintenance windows and calculate business-impacted services
  • Link services and applications to IT resources based on file storage dependencies
  • Fully integrate cluster NAS storage into ITSM workflows with ServiceNow

Configuration Diagram

ServiceNow CMDB configuration diagram

Processes

  1. Eyeglass collects PowerScale Cluster inventory and populates the servicenow.xml file.
  2. Through the scheduler set in the Eyeglass crontab, Python scripts:
    • Convert servicenow.xml into 4 Excel files (Cluster, Node, SMB Share, NFS Export)
    • Attach those Excel files to ServiceNow Data Sources using the REST API
  3. ServiceNow Integration Hub — Imports:
    • Runs on a schedule to automatically import from Data Sources
    • Transforms and maps to customized classes and populates the CMDB

Mapping Class

For this integration, new customized CI classes are created with the following structures:

  • Parent Class: IGLS_PowerScale_Cluster
  • Child Class 1: IGLS_PowerScale_Node (Member of IGLS_PowerScale_Cluster)
  • Child Class 2: IGLS_PowerScale_Share (Contained by IGLS_PowerScale_Cluster)
  • Child Class 3: IGLS_PowerScale_Export (Contained by IGLS_PowerScale_Cluster)

ServiceNow CMDB CI class mapping

Creating Customized CI Class Procedure

  1. Open CI Class Manager.

  2. Click Hierarchy to expand the CI Classes list, then select the class to extend from:

    • For the new parent class IGLS_PowerScale_Cluster: create as a new class directly under the top Configuration Item parent folder structure.
    • For the children classes (IGLS_PowerScale_Node, IGLS_PowerScale_Share, IGLS_PowerScale_Export): create as new classes under IGLS_PowerScale_Cluster.
  3. To create a new class, select the parent class, right-click, and select Add Child Class.

    note

    The Add Child Class option only appears if the selected class is extendable.

  4. On the Provide Basic Info tab, fill in the following fields:

    FieldDescription
    Display nameA unique label for the class (example: IGLS_PowerScale_Cluster). Appears on list and form views.
    Table nameAuto-populated based on the label with prefix u_cmdb_ci. Can be modified (lowercase, alphanumeric, underscores only; max 80 characters).
    DescriptionExplanation of the purpose of the class.
    IconIcon associated with the class.
    ExtensibleEnable for the parent class IGLS_PowerScale_Cluster. Disable for children classes.
    Principal ClassOptional. If enabled, CIs from this class appear in CI list views when the Principal Class filter is applied.
  5. Click Next and accept all default options for the remaining configuration until the new CI Class is created.

  6. Once created, edit the parent class IGLS_PowerScale_Cluster to add the following attributes:

    AttributeTypeDescription
    Cluster_NameStringPowerScale Cluster Name
    Cluster_GUIDStringPowerScale Cluster GUID
    Cluster_LocalSerialStringPowerScale Cluster Local Serial Number
    Cluster_OFSv_BuildStringPowerScale Cluster OneFS version Build
    Cluster_OFSv_ReleaseStringPowerScale Cluster OneFS version Release
    Cluster_OFSv_TypeStringPowerScale Cluster OneFS version Type
    Cluster_OFSv_VersionStringPowerScale Cluster OneFS version Version
    Cluster_OFSv_RevisionIntegerPowerScale Cluster OneFS version Revision
    Node_HealthStringPowerScale Node Health
    Node_SerialNumberStringPowerScale Node Serial Number
    Node_HDDsizeStringPowerScale Node HDD Size
    Node_HDDusedStringPowerScale Node HDD Used
    Node_HDDavailStringPowerScale Node HDD Avail
    Share_NameStringPowerScale Share Name
    Share_PathStringPowerScale Share Path
    Share_ZoneStringPowerScale Share Zone
    Share_StatusStringPowerScale Share Status
    Export_PathsStringPowerScale Export Paths
    Export_ZoneStringPowerScale Export Zone
    Export_StatusStringPowerScale Export Status
  7. For children classes, set the relationships in the Suggested Relationship section:

    ChildChild RelationshipParentParent Relationship
    IGLS_PowerScale_NodeMember ofIGLS_PowerScale_ClusterMember
    IGLS_PowerScale_ShareContained byIGLS_PowerScale_ClusterContain
    IGLS_PowerScale_ExportContained byIGLS_PowerScale_ClusterContain
  8. Once all 4 CI Classes are created, configure the Integration Import Jobs.

CI Class Relationship View

To view the CI Class relationship between parent and children, click Suggested Relationships from the parent CI Class menu.

Integration Import Configuration

  1. Open IntegrationHubImport tool.

  2. Specify the name of the Integration Data Import and provide a short description.

  3. Create 4 Integration Import jobs:

    Import Job Name
    IGLS-PowerScale-Cluster
    IGLS-PowerScale-Node
    IGLS-PowerScale-Share
    IGLS-PowerScale-Export
  4. Set the Source Type to Excel File and upload the initial Excel file manually.

  5. In the Map to Target tab, click Add a Mapping and select the target class:

    Integration Import NameMapping Target Class
    IGLS-PowerScale-ClusterIGLS_PowerScale_Cluster
    IGLS-PowerScale-NodeIGLS_PowerScale_Node
    IGLS-PowerScale-ShareIGLS_PowerScale_Share
    IGLS-PowerScale-ExportIGLS_PowerScale_Export
  6. Configure the field mappings for each import job. Enable the Match toggle on fields used to identify existing records to support updates instead of creating duplicates.

    IGLS-PowerScale-Cluster mapping:

    TargetMatchSource
    nameEnablename
    Cluster_NameDisablename
    Cluster_GUIDDisableguid
    Cluster_LocalSerialDisablelocal_serial
    Cluster_OFSv_BuildDisablebuild
    Cluster_OFSv_ReleaseDisablerelease
    Cluster_OFSv_TypeDisabletype
    Cluster_OFSv_VersionDisableversion
    Cluster_OFSv_RevisionDisablerevision

    IGLS-PowerScale-Node mapping:

    TargetMatchSource
    nameEnablename\serial_number
    Cluster_NameDisablename
    Cluster_GUIDDisableguid
    Node_HealthDisablehealth
    Node_SerialNumberDisableserial_number
    Node_HDDsizeDisableHDD_size
    Node_HDDusedDisableHDD_used
    Node_HDDavailDisableHDD_avail

    IGLS-PowerScale-Share mapping:

    TargetMatchSource
    nameEnablename\zone\name2
    Cluster_NameDisablename
    Cluster_GUIDDisableguid
    Share_NameDisablename2
    Share_PathDisablepath
    Share_ZoneDisablezone
    Share_StatusDisablestatus

    IGLS-PowerScale-Export mapping:

    TargetMatchSource
    nameEnablename\zone3\paths
    Cluster_NameDisablename
    Cluster_GUIDDisableguid
    Export_PathsDisablepaths
    Export_ZoneDisablezone3
    Export_StatusDisablestatus4
  7. Set the import schedule (example: run periodically, every hour).

Data Source Table Name and Table Sys ID

For each ServiceNow Data Source, obtain the Table Sys ID to use when attaching the Excel file to the corresponding Data Source.

To get the Table Sys ID, open the Data Source menu, select the data source, and choose Copy sys id.

ServiceNow CMDB

  1. Switch to the CMDB Workspace view.
  2. Specify CI search criteria (Class, Field, Operator, Value) and click Search.
  3. Customize the column view by clicking Edit Columns from the menu and selecting the columns to display.

CMDB Customized View

  1. Switch to the CMDB Workspace view.
  2. Click the List button from the left side menu, then click My Lists.
  3. Click Add New List at the bottom of the workspace.
  4. Specify a list name, source (CMDB table), and columns, then click Create.

Eyeglass Configuration

Prerequisites

  1. Configure the ServiceNow output directory on the Eyeglass VM:

    mv /srv/www/htdocs/{servicenow} /srv/www/htdocs/servicenow
  2. Install the required Python modules:

    pip install pandas

    pip install openpyxl

XML-to-Excel Conversion Scripts

Convert the servicenow.xml file into 4 Excel files using the following Python scripts placed in /home/admin:

ScriptOutput
igls-convert-cluster.pyigls-powerscale-cluster.xlsx
igls-convert-node.pyigls-powerscale-node.xlsx
igls-convert-share.pyigls-powerscale-share.xlsx
igls-convert-export.pyigls-powerscale-export.xlsx

igls-convert-cluster.py:

import xml.etree.ElementTree as ET
import pandas as pd

xml_file_path = '/srv/www/htdocs/servicenow/servicenow.xml'
tree = ET.parse(xml_file_path)
root = tree.getroot()
clusters = []

for element in root.findall('.//element'):
cluster_name = element.find('.//cluster/name').text
cluster_guid = element.find('.//cluster/guid').text
cluster_local_serial = element.find('.//cluster/local_serial').text
cluster_type = element.find('.//cluster/onefs_version/type').text
cluster_release = element.find('.//cluster/onefs_version/release').text
cluster_build = element.find('.//cluster/onefs_version/build').text
cluster_version = element.find('.//cluster/onefs_version/version').text
cluster_revision = element.find('.//cluster/onefs_version/revision').text
clusters.append([cluster_name, cluster_guid, cluster_local_serial, cluster_type, cluster_release, cluster_build, cluster_version, cluster_revision])

df = pd.DataFrame(clusters, columns=['name', 'guid', 'local_serial', 'type', 'release', 'build', 'version', 'revision'])
output_file = '/home/admin/igls-powerscale-cluster.xlsx'
df.to_excel(output_file, index=False)
print(f'Data saved to {output_file}')

igls-convert-node.py, igls-convert-share.py, and igls-convert-export.py follow the same pattern — parsing the corresponding XML elements and writing to their respective Excel files. See the legacy portal for the complete scripts.

REST API Attachment Scripts

Attach the Excel files to ServiceNow Data Sources using the following Python scripts placed in /home/admin:

ScriptTask
igls-snapi-cluster.pyAttaches igls-powerscale-cluster.xlsx to IGLS-PowerScale-Cluster Data Source
igls-snapi-node.pyAttaches igls-powerscale-node.xlsx to IGLS-PowerScale-Node Data Source
igls-snapi-share.pyAttaches igls-powerscale-share.xlsx to IGLS-PowerScale-Share Data Source
igls-snapi-export.pyAttaches igls-powerscale-export.xlsx to IGLS-PowerScale-Export Data Source

Each script uses the ServiceNow REST API endpoint /api/now/attachment to check for existing attachments, delete them, and upload the new file. Update the following placeholders in each script before running:

instance_url = "https://<servicenow-instance-name>.service-now.com"
username = "<servicenow-user-api>"
password = "<servicenow-password-api>"
table_sys_id = "<specify-target-table-sys-id>"

See the legacy portal for the complete script code.

Master Orchestration Script and Crontab

Combine all scripts into a single servicenow.py for scheduling:

import subprocess

subprocess.run("/opt/.pyenv/shims/python3 /home/admin/igls-convert-cluster.py", shell=True)
subprocess.run("/opt/.pyenv/shims/python3 /home/admin/igls-convert-node.py", shell=True)
subprocess.run("/opt/.pyenv/shims/python3 /home/admin/igls-convert-share.py", shell=True)
subprocess.run("/opt/.pyenv/shims/python3 /home/admin/igls-convert-export.py", shell=True)
subprocess.run("/opt/.pyenv/shims/python3 /home/admin/igls-snapi-cluster.py", shell=True)
subprocess.run("/opt/.pyenv/shims/python3 /home/admin/igls-snapi-node.py", shell=True)
subprocess.run("/opt/.pyenv/shims/python3 /home/admin/igls-snapi-share.py", shell=True)
subprocess.run("/opt/.pyenv/shims/python3 /home/admin/igls-snapi-export.py", shell=True)

As the admin user, create a crontab to schedule the script. Example to run every 30 minutes:

crontab -e
30 * * * * /opt/.pyenv/shims/python3 /home/admin/servicenow.py 2>&1 > /home/admin/mycronout.log